Hello,
I'm attempting to access a trigger outside of one of the trigger callback functions and am not having luck. I've attempted to create a SimObject() with various bits of data, including the trigger but it doesn't seem TTmod_addTrigger returns the trigger after creation.
Is there anyway to either add a return of the trigger toTTmod_addTrigger, or have a TTmod_findTriggerByGeoID or something of the sort.
Thank you in advance!
Re: Obtaining a trigger object for use with TTmod_removeTrigger
2Hi,
you are right, the addTrigger function should indeed return the trigger object, but doesn't. I will add this in the next update.
Meanwhile you can loop the triggers group to find the one you are looking for:
The trigger objects don't store the GeoID, but you can convert the GeoID to position like this:
Cheers
you are right, the addTrigger function should indeed return the trigger object, but doesn't. I will add this in the next update.
Meanwhile you can loop the triggers group to find the one you are looking for:
Code: Select all
foreach( %trigger in $TTmod::Triggers ) {
if( %mypos $= %trigger.position ) ...
}
Code: Select all
%mypos = TTmod_getPosition(%geoid);