Jump to content
Sign in to follow this  
norrin

toadlife's Weapon Respawn script updated for ArmA

Recommended Posts

I can't get it to work.

I've added a init.sqs file with the following (I already had a init.sqf file but using that gave errors):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_units = ["SquadLeaderW","TeamLeaderW","SoldierWSniper"]

{[_x,0] exec "weapons_respawn.sqs"} foreach _units

and added the weapons_respawn.sqs file.

When I starts the mission I don't get any errors, but the squad leader just doesn't respawn with his original load out.

BTW, can I also use an array like that in the init.sqs file to add nvgoggles to units?

Share this post


Link to post
Share on other sites
I can't get it to work.

I've added a init.sqs file with the following (I already had a init.sqf file but using that gave errors):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_units = ["SquadLeaderW","TeamLeaderW","SoldierWSniper"]

{[_x,0] exec "weapons_respawn.sqs"} forEach _units

and added the weapons_respawn.sqs file.

When I starts the mission I don't get any errors, but the squad leader just doesn't respawn with his original load out.

BTW, can I also use an array like that in the init.sqs file to add nvgoggles to units?

Got your PM m8. smile_o.gif. Sounds like you're very close to getting it running. As far as I can tell where you're going wrong is you need to give each individual unit a name in the editor and then put the individual names, not the class of the unit in your _units array.

So if you have three soldiers with the following classes: SquadLeaderW, TeamLeaderW, SoldierWSniper give them individual names such as Joe, Bill and Fred and then in your _units array put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _units = ["Joe", "Bill", "Fred"]

If you want to run this code through an init.sqf rather than an init.sqs file then you need to use slightly different syntax and add semicolons to the end of each line.

eg.<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_units = ["Joe","Bill","Fred"];

{[_x,0] exec "weapons_respawn.sqs"} forEach _units;

As for adding nvg to each unit you'll need an array with the unit names without the inverted commas and then the following code (I'm at work and this is untested by the way).

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _units_2 = [Joe, Bill, Fred];

{_x addWeapon "NVGoogles"} forEach _units_2;

So that the weapon respawn script recognises that you are carry goggles you'll need to place this code before the weapon_respawn code in your init file so that in init.sqf format it would look like this <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _units_2 = [Joe, Bill, Fred];

{_x addWeapon "NVGoogles"} forEach _units_2;

_units = ["Joe","Bill","Fred"];

{[_x,0] exec "weapons_respawn.sqs"} forEach _units;

Hope this helps,

norrin

Share this post


Link to post
Share on other sites

Thanks man, works like a charm. thumbs-up.gif

I had already added the nvg to each soldier individually, but might still try the NVG's by array later.

BTW, would it be possible to say for instance:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_units = ["w1"-"w32","e1"-"e32"]

{[_x,0] exec "weapons_respawn.sqs"} foreach _units

Or am I too lazy now and would it only slow down the game?

Anyway thanks again.

Share this post


Link to post
Share on other sites
I am actually patiently waiting for the SQF version of this and thought I'd have some small talk.

really? if you can manage fsm's i'm sure you can manage a bit of weap. respawn sqf, can't you?  wink_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×