Posted: Tue Jun 04, 2013 1:16 pm Post subject:
Multiple triggers on a single object
This was something that had puzzled me for a while now. I wasn't exactly sure how the attached trigger thing in map triggers was supposed to work. My goal was to attach 3 triggers to a single object using the attached trigger feature. In the end it wasn't too complicated, but interestingly all the triggers (minus the very last one) need to be of type 2 (repeating). To make sure the trigger doesn't get fired over and over again, give the same trigger an action that disables it. So Trigger 1 is a repeating trigger, but disables itself after being fired once. Since it is a repeating trigger now (that doesn't get repeated) we can attach more triggers to it.
The following pictures show how to chain together 3 triggers. They activate when the target is first fired upon, then at 50% and 25% hp. What to use for the event(s) and action(s) are of course for you to decide, just remember to put the "disable trigger" as one of the actions. Or if you wanted one or more of the triggers to keep repeating, then don't use the disable trigger action. If you wanted more triggers attached to a single object, just change trigger 3 into type 2 (repeating) and give it an attached trigger, and so on.
As long as you keep in mind that the primary trigger has to be attached to the Team/TechType and repeating set to 2 and there are no tags for any attached trigger, you should be fine. _________________
There was already a tutorial somewhere, but i can't find it anymore.
It even explained how this works (all trigger use the same Tag) and explained that you can remove the Tags of the additional Trigger. e.g. in your case you have a Tag for Multi-Trigger 1 to 3 and you can remove the Tags for Multi-Trigger 2 and 3 as they use now the Tag of Multi-Trigger 1 too.
The Trigger-type "2-repeating" is set on the Tag, thus changing it on one Trigger, will change it for all attached trigger.
In short: on Objects (Building, Units etc) you assign a single Tag, not Trigger.
Trigger are then attached to each other and one of them (the first one) is assigned to a Tag, thus multiple Trigger can share the same Tag.
This in turn allows multiple Trigger to react on a single object.
P.S.: congrats to your PPM-FTP SuperJoe. Nice to see the pictures now hosted by PPM and not an external filehoster anymore _________________ SHP Artist of Twisted Insurrection: Nod buildings
Oh yeah I forgot to mention that you need to attach the first trigger to the object and / or team. I never bothered to check the Tags, but I guess that makes sense. So in this example Multi-trigger 3 would also be forced to type 2 repeating trigger? In that case if you didn't want it to fire more than once, you'd need to add the disable trigger action even for the last trigger. Doesn't matter at all what Type you make the triggers after the 1st one if they are all forced to be type 2?
Used these multi-triggers to create something bit more complex. 4 triggers attached to a single unit, each of them checks when it has 25% hp left. A single repeating trigger can't get the job done since it bugs out after reaching the condition once (it will activate every time after that when the unit is hit, even if it has full hp). I left only the first trigger enabled. When the unit is at 25% hp, the first trigger activates and disables itself, and enables the second trigger (with a slight delay), and so on. With this the unit changes tactics every time you manage to nearly kill it. Could probably do some other interesting things with these multi-triggers. _________________ QUICK_EDIT
So in this example Multi-trigger 3 would also be forced to type 2 repeating trigger? In that case if you didn't want it to fire more than once, you'd need to add the disable trigger action even for the last trigger. Doesn't matter at all what Type you make the triggers after the 1st one if they are all forced to be type 2?
The attached triggers use the tag of the first (parent) trigger. If you set the tag of that trigger to 2 (repeating), all secondary (child) triggers will be updated to have their repeating flag set to 2 as well.
In the end all secondary triggers will be set to 2 (repeating) and will require a disable action for them-self.
Below there's quick draw I made to explain the tag usage (01000001 is the tag). Since 01000002 and 01000004 have no tag of their own, but are secondary triggers of 01000000 they will use the tag (01000001) of that trigger (01000000).
That's the tag you attach to a structure and also the one that 01000002 and 01000004 will use. Otherwise they don't know what to check.
If you change the repeating flag of 01000002 for instance, it will create a new tag for that trigger (most likely): 01000003.
The trigger will then look for a structure with 01000003 attached to it rather than 01000001, which results in breaking your trigger attachment chain.
Make sure you never ever create a tag for, or touch the repeating flag of a secondary trigger.
Legend:
Red line indicates trigger attachment.
Blue line indicates tag references.
Joined: 10 Dec 2012 Location: I'm too busy conquering the world!
Posted: Tue Jun 04, 2013 11:22 pm Post subject:
I attempted to do this on mission 4 to get the text trigger and damaged heal to work together. Its very complex indeed. _________________ Mod Leader and founder of World Domination
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum