smoke52 0 Posted May 2, 2007 Ok i almost have my mission finished but theres a couple things i just cant figure out. simple overview: get in vehicles, repel attack on town, RTB and get in heli or jet and take out convoy. then a target of opportunity (call it "objective3") appears, which is where my problem begins. then you return to base again to some officers where my other problem is. 1. how can i make it so the marker is hidden until objective 2 is complete and objective 3 becomes "active"? from what i gather i will have to make a script with the create marker command? which brings me to my next question. 2. how can i find map coordinates so i can put objects with the commands that need those [x,y,z] coordinates? if i know that i might have been able to find this out myself 3. my next question is how can i make it so the person only has to complete objectives 1 and 2 since the 3rd is only a target of opportunity and he doesn't have to do it? do i have to remove the third objective from my briefing.html and handle it through the mission somehow with hints or something? 4. lastly my main problem, which is probably the easiest question, is how do i get the trigger to only activate when the objectives are complete? i would like it so only obj1 and 2 need to be complete. i tried obj1=true;obj2=true in the condition but it doesn't seem to be the code. i have the first objective covered with a trigger that loads a script to count the enemy. when it counts 0 it gives the player the next objective, gives them points, and changes the objective to done. i have that for all three objectives right now. is there an easier way i could handle this maybe? thanks for any help! Share this post Link to post Share on other sites
Flat!!! 0 Posted May 2, 2007 On #4 question: to end your mission try typing in condition: Obj1 && Obj2 or Obj1 AND Obj2 And also add in type: END #1 On #3 Q: simply add the above... If you had written for ex: obj1 and obj2 and obj3 it would not end until you had done all three obj. On #2 Q: Well you can place an object on the map and call it Pizza and then save, alt+tab out of game, go to X:\mydocuments\arma\missions\(missions you saved name) and then open the mission.sqm with notepad and press alt+f. Now you have a box where you will type pizza and find next. You should see the following: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> position[]={7727.077637,11.970000,6312.558594}; azimut=65.649902; special="NONE"; id=58; side="EAST"; vehicle="SoldierESaboteurBizon"; player="PLAYER COMMANDER"; leader=1; rank="SERGEANT"; skill=1.000000; text="Pizza"; where it says position it is the cords: position[]={7727.077637,11.970000,6312.558594}; Share this post Link to post Share on other sites
Flat!!! 0 Posted May 3, 2007 Quote[/b] ]1. how can i make it so the marker is hidden until objective 2 is complete and objective 3 becomes "active"? One way to do this is make a marker and call it marker1 (put this way off in the corner at full zoom out). Now make a invisible helipad where you want the marker to appear called marker2. Now make a trigger and in condition type obj1 and obj2 and then in activation type <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"marker1" setmarkerpos getpos marker2 have not tested this altho it should work. You could always give it a shot:) Share this post Link to post Share on other sites
smoke52 0 Posted May 3, 2007 yeah that works nicely, thank you! im still having trouble with the end mission. the obj1 and obj2 (or obj1 && obj2) dont seem to work no matter what i do. once i take that code out it works no problem Share this post Link to post Share on other sites
Flat!!! 0 Posted May 3, 2007 Tell me... In your mission do you have to kill anybody and by that i mean like you wrote for ex: Not alive officer in a condition and in act obj complete. If yes try something like this obj1 AND not alive officer and obj3 and obj4... you can also try using && instead of and. Share this post Link to post Share on other sites
CarlGustaffa 4 Posted May 3, 2007 Just out of curiosity, is there a reason as to why nobody seems to be using markers of type "empty"? Those doesn't show up in the game until the type is changed. Share this post Link to post Share on other sites
Flat!!! 0 Posted May 3, 2007 because I don't know how to change type Share this post Link to post Share on other sites
smoke52 0 Posted May 3, 2007 thanks for the suggestion ill check that command out. Quote[/b] ]Just out of curiosity, is there a reason as to why nobody seems to be using markers of type "empty"? Those doesn't show up in the game until the type is changed. right now i figured out a way to have the trigger and end it when objective 2 is done, but the only problem is if the person just happens to walk into the trigger area, like exploring the base before he goes out and completes objective 2 the game will end right away. if he doesn't explore first then my mission works fine anyway these are my three scripts, maybe you could tell me what i could change? :b objective1: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">abs(EAST countside list enemyleft)<=5; goto "chkenemy" #chkenemy ~2 ?(abs(EAST countside list enemyleft)<1):goto "alldead"; ?(abs(EAST countside list enemyleft)<6):goto "fewenemyleft"; #fewenemyleft ~33 hint "The UAV is reporting enemy troops still in the vicinity."; echo "The UAV is reporting enemy troops still in the vicinity."; goto "chkenemy" #alldead ~2 hint "Paraiso is clear, Good Work! Return to base."; echo "Paraiso is clear, Good Work! Return to base."; player addscore 200; "1" objstatus "DONE"; goto "end" #end exit objective2: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">abs(EAST countside list convoy1)<=1 goto "chkenemy" #chkenemy ~2 ?(abs(EAST countside list enemyleft)<1):goto "done"; ?(abs(EAST countside list enemyleft)<3):goto "chkenemy"; #done "2" objstatus "DONE"; player addscore 300; "3" objstatus "ACTIVE"; hint "Secondary objective destroyed! Return to base and report to the officers or proceed to the next objective."; "marker1" setmarkerpos getpos marker2; "marker1" setMarkerText "Target of Opportunity" "extract1" setmarkerpos getpos extract2; "extract1" setMarkerText "Return to officers"; goto "trigger" #trigger exit1 setTriggerActivation ["LEADER", "PRESENT", true] exit1 setTriggerType "end1" exit1 setTriggerTimeout [2, 4, 3, false] goto "end" #end exit objective3: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">abs(EAST countside list too)<=0 goto "chkenemy" #chkenemy ~2 ?(abs(EAST countside list enemyleft)<1):goto "end"; ?(abs(EAST countside list enemyleft)<2):goto "chkenemy"; #end "3" objstatus "DONE"; player addscore 500; hint "Nice work! Report back to base." exit Share this post Link to post Share on other sites
Flat!!! 0 Posted May 3, 2007 "marker1" setMarkerType "Empty" now i know how to change emty bla bla bla marker... Share this post Link to post Share on other sites
UgolSkosa 0 Posted May 3, 2007 Quote[/b] ]1. how can i make it so the marker is hidden until objective 2 is complete and objective 3 becomes "active"? another way:you can make size marker - 0 (in editor), and when you need it set size - 1. command: "name_marker" setMarkerSize [1,1] Quote[/b] ]how can i find map coordinates so i can put objects with the commands that need those [x,y,z] coordinates? if i know that i might have been able to find this out myself Also, you can wrote in init of object (hint format ["%1",getpos this]), then start mission and you can see coordinates... In any case you need command - getpos. [getpos object_name select 0,getpos object_name select 1,getpos object_name select 2] getpos object_name select 0 - x coordinate of object_name getpos object_name select 1 - y coordinate of object_name getpos object_name select 2 - z coordinate of object_name I have not absolutely understood, do you make single mission? Why you do not use triggers? Share this post Link to post Share on other sites
killerwhale 1 Posted May 3, 2007 Quote[/b] ]b1 dofire j1 goto "h1" #h1 b1 setdamage 2 Hello friends,  I am trying to learn scripting but  I face many problems. In this little script above, I am trying to get  b1  to shoot  j1 and then after that b1 himself dies. the problem is, b1 receives the setdamage command before he shoots j1. How can I put this in Orderly manner. Share this post Link to post Share on other sites
Flat!!! 0 Posted May 4, 2007 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">b1 dofire j1 ~3 b1 setdamage 2 ~3 Means after how many seconds the damage is received. Share this post Link to post Share on other sites
UgolSkosa 0 Posted May 4, 2007 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">b1 dofire j1 @(!alive j1) b1 setdamage 1 b1 dies after kill j1 or <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_dammage=getdammage j1 b1 dofire j1 @(getdammage j1 > _dammage) b1 setdamage 1 b1 dies after wound j1 or you can attach eventhandler to b1 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">b1 AddEventHandler ["fired",{_this exec "onfire.sqs"}] when b1 shoot, it's run "onfire.sqs" script... Share this post Link to post Share on other sites
smoke52 0 Posted May 4, 2007 thanks these works nicely and the setmarker size gave me an idea Quote[/b] ]another way:you can make size marker - 0 (in editor), and when you need it set size - 1. command: "name_marker" setMarkerSize [1,1] Quote[/b] ]how can i find map coordinates so i can put objects with the commands that need those [x,y,z] coordinates? if i know that i might have been able to find this out myself Also, you can wrote in init of object (hint format ["%1",getpos this]), then start mission and you can see coordinates... In any case you need command - getpos. [getpos object_name select 0,getpos object_name select 1,getpos object_name select 2] getpos object_name select 0 - x coordinate of object_name getpos object_name select 1 - y coordinate of object_name getpos object_name select 2 - z coordinate of object_name cause im a newb still Quote[/b] ]I have not absolutely understood, do you make single mission? Why you do not use triggers? Share this post Link to post Share on other sites
UgolSkosa 0 Posted May 4, 2007 to escape "a syndrome of last enemy", you you can to make the following: create trigger. activation by east (if your enemy - east) its doesn't matter, condition "present" or "not present" then in line of condition wrote <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">count thislist < 3 And when count east units in trigger zone will be less then 3 - trigger will work. And write in "on activation" line what you want. Share this post Link to post Share on other sites
smoke52 0 Posted May 4, 2007 yeah i forgot to mention the code i had in each of the trigger's init lines that execs those scripts. they are all like this (below), but the last number (6 in the example below) is changed so those triggers only start exec'ing the scripts when a few are left. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> abs(EAST countside list triggername)<6 someone already helped me with that part Share this post Link to post Share on other sites
killerwhale 1 Posted May 5, 2007 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">b1 dofire j1@(!alive j1) b1 setdamage 1 this is exactly what I want, can you please explain the "@(!alive" stuff, I dont know how this thing works Thanks alot Share this post Link to post Share on other sites
smoke52 0 Posted May 5, 2007 im still new to scripting but ill give it a shot. the @ i think is just like a ? it tells the game you are asking a question. then you put your question next which is asking if they are alive. the ! is equal to NOT, so you are asking if he is NOT ALIVE. i think you can use not instead of !, so ?(not alive j1) check out these pages, http://community.bistudio.com/wiki/Category:ArmA:_Scripting_Commands http://community.bistudio.com/wiki....ds_List Share this post Link to post Share on other sites
fasad 1 Posted May 5, 2007 im still new to scripting but ill give it a shot.the @ i think is just like a ? it tells the game you are asking a question. then you put your question next which is asking if they are alive. the ! is equal to NOT, so you are asking if he is NOT ALIVE. i think you can use not instead of !, so ?(not alive j1) Close, but not quite right @ is the same command as waitUntil. ? is the same command as if. : is the (generally) the same command as then (but only : can be used with the case command). and ! is the same command as not. I recommend using the word versions rather than the symbols, they are much easier to read. Stick them all together and you get: waitUntil {not alive j1} Which is pretty self-explanatory. Note the curly braces! Share this post Link to post Share on other sites
UgolSkosa 0 Posted May 5, 2007 Quote[/b] ]I recommend using the word versions rather than the symbols, they are much easier to read. only for English-speaking users ... and symbols are more compact... Share this post Link to post Share on other sites
killerwhale 1 Posted May 7, 2007 I thank you for your replies but where can I find the "word version" commands? Share this post Link to post Share on other sites
Flat!!! 0 Posted May 7, 2007 @ = waituntil ? = If : =then (only : can be used with the case command). ! =not the symbols version: @?:! and word version: Waituntil, if, then, not Share this post Link to post Share on other sites
killerwhale 1 Posted May 8, 2007 what about [] {} <> & #() _ = ; aren't these part of the scripting commands Share this post Link to post Share on other sites
fasad 1 Posted May 8, 2007 Look on the BI WIKI [] are used to define an array {} are used to define a block of code < is less than > is more than && = and || = or # defines a label, not used in sqf () are used to seperate terms, as they do in mathematics _ is used to define a variables as local when used as the first character of the variables name = is used to define variables == is used to check the equivalencey of two things ; is used to seperate statements , is used to seperate elements within an array Share this post Link to post Share on other sites