You are not logged in.    Login    New User    Forum Home    Search

Location:
JBPLAY  \  Meteor 2  \  Suggestions  \  Scripting Suggestions

Back to Threads

Viewing Thread: Scripting Suggestions

 

Zable Fahr

Joined: 04 November 2004
Posts: 74
04 November 2004 17:04 (UK time)

I'm finding the scripting engine to be immensely powerful and amazingly cool. Here's my suggestions to make it even better:

UI Triggers:
Like the onMapStart() event, there can be events like onKeyPress(key) that allow a player to interact directly with a map (i.e. press some key when ready to send the transport copter for pickup). Obviously maps will have to avoid conflict with existing game keys, or implement those keys in such a way that it won't interfere with their original functions.

Timers and Timed Events
Maps could set timers (either single-shot or repeating) and when they elapse, they trigger an onTimeElapse(timerID) event. This lets maps do things according to how much time has passed (i.e. blow up the building after 1 minute).

Miscellaneous Script Commands:
createObject - Creates an object with specified properties. Sure, you could use SetObjectHidden, but then you're very limited to the ones you create. Furthermore, because it's created through scripting you can set the properties at runtime. The function returns the objectID if successful, allowing you to do even more scripting with it. This could be useful if you want respawning enemies. Somehow I'm getting images of the Smith scene in Matrix Reloaded :-)
get[Property] - I see a lot of commands that change or do things, but none that retrieve information about the current state of the game. There could be a set of functions like getPlayerHP, getPlayerInventory, etc. that allows a map to know what's going on with the current game and act accordingly. You could use this to maybe check for if the player has a certain keycard, and when he enters a certain sector, that sector has a script trigger that checks for the keycard and sends in enemy reinforcements if he doesn't.
setSectorScriptTrigger - This I think could be really neat, but I'm not entirely sure how sector script triggers are implemented so it could be either very hard or very easy to do. Basically, this command sets the script associated with a sector. You could have a sector that will normally send in enemy reinforcements when the player enters the sector unless you do something that causes the sector's script trigger to be changed to something else.

These are just some ideas on how to improve the script system, which I think has a lot of potential. Keep up the good work, James!

You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
05 November 2004 20:24 (UK time)

All nice ideas, I especially like the on key down events.

It would be nice to have a global script file containing the control system. Each control event would have a name which can be bound to keys. When modding the mod auther could then replace these with their own control functions.

I need to put some thought into all this.

As for the inventory and player health I plan on adding these functions.

You need to login to create posts in this thread.

Zable Fahr

Joined: 04 November 2004
Posts: 74
06 November 2004 02:18 (UK time)

Great! I was hoping there would be commands to retrieve game variables. I also have a few more new ideas:

- onObjectDestroy(objectID) event: Lets a map respond to the destruction of enemies or other objects.
- SC_EndCurrentLevel could take a single argument that is basically the map's exit code. "0" is the default if no argument is given (for reverse compatibility) and the game simply goes to the next level. "-1" means the mission was a failure, and the game should go back to the main screen. Any other value is interpreted as a string representing the filename of the next level, and the game goes to that level instead of the default one.
- A followup to my timer idea: Passing the timerID to the event trigger might not be the best solution, since the map will need some global variables to keep track of each timer, and that might get messy. Instead, when creating a timer, you specify what command gets called, similar to how sector triggers call a specified command.

I hope you're not thinking I'm being too demanding. You can implement as much as you like; I'm just giving you some ideas to think about :-).

(P.S. Is there some sort of cookie timeout with the forums? It seems that if I spend too much time typing a message, then it gives a database error when I save it.)

You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
06 November 2004 16:14 (UK time)

More nice ideas here are some notes...

The SC_Wait() function will wait for the specified time. This will run in the background so you can have delays using this method. Please note that at the moment I think this actually pauses the game but I plan to fix this.

As for the mission failed thing I will simply add a function called SC_GameOver().

I like the idea about event based functions, thats a peice of cake to implement for me, I can just modify the internal kill object code, something like this...

void GO_KillGameObject( int inNum, char inSilent)
{
char ExeString[64];

sprintf( ExeString, "onObjectDie_%d();", DAT_GameData.GameObjects[inNum].id);

SC_RunSingleCommand( ExeString);

...blah blah blah...
}


You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
06 November 2004 16:17 (UK time)

Oh an about the timers. M2 can run up to 32 script instances/processes at the same time so provided that you don't have too many SC_Wait() calls on your map you will be fine. Remember that I still need to upgrade the script code so it actually runs in the background (I am not actually sure if it does already lol).

Its a bit tricky when saving games, it may forget whats running when the game is loaded, this is a real pain.

You need to login to create posts in this thread.

Knasp

Joined: 18 June 2004
Posts: 158
11 November 2004 19:30 (UK time)

You can make an event when a player goes in a area but you cant make an event when other objects enters a area.It would add more ways of events.Maybe you could add it in the map editor, in Sector Properties/Script Trigger/and then "Affect All Objects" or something like that.Another thing that would be good is if you could with script change any AI to NO AI or that you can make objects freeze or stop.This is just some ideas i have, it would be cool if you can add them.

You need to login to create posts in this thread.



Forums system (C) 1999-2023 by James Bunting.

Terms of Use