OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Kekc on 17 Jun 2009, 15:13:01

Title: Weapons problem
Post by: Kekc on 17 Jun 2009, 15:13:01
Hello again..
Tried to find answer on my question but  :dunno:..
So my problem:

I made new sqs file for my mission. I did it because i want, that my soldier (hero) must respawn with M24 (on place SVD), Makarov and RPG.

In Editor it works but when I export it to my missions and begin it, than I respawn with SVD.

Just a paradisio, please help me.  :blink:
Title: Re: Weapons problem
Post by: Spooner on 17 Jun 2009, 17:27:07
Units always respawn with their "standard" kit, regardless of what they had before they died.

Several options:
* Use SPON Kits (http://www.ofpec.com/forum/index.php?topic=30711.0) (which does a lot of things, other than just what you want). Maybe overkill for what you want.
* Use a respawn-with-same-gear-you-died-with script (several about...search yourself).
* Add a killed handler to the unit in order to manually reapply the equipment change (where reequipplayer.sqs is the script that you already have that sets up your equipment correctly):
Code: (player object init) [Select]
this addEventHandler ["KILLED", { 0 spawn { waitUntil { alive player }; exec "reequipplayer.sqs" } } ];

First and third options will respawn you with your "initial" kit. Second will respawn you with what you died with. Really up to you which type you prefer.

Title: Re: Weapons problem
Post by: Kekc on 19 Jun 2009, 09:37:45
Tried this played object init... Doesn't works  :no:

So, I will learn to use Spon Kits ;-)

Thank you, for your help.

Greets, Kekc  :)
Title: Re: Weapons problem
Post by: Spooner on 27 Jun 2009, 22:47:23
I think Toadlife/Norrin have the solution (http://www.ofpec.com/forum/index.php?topic=28740.0). Should work in A2 without problems.