Jump to content
Sign in to follow this  
Coldfire

Running a random loadout generation on spawn.

Recommended Posts

Ok, I've been at this for about 4 hours and I'm now too frustrated to do any more searching, so I'm asking for help

I recently got zorilya's random loadout generator:

http://www.armaholic.com/page.php?id=23073

Love it, great for some missions I've been working on. I've got one problem though, I can't seem to make the damn script run every time a playable unit respawns.

I've tried about sixty different things now, the most promising I've seen while searching is just using an addeventhandler

This is what I've got in the Init line:

null = [this,3] execVM "fnc_generate_loadout.sqf"; this addeventhandler ["Respawn","_[this,3] execVM 'fnc_generate_loadout.sqf'"];

So far it generates a random loadout when you first start the mission, but then fails to run the script and give you a new loadout when you respawn.

In case context is important, I'm trying to set up a mission where the player is a resistance fighter with random scavenged gear assaulting a town to try and steal some supplies.

Share this post


Link to post
Share on other sites

I believe the page that you are looking for, is Arma 3 Respawn. From what I've read, you need to create a file in your mission directory called onPlayerRespawn.sqf - Inside of it, you would add the code necessary to run your random loadout generator, such as the code listed above. This should do the trick, though I haven't tried this before personally. :)

Share this post


Link to post
Share on other sites
null = [this,3] execVM "fnc_generate_loadout.sqf"; this addeventhandler ["Respawn","_[this,3] execVM 'fnc_generate_loadout.sqf'"];

null = [this,3] execVM "fnc_generate_loadout.sqf"; this addeventhandler  ["Respawn","[_this,3] execVM 'fnc_generate_loadout.sqf'"];

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  

×