Woodpeckersam 18 Posted March 4, 2007 I was ace scripter in OFP.. but i aint played for so long so i dropped in skill now i cant script as brilliant as in ArmA now .. im stuck on this piece of code. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _g = _this select 0 _s = _this select 1 #loop ? ((damage _s)>= 0.001) : goto "fix" goto "loop" #fix unassignvehicle _g _g action ["getout", _s] _s lock true ~5 #move _g domove (position crate) ?((_g distance crate)<=2) : goto "wait" goto "move" #wait ~20 _s lock false _g domove getpos _s _g assignasgunner _s !_g distance _s <= 2: _g moveingunner _s _g setdamage 0 goto "loop" _g is the unit entering the searchlight _s is the searchlight itself. Basically i want it so that if the bulb blows out when someone shoots it, i want the unit manning the search light to go and get a bulb from a crate. But all it manages to do is when i shoot the light, it goes off, the unit gets out wander around for about 2 seconds then gets back in the searchlight.. unfixed. Hope somone can help, thanks. edit: I get no code errors. And can someone answer this question too.. i cant seem to get deletevehicle work too.. i want to delete the watch towers around the base.. and in OFP its easy cos you would do this deletevehicle (object 175970) note: that id number is the real one from a watch tower.. how would i go about doing this? thanks. Share this post Link to post Share on other sites
Balschoiw 0 Posted March 4, 2007 The "~" command has been replaced with sleep command in Arma. You may have a go replacing the ~ commands with sleep terms. Instead of "~ 0.5" use "sleep 0.5" for example. Share this post Link to post Share on other sites
Woodpeckersam 18 Posted March 4, 2007 lol i did know that, but im using .sqs... does sleep work with sqs or only with sqf?? Cos there no probs here using ~ well, i'll give it a try thanks. edit: Yeh it dont work with SQS lol, i'll have to try and learn SQF one day lool.. i cant be a*sed to do it at the moment lol. Share this post Link to post Share on other sites
Woodpeckersam 18 Posted March 4, 2007 Dont worry bout my post now lol, i managed to figure it out.. but can someone help me figure out how to delete objects already on the map? thanks! Share this post Link to post Share on other sites
Linker Split 0 Posted March 4, 2007 CamDestroy? Never tried anyway... Linker Split #EDIT You can't destroy objects pre-placed on the map... no commands for both OFP and ArmA... Share this post Link to post Share on other sites
Woodpeckersam 18 Posted March 4, 2007 lol, gonna test it hehe thanks.. u kno thats usually made for camera's.. but i remba ofp they made missiles wit it.. (well with camcreate) Share this post Link to post Share on other sites
Linker Split 0 Posted March 4, 2007 yes, test it, but i think that it will not help you, i told that in OFP and ARMA and VBS1 you can't delete an object that has been placed in the map editor (Visitor, WRPTool)... Linker Share this post Link to post Share on other sites
Woodpeckersam 18 Posted March 4, 2007 oh, just read ur editted page lol, yeh i rememba now lol, oh well.. i'll just have to destroy these objects then. (the reason why because the AI cant seem to pass in between the fences when theres a watch tower in the middle, even though there is a big gap there :/) Sorry lol but.. u know how to destroy stuff that built in on the map? thanks Share this post Link to post Share on other sites
Linker Split 0 Posted March 4, 2007 yes: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(object numberID) setDammage 1 Share this post Link to post Share on other sites
Woodpeckersam 18 Posted March 4, 2007 hmm doesnt seem to be working, it says its missing a ).... weird lol Share this post Link to post Share on other sites
Linker Split 0 Posted March 4, 2007 if for example the ID of the ibject is 40000 then: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(object 40000) setDammage 1 try it, it's strange it doesn't work... Share this post Link to post Share on other sites
Guest Posted March 4, 2007 If theres a number of objects ud like to destroy, just use a marker (or whatever) to place nearby the area to destroy (dont reccomend going out past like 500 m, as it can lag) I just execute a destroy script from Init.sqs to *open* towns up a little for pathing. Destroy.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #Town4Destroy _CenterMark = [] _CenterMark = (getmarkerpos "TOWN4MIDDLE") {(_CenterMark nearestobject _x) setDammage 1} ForEach [581174,581173,581172,174839,174838] Share this post Link to post Share on other sites
Linker Split 0 Posted March 4, 2007 Of course, Special Ed has made a geneal script for detroy more objects Share this post Link to post Share on other sites
Woodpeckersam 18 Posted March 4, 2007 Hmm thnxs special ed lol, but i only wanna destroy 1 object each time, cos they get in the way of the patrol.. and the (object ID) thingy still doesnt work :/ very strange.... maybe its the place on the map itself.. anywasy thxs for ur help peepz Share this post Link to post Share on other sites
Guest Posted March 4, 2007 Edited - easiest way I can find to do this Put in a gamelogic near the object or objects to destroy Put this in the gamelogics Init feild: {(getPos this nearestobject _x) setDammage 1} ForEach [256218,581174,581173,581172,174839,174838] Delete my object Id's and put whatever ones u want in (or only one, whatever) Share this post Link to post Share on other sites
charonos 0 Posted March 4, 2007 ObjectID is supposed not to work anymore: object The search function will find numerous threads that discuss this. @ the ace OFP scripter: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #move _g domove (position crate) ?((_g distance crate)<=2) : goto "wait" goto "move" You are spamming domoves at the unit without ~ delay. That usually results in the unit not moving at all. Also one domove command is enough <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _g domove getpos _s _g assignasgunner _s !_g distance _s <= 2: _g moveingunner _s These lines have a inherent redundancy. It is sufficient to just issue: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _g assignasgunner _s [_g] ordergetin true Ordergetin Also note, that lock does not work on AI units: From the wiki: Quote[/b] ]Lock vehicle (disable mounting / dismounting) for player. Share this post Link to post Share on other sites
Guest Posted March 4, 2007 Sorry to post on this again, this will be easiest way for you to destroy objects on map without putting in a script, just never tried it before in the init of an object- Just put in a GameLogic near where u want an object or objects destroyed - put this in the Init feild: {(getPos this nearestobject _x) setDammage 1} ForEach [256218,581174,581173,581172,174839,174838] Of course, put whatever object id numbers u want and, and delete mine. Share this post Link to post Share on other sites
Woodpeckersam 18 Posted March 4, 2007 @Charonos Yeh lol i noticed that, i managed to fix it lol, i sed in a post of page 1 but thanks but u taught me something lol... damn lockvehicles! lol i did have that problem until now, thanks man! @Special Ed WIcked man! I'll be sure to give that a try! lool, i knew there must have been a command to do it lol. I'll try it both ways, script and non-script, they both have their advantages and disadvantages! so i'll choose the easiest methods.. thanks guys! You been a great help Share this post Link to post Share on other sites