Meatball0311 79 Posted October 10, 2007 Situation- I have a fireteam of OPFOR resting in the prone position (simulating that they are sleeping). I have removeAllWeapons, then addMagazine all of their ammo (basically they are equipped but they have no primary weapon. I have a trigger that is set up to go off when BLUFOR is detected by OPFOR. In the onActivation I have it the unit exec "it1.sqs" What I want to do- I want the fireteam on trigger activation to be armed with primary weapons then go to marker and conduct Seek and Destroy. this is the "it1.sqs" Quote[/b] ]_it1 = [it11, itl1, it13, it14] _defend = getMarkerPos "it1pos1" {_x setUnitpos "AUTO"} forEach _it1 {_x enableAI "MOVE"} forEach _it1 {_x enableAI "TARGET"} forEach _it1 it11 addWeapon "AK74" itl1 addWeapon "AK74" it13 addWeapon "PK" it14 addWeapon "AK74" it1 move _defend [it1, 1] setWaypointType "SAD" [it1, 1] setWaypointBehaviour "COMBAT" [it1, 1] setWaypointCombatMode "RED" [it1, 1] setWaypointFormation "LINE" ~1 exit Share this post Link to post Share on other sites
Op4 BuhBye 0 Posted October 10, 2007 What is your question? I assume something doesn't work? Share this post Link to post Share on other sites
Meatball0311 79 Posted October 10, 2007 I want the fireteam that has no weapons, to be armed with weapons once the trigger is activated. Is there a way that I can have them pick up weapons or spawn weapons on them? Share this post Link to post Share on other sites
LtCmdrBoon 0 Posted October 10, 2007 is this a trick question? You seem to add the weapons to the guys in your script there, and you said u removeallweapons before hand. And you say this script is run when your trigger is met. Share this post Link to post Share on other sites
Junker 0 Posted October 10, 2007 everything about that script seems wrong... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">it11 addWeapon "AK74" itl1 addWeapon "AK74" it13 addWeapon "PK" it14 addWeapon "AK74" Your giving them weapons but no ammo <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">it1 move _defend try using domove <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[it1, 1] setWaypointType "SAD" [it1, 1] setWaypointType "SAD" do u mean setmimic...? Share this post Link to post Share on other sites
Op4 BuhBye 0 Posted October 11, 2007 Im with LtCmdrBoon. You add the weapons in the script and the ammo is already there....??? Share this post Link to post Share on other sites
Meatball0311 79 Posted October 11, 2007 Yes, I removed all weapons, then I gave them ammo but no weapon. I am new to scripting, so some of this is just learning how to do different commands. What I am trying to simulate is this: 1. I am doing a night raid on an enemy base. 2. There is an enemy react team that is sleeping (that is why I have them laying down with no weapons) 3. When I start my attack I want them to wake up (stand) and arm themselves with their weapons and proceed to a waypoint and conduct "SAD" (Search and Destroy). That is why I need to find a way to give them weapons when the trigger is activated. (Detected by OPFOR). Quote[/b] ]OPFOR INIT field: this setUnitpos "DOWN"; this disableAI "MOVE"; this disableAI "TARGET"; to make them lay down. Share this post Link to post Share on other sites
Junker 0 Posted October 11, 2007 this is how i would do it. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0 _defend = getMarkerPos "it1pos1" _unit setUnitpos "AUTO" _unit enableAI "MOVE" _unit enableAI "TARGET" ? _unit = it13 : it13 addweapon "PK"; goto "next" _unit addWeapon "AK74" #next _unit domove _defend ~1 exit Share this post Link to post Share on other sites
Op4 BuhBye 0 Posted October 11, 2007 I get what you are doing. What is confusing is 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">it11 addWeapon "AK74" itl1 addWeapon "AK74" it13 addWeapon "PK" it14 addWeapon "AK74" You add weapons in these commands not ammo. If I was you I would use each units init field and give them all their ammo and leave the script the way it is. Is this what you are looking for cause Im still kinda lost. Edit: I dont think this is what you need after re-reading the whole thing. So.... You have the mission.... Have you run it?? If so, What doesn't work?? I hear you asking about adding weapons but you add them in the script, So I guess none of us know whats wrong. Share this post Link to post Share on other sites
Meatball0311 79 Posted October 14, 2007 You got part of it right. In the init field of the troops I removeAllWeapons, then I give them ammo. (so they have all of their ammo, just not a weapon.) they are laying down (simulating sleeping) you dont sleep with your weapon in your hand (unless you have severe PTSD) I have a trigger set up to go off when OPFOR detects BLUFOR. at that time I would like to know is there anyway those sleeping poor bastards can pick up, shit out some weapons in their hands? (please excuse the language, I am just trying to be funny) Share this post Link to post Share on other sites
Op4 BuhBye 0 Posted October 14, 2007 Once again, you add weapons in your script... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">it11 addWeapon "AK74" itl1 addWeapon "AK74" it13 addWeapon "PK" it14 addWeapon "AK74" So what is the issue? Share this post Link to post Share on other sites