Location: JBPLAY \ Meteor 2 \ Help and Guidance \ i need scripting help! Back to Threads |
mr_no_name
Posts: 11 |
21 December 2007 03:16 (UK time)
wuts wrong in the scripting? i can't figure it out... #title "" #author "" #include meteor2 export OnWaypointReached_21; void OnWaypointReached_21() { int NewObjectId //make blobs NewObjectId = SC_AddObject( "blob.ob", 547, 1799, -1, AI_ROAMING, 4, "", 1, 0, 0); //bind to track point to make more blobs SC_BindObjectToWaypoint( NewObjectId, 21); } or this one: #title "" #author "" #include meteor2 export OnWaypointReached_21; void OnWaypointReached_21() { int NewObjectId if( SC_ObjectExists(10) == 1) { //make blobs NewObjectId = SC_AddObject( "blob.ob", 547, 1799, -1, AI_ROAMING, 4, "", 1, 0, 0); //bind to track point to make more blobs SC_BindObjectToWaypoint( NewObjectId, 21); } } Edited: 21 December 2007 08:41 You need to login to create posts in this thread. |
mike323
Posts: 745 |
21 December 2007 20:33 (UK time)
You tell us. What is it doing? (Or not doing?) You need to login to create posts in this thread. |
Canuck
![]() Joined: 31 August 2007 Posts: 419 |
21 December 2007 21:59 (UK time)
Maybe try this void OnWaypointReached_21(int ObjectId) instead of void OnWaypointReached_21() I'm not even sure if you even have to do this, but I usually do, it might help. You need to login to create posts in this thread. |
mr_no_name
Posts: 11 |
22 December 2007 02:22 (UK time)
to canuck: oh i figured out wut was wrong, i forgot to add ; at the end of int NewObjectId... but thers still something wrong with this one: #title #author #include meteor2 export OnWaypointReached_21; void OnWaypointReached_21() { int NewObjectId; if( SC_ObjectExists(10) == 1) { //make blobs NewObjectId = SC_AddObject( blob.ob, 547, 1799, -1, AI_ROAMING, 4, , 1, 0, 0); //bind to track point to make more blobs SC_BindObjectToWaypoint( NewObjectId, 21); } } Edited: 22 December 2007 02:29 You need to login to create posts in this thread. |
mr_no_name
Posts: 11 |
22 December 2007 02:25 (UK time)
to mike: Okay, so first, i made a blob go to a waypoint (ID 21), and then make more blobs once it gets to that waypoint, using the script... but I fixed the first script, but the second one never works (the second script is in the last post i did) Edited: 22 December 2007 02:28 You need to login to create posts in this thread. |
nyasudah![]()
Joined: 06 February 2005 Posts: 832 |
22 December 2007 05:48 (UK time)
you have to activate the script each time after you use it i know thers somewhere a script command for it i found it: ............... void SC_SetSectorTriggerEnabled( int SectorId, int value); Once a sector trigger is used it is disabled by default (so it won't run again). Using this function a sector's trigger can be re-enabled (or disabled for that matter). Notes Setting a sector's required item in the Map Editor also affects if scripts are run (this is not for doors only). Example if( SC_GetItemCount("Hot Dinner" ![]() { SC_GameMessage("You need 300 hot dinners to make this script work!" ![]() // re-enable this trigger for next time SC_SetSectorTriggerEnabled(10,1); ...................... though its sector based, so you have to use one somehow i leave this one to you.. i hope it helps
Edited: 22 December 2007 05:53 You need to login to create posts in this thread. |
DarkRain
![]() Joined: 01 March 2007 Posts: 1193 |
04 January 2008 08:38 (UK time)
Good question. Why do we need static flags?
Edited: 04 January 2008 08:38 You need to login to create posts in this thread. |
mike323
Posts: 745 |
06 January 2008 00:16 (UK time)
Static flags represent global int variables. James was telling me that, since you can't create global vars in .SC files, StaticFlags is a great workaround. You need to login to create posts in this thread. |
DarkRain
![]() Joined: 01 March 2007 Posts: 1193 |
06 January 2008 07:47 (UK time)
Oh, I understand now.
You need to login to create posts in this thread. |
Dthdealer
![]() Joined: 10 March 2007 Posts: 476 |
11 January 2008 04:01 (UK time)
I wouldn't have a clue what the difference is.
You need to login to create posts in this thread. |
mike323
Posts: 745 |
24 January 2008 02:33 (UK time)
Global variables can be used anywhere, whereas normal variables can only be used on the same level as the one at which it was called. So if you had: int hello; Callback1() { // hello can be used here } Callback2() { // hello can also be used here } Unlike if you created a normal variable: Callback1() { int hello; // hello can be used here } Callback2() { // hello cannot be used here } You need to login to create posts in this thread. |
ParaSait
![]() Joined: 26 June 2007 Posts: 1478 |
24 January 2008 17:32 (UK time)
Lol, I didn't even know that you can use vars in M2 level scripts XD So if I get it right, the M2 scripting language is actually pure C++, and NOT just some kind of clone? If that is correct, it would open a lot of features for me and will be MUCH more simple to create special stuff =D
Edited: 24 January 2008 17:32 You need to login to create posts in this thread. |
nyasudah![]()
Joined: 06 February 2005 Posts: 832 |
24 January 2008 17:39 (UK time)
then you must be good at programming in C
You need to login to create posts in this thread. |
DarkRain
![]() Joined: 01 March 2007 Posts: 1193 |
25 January 2008 11:26 (UK time)
I know some things on Pascal but I know nothing about C++.
You need to login to create posts in this thread. |
Dthdealer
![]() Joined: 10 March 2007 Posts: 476 |
01 February 2008 07:51 (UK time)
http://www.jbgames.com/games/meteor2/docs/ScriptCommandsList.htm#Standard_C_Functions M2 is C+ with some M2 only commands that are only recognized by the M2 engine.
Edited: 01 February 2008 07:52 You need to login to create posts in this thread. |
arezey
![]() Joined: 16 June 2005 Posts: 1599 |
04 February 2008 21:59 (UK time)
In fact, did you guys ever notice that StaticFlags also work between levels? =) You need to login to create posts in this thread. |
Dthdealer
![]() Joined: 10 March 2007 Posts: 476 |
06 February 2008 07:39 (UK time)
...AWESOME. I never knew that. I'll keep that in mind.
You need to login to create posts in this thread. |
DarkRain
![]() Joined: 01 March 2007 Posts: 1193 |
06 February 2008 09:38 (UK time)
That fact was unknown for me too.
You need to login to create posts in this thread. |
|
Forums system (C) 1999-2023 by James Bunting.
Terms of Use