Posted: Wed Mar 14, 2012 9:02 am Post subject:
Trigger help
Subject description: Shutdown buildings, when others are destroyed
I would like to know how to disable certain buildings, if other buildings are destroyed.
e.g. i have 3 radars and want to shut down (action 61 turn off building) 2 barracks once all three radars are destroyed.
Is it really necessary to create for each radar a trigger with event 48 destroyed by anything and set this way 3 local variables, one for each radar?
Then add another trigger with 3 events with each having "36 local is set" and one of the 3 local variables assigned.
Do 3 events really work in an "AND" connection? I dont want to shut down the barracks after every single destroyed radar, but only when all 3 are destroyed.
Can someone give me an overview how to achieve the described scenario? _________________ SHP Artist of Twisted Insurrection: Nod buildings
Posted: Wed Mar 14, 2012 9:41 am Post subject:
Re: Trigger help
Alternatively, you can create a new house for the radars only. Then create a trigger that activates once all structures (the three radars) from this house are destroyed. The trigger then disables the barracks.
But yeah, AFAIK events usually function in AND situation. This may depend on the events and their order, though. I can't remember 100%. _________________
Using a new house is not possible in MP maps and also like using a sledge hammer for a small nail.
Strange that even TD supported OR and AND relations in trigger.
0 was not repeating
1 was AND
2 was OR
I wonder if using a 1 on the trigger type works in TS, even if FinalSun only knows 0 and 2. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Posted: Wed Mar 14, 2012 2:40 pm Post subject:
Re: Trigger help
Lin Kuei Ominae wrote:
Do 3 events really work in an "AND" connection? I dont want to shut down the barracks after every single destroyed radar, but only when all 3 are destroyed.
Can someone give me an overview how to achieve the described scenario?
that would work and is actually how I have chosen to do it in a couple of maps. For example in Yelcraz Island once all the churches are destroyed it triggers an Ion Storm. Whether or not it's the easy way to do it, I don't know. But it does work. And one particular reason I like doing it this way is because you can easily cause other events and circumstances from each radar being destroyed with use of the local it sets.
However keep in mind that, like Crimsonum thought, the event order DOES matter in some cases. By some cases I mean typically anything that depends on time. If you're just using locals you probably won't have to worry about it but if say you wanted something to trigger 1000 tics after a local is set then you'd want to put the local first and then the Elapsed Time event otherwise the elapsed time part runs and the trigger will then fire right after the local is set. Or at least that's been my experience.
So yes, 3 triggers one for each radar which sets a local, and then another trigger which shuts down both barracks after the 3 locals are set should work for the situation. _________________ Kalistia Crestland (2)
In Soviet Russia, grass grows on tiberium! QUICK_EDIT
Does anyone noticed a limit for the max amount of local variables and/or triggers?
Since tunnels can be only max 127 on one map (max 127 entries in the Tubes section), i fear there might be a limit on these as well.
\EDIT
yay, as expected, the 1 does indeed work. (see attached picture)
If you set the trigger Type to 1, it will work with an "AND" relation.
I've added this trigger to 3 radars. It has the event "destroyed by anything" and the trigger won't activate until all 3 radars are destroyed.
I know I've seen 1 used in some WW missions in that box before but never bothered looking into why or how it was used. Good to know though.
As for a limit on the locals...if there is one it's a high enough number that I doubt you'll use them all. I think the most i've seen before was on the 2nd Nod firestorm mission where you have to use the civilians to bait the tib creatures out of the genesis pit to destroy all the GDI base and civi city on the other side of the river. I think that map uses like 60 some odd locals altogether and most of them are linked too IIRC. _________________ Kalistia Crestland (2)
In Soviet Russia, grass grows on tiberium! QUICK_EDIT
As for a limit on the locals...if there is one it's a high enough number that I doubt you'll use them all. I think the most i've seen before was on the 2nd Nod firestorm mission where you have to use the civilians to bait the tib creatures out of the genesis pit to destroy all the GDI base and civi city on the other side of the river. I think that map uses like 60 some odd locals altogether and most of them are linked too IIRC.
Must've been a pain to debug that one, lol. _________________
WW had an ingame map editor and debug windows. Thus they surely hadn't to map, start the game, load the map, test the trigger, leave the game, continue mapping. They only had to start the game and map. I guess they were able to produce maps 5 times faster than we can. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Posted: Wed Jun 27, 2012 11:46 am Post subject:
Trigger help the 2nd
This is somewhat related to this so i continue this topic.
How can i trigger that a single building should shutdown after 30 seconds, then turn on after another 30 seconds, then shut down again after another 30 sec and so on?
Since each Trigger has its own unique Tag, and only one Tag can be assigned to a building, how can i assign the other Trigger to the building? (one Trigger for shutdown, the other for turning on)
In other words, how can i assign two different Triggers to one building? Last edited by Lin Kuei Ominae on Wed Jun 27, 2012 11:56 am; edited 1 time in total QUICK_EDIT
A nice easy tutorial posted by Allied General on Revora should clear that up for you.
Allied General wrote:
The thing you must understand is that you do not actually attach a trigger to an object. What you are really doing is attaching that trigger's tag. So what you need is a common tag for all triggers involved. Let's consider an example where you want to attach 2 triggers to the same building.
Make both triggers, and call them TRIG1 and TRIG2. Now edit TRIG1: in the "attached trigger" field (you thought you would never use this, right?), select TRIG2. Now TRIG2 is attached to TRIG1, so TRIG2 doesn't need a tag anymore -- because it can use TRIG1's tag instead! At this point, open into the Tag Editor and find TRIG2's tag, and delete it. It is no longer needed and its presence would just confuse things. You want to force TRIG2 to use TRIG1's tag.
Double-check TRIG1 in the trigger editor and make sure it is set to Type2 (repeating). You must do this or your multiple trigger arrangement will not work properly. This is because tags can be repeating or not -- not triggers. If the tag was not flagged as a repeating tag, then when the first trigger fires the tag gets "used up", and the second trigger would never fire. After you set TRIG1 to be repeating, you can check TRIG2 and you will see it has automagically become a Type2 trigger as well.
Now double-click on your building, and attach TRIG1's tag to it. Both triggers are now attached to the same building!
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