Location: JBPLAY \ Meteor 2 \ Editing \ Scripting question Back to Threads |
shockdrop
![]() Joined: 01 March 2005 Posts: 236 |
17 April 2005 22:15 (UK time)
Is there a event trigger so in runs the stuff when you cross a sector instead of scripting it in the map editor. I tried putting "void onSectorCross_10" 10 is the sector id. it didn't work. You need to login to create posts in this thread. |
Assain
![]() Joined: 02 November 2003 Posts: 979 |
18 April 2005 00:34 (UK time)
First of all, it would be "OnSectorPass(10);" (or however you had it). 2nd, you dont need to do this. Event triggers are supposed to be always on, and when a certain somthing happens in the game, it runs the event accociated with it. If you want somthing to happen after you pass a sector, just set it so when you run into the sector, it runs a script to do whatevver you want it to. If you want it to happen AFTER you pass it, just make a new sector after the sector you want somthing to happen past, except make the new sector the same texture as the sector that is currently after the sector you want somthing to happen passed. Then, on this newly created sector, set a script on it. Hope that wasnt to confusing ![]() You need to login to create posts in this thread. |
shockdrop
![]() Joined: 01 March 2005 Posts: 236 |
18 April 2005 01:49 (UK time)
I want it so when i walk over the sector it runs more than 1 thing at a time. And i tried putting OnSectorPass(10); but it didn't work. You need to login to create posts in this thread. |
shockdrop
![]() Joined: 01 March 2005 Posts: 236 |
18 April 2005 02:22 (UK time)
If i put OnSectorPass_10() it runs the scripting file but it wont run the scripts under it when i cross the sector. Edited: 18 April 2005 04:57 You need to login to create posts in this thread. |
Dave Man
Joined: 19 October 2003 Posts: 374 |
18 April 2005 13:29 (UK time)
Too run mulitple script commands you can program them first in the script file with single commands like this: export Runit; // more info here void Runnit() { //commands } Now unlike normal void commands that run in a certain instance, this command only works when you call it. You call it from a sector with its sector string command by: run Runnit(or your command);. That command would run your sricpt code in your script file. If you want to rerun the code for an ammount of turns you can then just reactivate the tile each time you run the code. Edited: 18 April 2005 13:30 You need to login to create posts in this thread. |
me_mantis
![]() Joined: 26 September 2003 Posts: 1152 |
18 April 2005 15:40 (UK time)
For some very useful scripting help, please dl the script tutorial map on meteormods.com Its a great way to get into scripting. You need to login to create posts in this thread. |
shockdrop
![]() Joined: 01 March 2005 Posts: 236 |
18 April 2005 21:34 (UK time)
I know how to script good enough but i can't get this to work. I have it so the alarm sounds on a sector script trigger but i need it so i can do more than one thing when i cross the sector. This is the file part: // tell M2 which functions it can use export OnMapStart; export OnSectorPass_10; void OnMapStart() { // Hide Mini-Tanks SC_SetObjectHidden(6,1); SC_SetObjectHidden(7,1); SC_SetObjectHidden(8,1); SC_SetObjectHidden(9,1); SC_SetObjectHidden(10,1); // make mini-tanks indestructible SC_SetObjectIndestructible(6,1); SC_SetObjectIndestructible(7,1); SC_SetObjectIndestructible(8,1); SC_SetObjectIndestructible(9,1); SC_SetObjectIndestructible(10,1); // hide wall SC_SetSectorHidden(49,1); } void OnSectorPass_10() { // show Mini-Tanks SC_SetObjectHidden(6,0); SC_SetObjectHidden(7,0); SC_SetObjectHidden(8,0); SC_SetObjectHidden(9,0); SC_SetObjectHidden(10,0); } What's wrong with this? You need to login to create posts in this thread. |
Assain
![]() Joined: 02 November 2003 Posts: 979 |
18 April 2005 22:02 (UK time)
Oh, and BTW, the "OnSectorPass(10)" script was just an example, showing you that you would use "()" instead of an underscore; it doesnt accutally exsist. Technically, you SHOULD be able to do as many things as possible when advanced scripting. For instance: ///Tells Helos to attack and sounds a radio call. Also sets ///them on a waypoint (2 helos are being used in this ex.) void Attack(); { SetObjectHidden(10,0); SetObjectHidden(11,0); PlaySound("world\\radio" ![]() BindObjectToWaypoint(10,24); BindObjectToWaypoint(11,25); } Then at the top it would say: export Attack(); When you want to run the script, in the editor, type under the scripting aria of a sector, "run Attack" (without the ";" ![]() Now, time for me to try and proofread your script, i am assuming this is all of it? EDIT: Ok i think your problem lies with the "OnSectorPass_10()". Sence this is just a varible name being used for the following script, it doesnt matter (usually) what you call it. But, I dont think the game registers underscores correctly. So, try naming it "OnSectorPass()". You also might need to add the ";" after your void commands (ie "OnSectorPass()<b>;</b>" ![]() Edited: 18 April 2005 22:11 You need to login to create posts in this thread. |
shockdrop
![]() Joined: 01 March 2005 Posts: 236 |
19 April 2005 04:19 (UK time)
I got it now. You need to login to create posts in this thread. |
|
Forums system (C) 1999-2023 by James Bunting.
Terms of Use