Script-Event: dynamited


(nUllSkillZ) #1

Hi,

in the source code in “g_script.c” I’ve found the event “dynamited”.
I think this event is triggered when the dynamite is planted.
So I guess it can be used wit “func_explosive”- and “func_constructible”-entities.
I’ve tried to use it with a “func_explosive”-entity.
But I’ve failed.
Has anyone tried to use this event in scripts?
Many thanks in advance.

EDIT:
I’ve found out that this event can be used in the script-block of a “trigger_objective_info”-entity.
BTW there’s also a “defused”-event.


(Chruker) #2

I assumed this was the way the fueldump script makes sure that the tank can’t pass the bridge once dynamite has been planted. But then I looked at the script and only found this in the stuck check for dynamite on the bridge.

accum 0 set_to_dynamitecount bridgetarget

I did not know that ‘set_to_dynamitecount’ existed, and the LDR scripting appendix, doesn’t mention it either. However it is present in the source code.

Regarding my notes on the defused event - its the entity that is targeted by trigger_objective_info that has that event.


(FireFly) #3

this event can be used in the script-block of a “trigger_objective_info”-entity

I’ve tried it and it works perfectly!
In my map the allies have to blow up a big door (just like in Radar).
I made it so that:
When the allies plant the dynamite it triggers an alarm sound,
when the doors are blown the alarm sound stops…

thanks,

EDIT:

I’ve tried the “defused” statement ( so the alarm sound stops when it gets defused by an axis engineer, but that didn’t seem to work)


maindoor1 
{
	spawn
	{
		accum 2 set 0
		wait 50
		constructible_class	3
		setstate maindoor1 default
	}

	death
	{
		trigger tank doors_destroyed
		trigger game_manager maindoor1_destroyed
		togglespeaker maindooralarm
	}
}

maindoor1_trig
{
	spawn
	{
	}

	 dynamited 
   	{ 
      		togglespeaker maindooralarm
   	}
		
	defused
	{ 
      		togglespeaker maindooralarm
   	}

}



(nUllSkillZ) #4

@FireFly:
May be you can add something like:


wm_announce "Defused triggered!!!"

To see if the event is triggered.

There are also additional options when testing maps:


+set logfile 1
+set g_scriptdebug 1

I’ve added these to my shortcut.
You can also input these commands at console (then with “/” instead of “+”).
This creates a “.log”-file in the “etmain”-directory.
With these options all of the events / actions of the script are recorded.


(FireFly) #5

I use /g_scriptdebug 1 alot but i didn’t know you can produce a log-file with /logfile 1 , Thanks for the info, a very usefull command for checking your script.

Well, I added "wm_announce “Defused triggered!!!” to the script but it seems that whatever is in the “defused” part just doesn’t get triggered.

here’s the log:


logfile opened on Thu Apr 29 22:32:04 2004

]/set g_scriptdebug 1

110950 : (maindoor1_trig) GScript event: dynamited 
110950 : (maindoor1_trig) GScript command: togglespeaker maindooralarm
Planted at the Main Entrance to the Rocket Base.
114500 : (n/a) GScript event: playerstart 
[skipnotify]FireFly^7 entered the game
FireFly^7 has joined the Axis team^7!
125000 : (maindoor1) GScript event: defused 
Defused at the Main Entrance to the Rocket Base.
----- Server Shutdown -----
==== ShutdownGame ====
---------------------------
----- CL_Shutdown -----
RE_Shutdown( 1 )
Shutting down OpenGL subsystem
...wglMakeCurrent( NULL, NULL ): success
...deleting GL context: success
...releasing DC: success
...destroying window
...resetting display
...shutting down QGL
...unloading OpenGL DLL
-----------------------

strange, although the game recognizes the “defused” statement as you can see in the log-file above, it doesn’'t trigger the wm_anounce statement nor does it trigger the togglespeaker statement as it does when the dynamite is planted…


maindoor1_trig
{
	spawn
	{
	}

	 dynamited 
   	{ 
      		togglespeaker maindooralarm
   	}
		
	defused
	{ 
      		wm_announce "Defused triggered!!!"
		togglespeaker maindooralarm
   	}

}

(nUllSkillZ) #6

The logfile says:
(maindoor1_trig) GScript event: dynamited

But it says:
(maindoor1) GScript event: defused

So try to place the “defused”-event in the “maindoor1”-entity-scriptblock.


(FireFly) #7

YES! It works, thank you so much…

I placed the “defused”-event in the “maindoor1”-entity-scriptblock and when a axis engineer defuses the dynomite the alarm sound stops and I get the announcement “Defused Triggered”

I couldn’t figure out why the ‘Dynamited’ event worked but the ‘defused’ event didn’t, now realise why,

again thanks for all the help nUllSkillZ