Take On Mars

Take On Mars

View Stats:
INFIDEL Feb 8, 2017 @ 3:52am
Scripting a Time Delayed Event g_Game.ShowHint
/******************************************************************************* * \brief Displays a little hint to the player. * * g_Game is a special object avaialable everywhere. To see what it can do check * out the class definition for MyGame and CGame in scripts/game.h and in * scripts/ccgame.c. * * For more information on displaying messages to the player, check out my guide * Scenario Creating III: Displaying Messages to the Player. *******************************************************************************/ void ShowHint() { g_Game.ShowHint( String( "Creepy AF" ), 8, true ); }

I'm not clear on how to add this as scripted event... I want a timer built into somewhere but don't know how to do it.
< >
Showing 1-5 of 5 comments
INFIDEL Feb 8, 2017 @ 3:53am 
I see there is a timer in the editor. How does that work?
Originally posted by INFIDEL:
I see there is a timer in the editor. How does that work?

Place the timer event into the world and left click it to set the desired time. Then while holding down shift and with the timer event still selected left click the event you want the timer to activate hit CTRL+L to 'link' the timer event to whatever other event you want activated after a certain amount of time has passed. Which you set when you first left clicked the timer.

A good example: http://steamcommunity.com/sharedfiles/filedetails/?id=821743616
INFIDEL Feb 8, 2017 @ 8:34am 
Ah ha! I read dariusz's guides but there is quite a lot to absorb. I lost track of linking events... this will be nice to try out.

So a follow up... when using an event script how does one call something simple like a supply drop to a coordinate? I would hope that where the script event is placed would help out in relation to where the supply drop flight spawned to.

https://steamcommunity.com/sharedfiles/filedetails/?id=822072989

Would you mind taking the time to enlighten me further? Example Event Script:
LST File
ExecuteScript() 000132:0x0000012c: call GetTKOMEntityByID(_i10000002) 000132:0x00000138: move printer, [0x18211824] 000132:0x00000144: cmpi printer, _i0 000132:0x00000150: beq 0x00015c 000132:0x00000154: delete printer 000132:0x0000015c: call GetTKOMEntityByID(_i10000026) 000132:0x00000168: move mml, [0x18211824] 000132:0x00000174: cmpi mml, _i0 000132:0x00000180: beq 0x00018c 000132:0x00000184: delete mml 000132:0x0000018c: call GetTKOMEntityByID(_i10000015) 000132:0x00000198: move missile, [0x18211824] 000132:0x000001a4: cmpi missile, _i0 000132:0x000001b0: beq 0x0001bc 000132:0x000001b4: delete missile 000132:0x000001bc: rts Module static size 1637952
Header
void ExecuteScript( Event_Script eventScript ) { TKOM_Entity printer = GetTKOMEntityByID( 10000002 ); if( printer ) delete printer; TKOM_Entity mml = GetTKOMEntityByID( 10000026 ); if( mml ) delete mml; TKOM_Entity missile = GetTKOMEntityByID( 10000015); if( missile ) delete missile; }
Last edited by INFIDEL; Feb 8, 2017 @ 9:08am
INFIDEL Feb 8, 2017 @ 8:54am 
EVENT_FX 21 "1 0 0" "0 1 0" "0 0 1" "-17053.3 4180.66 2558.15" "particle/weapon/nuclear_explosion.ptc" "effects/explosions/nuke" EVENT_SCRIPT 23 "0.1 0 0" "0 0.1 0" "0 0 0.1" "-17205.5 4192.14 2559.37" "data/scripts/bomb.h" EVENT_TIMER 24 "0.1 0 0" "0 0.1 0" "0 0 0.1" "-17143.5 4199.71 2558.96" 3 0 EVENT_LINKS 23 TRIGGER_ENTER 16 "-17081.2 4184.27 3127.45" 320 320 true true true true false true TRIGGER_LINK 21 TRIGGER_LINK 24

I see the event fx but I'm still not getting how the missile is spawned... it has to be an event but I don't know how to make this step or the step where the MML is deleted.
bomb.h is where the MML and everything else is deleted or removed from the world.

void ExecuteScript( Event_Script eventScript )
{
TKOM_Entity printer = GetTKOMEntityByID( 10000002 );
if( printer )
delete printer;

TKOM_Entity mml = GetTKOMEntityByID( 10000026 );
if( mml )
delete mml;

TKOM_Entity missile = GetTKOMEntityByID( 10000015);
if( missile )
delete missile;

}
< >
Showing 1-5 of 5 comments
Per page: 1530 50