Toggling an entity via scripting?


(G0-Gerbil) #1

I have a chain of entities that fire off every second.
One part of the chain is a target_relay that splits the event chain into 3 paths.
Obviously normally all 3 paths would get processed each second, but I want to change this functionality, so that 1 path always work, and the other 2 are conditional.
I can’t alertentity them (obviously this won’t toggle, merely get them to process their entites again), and setstate on target_relays doesn’t seem to stop the chain at that node (which I was kinda hoping it would :confused: ).
So erm, anyone got any other ideas, other than having the 3 paths completely seperate and toggling the timer for each as required?
Reason being I want to keep the entity set up in the .MAP as simple as possible and do the required changes via scripting.

The ultimate result I’m after is having a target_print be in an active entity chain, but not actually get processed.

As an aside the big problem with target_prints using activator is obviously they must initiate from the original entity chain otherwise they lose the ‘activator’ reference and cause a crash (if they are set to a team they can just be alone and alertentity them, same if global). So the entity MUST be part of the chain, but I want the actual print to be controlled by me.


(chavo_one) #2

So are you saying that you have three target_relays that target their own target_prints (therefore having three different target_prints)? If so, does setstate work on the target_print entity? If it does, you could have the target_relays always fire, but control which target_prints get displayed with setstate in the script.


(G0-Gerbil) #3

setstate doesn’t work on the target_prints, no :frowning:
Nor any other entity as such.

In the end I’ve done what I was hoping to avoid, and it’s not REALLY that big a deal.
3 identical trigger_multiples (set to 1/2 second)
1 of which triggers always
The other 2 are setstate invisible’d to begin with, and I setstate default them as needed.
Since I want the 2 optional target_prints to trigger only once, I’ve got the following setup for each of them:

trigger_multiple targets both a target_print and a target_script_trigger
The target_script_trigger calls a script that immediately setstates it’s calling trigger_multiple invisible

So now all I have to do to get the message to print once is to setstate default the trigger_multiple and it’ll print and switch itself off.

This was for the patrol points, hence why I was hoping to get away with 1 trigger_multiple and scripting alone, cos it’d be easier for other people to use them. Oh well :slight_smile: