smoke52 0 Posted April 29, 2007 Hello, this is my very first mission for Arma, i have tried making missions for OpFlash a long time ago but havent tried since and im in need of a little help. heres a little overview, start off at base, take a vehicle and repel an attack, when complete return to base and get in a heli or jet and take out a convoy. then theres a third objective i want to be hidden until they complete both objectives. heres what i need help on. i want it so when the player enters the town he sets off a trigger which checks if theres any enemy left in the town, because theres 30 guys its sometimes hard to tell if they are all dead. if there are guys alive it will hint to the player theres more alive. if possible i would like the script to count the enemies and if theres 5 left then start hinting to the player. now i tried making this script by reading some tutorials, but obviously its wrong because it doesnt stop hinting. im thinking the game is checking the whole map for enemies?: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (alive _enemy) then {goto "wait"} else {goto "dead"} ;check if squads are alive #wait ;wait 30seconds before display text ~30 #alive ;display text hint "The UAV is picking up more enemy troops in the vicinity" echo "The UAV is picking up more enemy troops in the vicinity" variable = text "The UAV is reporting more troops in the town" ~3 goto "wait" #dead ;display text hint "The town is clear!" echo "The town is clear!" variable = text "Town Cleared!" exit now i tried messing around and changing the code, like attempting making an array and naming all 30 soliders with individual names, but nothing worked and i dont have a clue how arrays work. can someone help me out with this? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _array = [town1, town2, town3,....town30] if (alive _array) then {goto "wait"} else {goto "dead"} another question is with the hidden objective, how do i make it so it comes up when objective 1 and 2 are finished? i have the objective hidden in the init.sqs, is that all i need to do? thank you! Share this post Link to post Share on other sites
Trixta 0 Posted April 29, 2007 Have you tried using a count trigger? Create a trigger over the area and put the following in the condition: To check if there are five enemy left (assuming OpFor are the enemy): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">abs(EAST countside thislist)==5 To check if there are any enemy 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 thislist)>0 Then run your script from the On Act. line. To do this from a script name your trigger (eg enemyleft) and put this in your script: <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 This will only activate if there are 5 left so if, for example you have six left and kill 2 simultaneously then it won't activate. You may wish to have a script that repeats when there are 5 or fewer left in which case use something like <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#chkenemy ?(abs(EAST countside list enemyleft)<1):goto "alldead"; ?(abs(EAST countside list enemyleft)<6):goto "fewenemyleft"; #fewenemyleft hint "There's only a handful of enemy left"; goto "endscript" #alldead hint "That's all of them." #endscript exit then run the script from the count trigger using <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)<6 in the condition line - it should activate first when you have less than 6 enemy left and then repeat every time you kill another enemy until they're all dead. Unhiding the objective You're right to hide the objective in init.sqs but to make it unhide create the condition / trigger / script and use <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"3" objstatus "ACTIVE" to make it appear, assuming OBJ_3 is the objective you want to make appear. Share this post Link to post Share on other sites
smoke52 0 Posted April 29, 2007 EDIT: well this script did the trick. thanks alot! leave this in case anyone else needs it --------------------------------------- thanks for your help trixta, so you mean my script file should look like this: <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 ?(abs(EAST countside list enemyleft)<1):goto "alldead"; ?(abs(EAST countside list enemyleft)<6):goto "fewenemyleft"; #fewenemyleft ~3 hint "The UAV is reporting enemy troops in the vicinity."; variable = text "Recon reports a few enemy soliders still in the town."; goto "chkenemy" #alldead ~3 hint "Town is clear!"; variable = text "Paraiso is Clear, Good Work!" goto "endscript" #endscript exit then i make a trigger, name it enemyleft, put this in the condition line: <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)<6 and this in the on act line: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[] exec "alive.sqs" ?? Share this post Link to post Share on other sites