Dreavyn 1 Posted May 11, 2013 Hey everybody! I was watching some of the Editor Tutorials that are out there and I noticed there wasn't one yet on getting a trigger to fire on the destruction of a building, so I went ahead and made one for you guys. Enjoy :) -Dreavyn Share this post Link to post Share on other sites
johnnyboy 3797 Posted May 12, 2013 Thanks dude, that was very useful. I'm curious why it required you to link the trigger to the gamelogic. It looked like the trigger condition had all the info it needed without linking... Share this post Link to post Share on other sites
Beerkan 71 Posted May 12, 2013 (edited) Or do it the quick way:- Enable ID's in the editor by clicking on the [iD] menu button. Zoom in so you can see the building ID. Create a trigger near the building and set the following on it:- Axis A = 5 Axis B = 5 Activation Once Not Present Put what ever you want in the 'On Act' ie. titletext[format["Building Destroyed."],"PLAIN"]; and click [OK] Move your trigger over the building so it's Axis A and B diameter cover the whole building. Go back into trigger and increase Axis A & B if required. Now either select group or press F2, and drag the line from the trigger to the building's ID and let go. When you edit the trigger you will now see it's Activation is set to Static Object and Not Present. No need for Game Logic, syncing triggers or remembering the building's ID. Simples.. Edited June 3, 2013 by Beerkan Added images to help explain better. Share this post Link to post Share on other sites
sproyd 2 Posted June 3, 2013 I can confirm @Beerkan's way works the easiest (and is visually represented to boot). Before finding this thread I couldn't work out why my trigger wouldn't work and then I realised that I had to place the trigger directly over the building despite already being grouped with it. Share this post Link to post Share on other sites
meatball 25 Posted August 18, 2013 Has anyone had a problem with this method whenever the game patches? I have a bunch of triggers set this way, but every time the game patches, all the 'groupings' between the triggers and the building ID's get reset and I have to manually go in and fix them. Share this post Link to post Share on other sites
Von Quest 1163 Posted August 18, 2013 (edited) @Beerkan Oh, this is fantastic! Love it when you find the easy way in the GUI Editor. I was using Gamelogic, moon phases, abacus, astrology, ...but this is WAY better. Thanks, off to go giver her a try now. UPDATE: Yep it works! Odd though that you have to put the circle around the ID# even IF you are Grouped. Hmm... Room for human placement error? Edited August 18, 2013 by Goblin Share this post Link to post Share on other sites
clydefrog 3 Posted August 18, 2013 (edited) Has anyone had a problem with this method whenever the game patches? I have a bunch of triggers set this way, but every time the game patches, all the 'groupings' between the triggers and the building ID's get reset and I have to manually go in and fix them. That will probably be because they change the building ID numbers in patches. UPDATE: Yep it works! Odd though that you have to put the circle around the ID# even IF you are Grouped. Hmm... Room for human placement error? Well it's a not present trigger, if the building it was grouped to wasn't in the trigger area, how could it check for it being not present when it was destroyed? The trigger is checking for the presence of that building in the trigger area. Edited August 18, 2013 by clydefrog Share this post Link to post Share on other sites
meatball 25 Posted August 19, 2013 That will probably be because they change the building ID numbers in patches. Which means this method, or even the game logic method, will break with every patch... There must be another way to handle this or a lot of missions would be breaking. I actually submitted a bug report on this specific issue about a week ago. Share this post Link to post Share on other sites
kylania 568 Posted August 19, 2013 At least there won't be anymore patches till release. :) Share this post Link to post Share on other sites
meatball 25 Posted August 21, 2013 True, but if this happens every time there's a patch, it'll be somewhat annoying. :) Does anyone know for a fact that they have been changing ID numbers? Pretty sure I can go another route and set up game logic to fire the triggers based off the building ID's, but if those are going to change every single time, that'll break as well. Share this post Link to post Share on other sites
Larrow 2822 Posted August 21, 2013 If your putting game logics down could you not use nearestObject of type "House_F" to get your reference to the building, instead of the building ID's? Share this post Link to post Share on other sites
meatball 25 Posted August 23, 2013 Alright, I verified that it is the Building/Object ID's changing between patches that is causing the problem. I went from the current beta (.76) up to the dev version and found the trigger I had grouped with the Radar array at Air Station Mike had changed from ID # 68508 to ID # 123297. The trigger was still correctly attached to ID # 68508, but that ID # now belonged to a wall at the Airport, so the trigger was grouped to that, which breaks all my triggers. :) Not sure if there's any way around this if they continue to change Object/Building ID #'s between patches since the only other method I know involves Game Logic looking at a specific ID #, which would break as well if the ID changed... ---------- Post added at 02:22 ---------- Previous post was at 02:21 ---------- If your putting game logics down could you not use nearestObject of type "House_F" to get your reference to the building, instead of the building ID's? I'll look into that. That _should_ fix the issue since one would hope that the type name of the building should not change. Share this post Link to post Share on other sites
meatball 25 Posted August 23, 2013 Alright, I'm at a bit of a loss on this now. How does one get a static object's type name to use with 'nearestObject'? I'm thinking I can place game logic down on the object to be destroyed and group that to a trigger to what I need to do, but just not sure how I can use nearestObject in the gamelogic trigger without using ID. ---------- Post added at 14:24 ---------- Previous post was at 14:05 ---------- Alright, _think_ I figured it out. Found a list of object type names and I'll just need to experiment to figure out what is the correct one for object. Then I can place a GameLogic object right on the object I want to watch with a nearestObject check in the init. For example, I created some Game Logic on the small radar at the end of the runway at the airport with the following init: tempObj = nearestObject [srGL,"Land_Radar_Small_F"] Then I just dropped a trigger nearby with a !alive check on that tempObj and it seems to work. I'm not sure yet if I'll run into any issues with this setup for multiplayer games with or without a dedicated server. And this of course assumes they don't change the object names... Share this post Link to post Share on other sites
Larrow 2822 Posted August 23, 2013 (edited) Just use "House_F" as i previously said this should cover most structures, your only getting the nearest one. For shits and giggles put this in the init of your player and take a walk around town in the editor. Hint shows you the exact classname of the nearest building of type "House_F". Use action "add satchels" to give the player 3 satchel charges. Use action "add trigger" to place a trigger on the building shown in the hint. Place a charge and blow the building up, the trigger will fire and add a sidechat just to show it did. removeAllWeapons this; player addAction ["add satchel",{ {player addmagazine "SatchelCharge_Remote_Mag"}foreach [1,2,3] }]; player addAction ["add trigger",{ _nObject = nearestObject [getposATL player,"House_F"]; _trg=createTrigger["EmptyDetector",getPos _nObject]; _trg setTriggerArea[0,0,0,false]; _trg setTriggerActivation["NONE","PRESENT",true]; _trg setTriggerStatements["Damage (nearestObject [getposATL thisTrigger,'House_F']) >= 1", "player sidechat 'house demolished'", ""]; }]; handle = [] spawn { while {true} do { _nObject = nearestObject [getposATL player,"House_F"]; hint (typeof _nObject); sleep 0.5; }; }; ---------- Post added at 18:03 ---------- Previous post was at 16:18 ---------- Sorry Meatball, Ill just add to my post here I will admit i did just browse over your post the other day and just presumed as you were mentioning gamelogics that you were doing a little more than just detecting if a building had been destroyed. NearestObject [position, type] will get the nearest building that is defined under the class type. A class does not have to be the exact type but can be a parent class e.g VEHICLE LAND MAN CIVILIAN SOLDIER CAR VW AUDI TANK SHERMAN TIGER Think of types as a tree structure, here if we were to get the type "MAN" civilian and soldier both satisfy this type as MAN is their parent type. If we just done type SOLDIER all we would get is soldiers. If we did type LAND then man, civilian, soldier, car, vw, audi, tank, sherman, tiger all come under LAND. House_F is a parent type that has loads of child types it covers houses, transformer buildings, towers, lamp posts, tin sheds etc etc If you were to place a trigger on top of a building with damage (nearestObject [getposATL thisTrigger,"House_F"]) >= 1 in its CONDITION box, then the nearest object is going to be the building you placed it on. As were using HOUSE_F this is 99% of the time going to be this building. The above code then checks this buildings damage and when its >=1 activates the trigger. Hope that makes sense Edited August 23, 2013 by Larrow Share this post Link to post Share on other sites
meatball 25 Posted August 24, 2013 Ah, makes perfect sense, thanks! I was able to figure out the exact ones I needed for the buildings I was looking for, but good to know that I can roll up to House_F as a parent choice. :) Share this post Link to post Share on other sites
=WKV= Blackwatch 10 Posted October 3, 2013 I have tried this method as I am trying to destroy a power plant generator yet I cant get the trigger to group to the ID of the generator. Is there a certain way of doing it? Share this post Link to post Share on other sites
specie 11 Posted November 21, 2013 Hi, I need this functionality too, but it seems it's currently broken. http://feedback.arma3.com/view.php?id=15750 I'm gonna give Larrow's method a go. Share this post Link to post Share on other sites