Small bug with trigger_if_equal command


(Stektr33) #1

Not sure if this is by design or a bug with the “trigger_if_equal” script command:
If you’re attempting to trigger something within the same entity, you can’t use the keyword “self”, you have to specify the entity name itself (sorry if my lingo is off).

So for example (pseduo):


game_manager
{
trigger some_trigger
{
  accum 1 trigger_if_equal 1 self another_trigger
}
trigger another_trigger
{
}
}

causes it to spit out a
“G_Scripting: trigger has unknown name: another_trigger” error.
The word self has to be replaced with entity name “game_manager”

The error is only encountered right when that part of the script is executed, not during load time.

Just out of curiosity, is this by design, something that I might not be considering how the command works?


(G0-Gerbil) #2

I didn’t even know you could do that - the only compare commands I knew of was abort_if_…

So there may be a bug in that you can’t use the self reference, but this is actually good news to me :smiley:


(G0-Gerbil) #3

In fact, is this documented anywhere? I couldn’t find it in the LDM?


(chavo_one) #4

trigger_if_equal is used all over the place in the dispatch functions for escortable vehicles. Don’t you have an escortable tank in helmsdeep?


(Stektr33) #5

Yeah, I actually didn’t know about it till a couple days ago when i ran into some post that had that in the script example.
I went and changed all my explicit triggers to use this “if then trigger” command.
Well at any rate, just beware of this minor pitfall.


(G0-Gerbil) #6

Actually I did track it down in the LDM, but it is only listed, not explained.
I did a search on google for it, and the only 2 results both called themselves using the object name and not ‘self’, so it looks like that be yer lot.

Chavo - as if I did anything other than copy and paste :smiley:


(chavo_one) #7

And this coming from the guy who just implemented something as cool as patrol points.

:banana: