Ringo 0 Posted August 1, 2009 Hi. I'm trying to set up a mission where one objective will be to blow up the cranes in the Chernagorsk docks. First I didn't have any trouble with reading and searching to find out how to tie an object to a variable name for reference in triggers and such. For this I use the "nearestObject ID" command. This works fine for 3 out of 4 cranes in the docks. The second one from the west though, I can't manage to blow up using the same code that blows the other three. My only conclusion is that I have the wrong ID for that particular crane. But looking in the editor it is the ID that is spot on. However there are 2 partially visible ID's close by, and I don't know if any of those could be the crane. I have a couple of triggers tied to each crane that will give feedback when you blow them up. When I force the object that would be the crane, I get a message that it is in fact "!alive" which indicates that something has gotten destroyed at that very position, however, nothing visible, and the Crane still stands. I have searched thorough on the forums and in the guides I've found but I haven't seen anyone white quite this problem. Any ideas on how to come around this, or find the actual ID of the crane would be very appreciated! Below I've linked two screenshots. One showing the Crane (it's the rightmost one that is the problem, oh, and the containers in the concrete are placed by me, so it's not them beeing blown up either) and one showing the editor with partially visible ID's. http://farm4.static.flickr.com/3438/3776997251_7fd3cdf489_o.jpg http://farm4.static.flickr.com/3599/3776944899_b5016d1918_o.jpg Share this post Link to post Share on other sites
Cellus 10 Posted August 1, 2009 The funny thing is, when I open the editor the number is entirely obscured. Just nothing in that place at all. From your screenshots however, I was able to guess 970381. This is the number you're after (tested, works). Share this post Link to post Share on other sites
Ringo 0 Posted August 1, 2009 This is so weird. I have tried that already, and also now again after your confirmation. I declare all for Crane objects with game logic like this: Crane1=position this nearestObject 970412 Crane2=position this nearestObject 970381 (this is the problematic one) Crane3=position this nearestObject 970449 Crane4=position this nearestObject 970141 Then I just tried adding a trigger which fires when I step into it. In the init field I put the following: Crane1 setDamage 1; Crane2 setDamage 1; Crane3 setDamage 1; Crane4 setDamage 1; 1,3 and 4 blow up, not Crane2. Also, the trigger that checks the integrity of Crane2 has the following condition "!(alive Crane2)" and is fired after all the Cranes get "setDamage 1". I am shown the message Crane2 destroyed as I've specified, but still it's standing. Do you have your sample mission available maybe I could have a look into it and see what I'm doing wrong here? I've compared these triggers and declarations back and forth now several times, and it's not getting me anywhere. Share this post Link to post Share on other sites
f2k sel 164 Posted August 1, 2009 (edited) I had a look had found that 970381 is reported as being part of the pier. 970351 is the crane if it's reporting correctly. nObject = getpos this nearestObject 970351;nobject setdamage 1 I put it in a game logic Edited August 1, 2009 by F2k Sel Share this post Link to post Share on other sites
Ringo 0 Posted August 1, 2009 Awesome! Tried it and that's it! :D Thanks for your help and quick responses. Much appreciated! Share this post Link to post Share on other sites
Ringo 0 Posted August 8, 2009 Alright. With the 1.03 patch released and changing the ID's of the cranes. Is there a more suitable way to assign a present object from the map to a variable rather than by it's ID? If one places a marker instead, and uses that for get nearestObject I guess it would work, right? But I got this feeling it would be quite the amount of trial and error when it comes to the placement of the marker, as the cranes are. Just tried actually, but I guess my placement of the markers are off, or it just doesn't work. Suggestions? Share this post Link to post Share on other sites
Bad Pilot 0 Posted August 8, 2009 lol! Perhaps you can get nearest objects of type "Land_A_Crane_02a"? Check this page. Share this post Link to post Share on other sites
f2k sel 164 Posted August 8, 2009 (edited) This is what I do if I need an ID and I don't know what the model is. Place the execVM code in logic Init and place it over the object you want to identify. Save the script as ID.sqf nul=[this,20] execVM "ID.sqf" It will display the ID number and object type and then destroy it so yo can Identify which is which, you can adjust the number for the radius your searching. You can aslo limit the search by changing the filter "building", "man" ect, you will have to look the rest up. // nul=[this,20] execVM "ID.sqf" _location = _this select 0; _radius = _this select 1; _what = nearestobjects [_location,[], _radius];// search for everything //_what = nearestobjects [_location,["Building"], _radius];// buildings only sleep 0.5; { Hint Format["%1 OBJ ",_x]; _x setdamage 1; // remove for no damage //deletecollection _x; removes until the map is reloaded. sleep 4; } forEach _what; Edited August 8, 2009 by F2k Sel Share this post Link to post Share on other sites
Ringo 0 Posted August 8, 2009 lol! Perhaps you can get nearest objects of type "Land_A_Crane_02a"? Check this page. Tried it. Works like a charm! I was kinda hoping for a reference like this, just hadn't found it. Thanks!!! Crane1=position this nearestObject "Land_A_Crane_02b" @F2K Sel: Thanks a lot. I'm sure I'll get some great use of that script of yours as well, had already been thinking in that direction to get the ID's, but since it seems like they do change with the patches, the name-aproach should be more reliable I guess. Share this post Link to post Share on other sites