Jump to content
Sign in to follow this  
Edoardo

In my MP mission , how to spawn with same weapons as before i died ?

Recommended Posts

Please , i need to know how to respawn with the same weapons i died ( i use Hunting rifle + CZ75 + Law launcher ) but when i respawn i have only an Ak47 with 30 rounds..

Thanks for any help :D

Share this post


Link to post
Share on other sites

Try this classic script

Put the weapon_respawn.xsqs script in your mission folder (I also suggest changing the extension back to .sqs while you're at it).

In your init.sqs script or the init line of the unit in the editor put: [Name of unit,1] exec "weapon_respawn.xsqs", where Name is what you've put in the unit's Name field in the editor. The second argument can be 0 or 1. 0 means the unit gets the weapons and magazines they had when the mission started, 1 means they get the weapons/magazines they had when they died.

E.g. ["W1",1] exec "weapon_respawn.xsqs". For the unit named W1.

Share this post


Link to post
Share on other sites

I tried this script zeewolf and it doesn't work for me :S, ive looked at the information in the files but nothing :(, What i did is name my unit "w1" okay then on the init file ive got " ~0.01

["w1",1] exec "weapons_respawn.sqs" and nothing happens, have I left something out?

Share this post


Link to post
Share on other sites

Same script is here:

http://www.armaholic.com/page.php?id=1554&highlight=UNIVERSAL+WEAPONS+RESPAWN+SCRIPT

I use it myself all the time and works for me np.

Look below, for every person that is playing add this code, and just give each person a name,

for example I'll use W1 for the 1st guy, and then W2 for the 2nd and so forth.

Put the code in the init line of each solider that is going to play.

["w1",0] exec "weapons_respawn.sqs"
["w2",0] exec "weapons_respawn.sqs"
["w3",0] exec "weapons_respawn.sqs"

the 2nd number after w1 there is 0 <--(zero) either choose 0 or 1

if you choose 0 then when you die you will get the same weapon and ammo ect, you started with.

If you choose 1 then you will respawn with the weapons and ammo you had last.

For the script itself just place in your folder of the mission, obviously it will be an mp missions so it needs to be i this folder address:

C:\Documents and Settings\username\My Documents\ArmA 2\MPMissions

Any questions about importing missions into the editor, or files related to it, then refer to my tutorial in my sig.

Share this post


Link to post
Share on other sites

when I try and load the mission up it comes up saying "script weapons_respawn.sqs" can not be found? any idea why that is?

Thank you for helping me with this matter :)

Share this post


Link to post
Share on other sites
Same script is here:

For the script itself just place in your folder of the mission, obviously it will be an mp missions so it needs to be i this folder address:

C:\Documents and Settings\username\My Documents\ArmA 2\MPMissions

I'm amazed people are still using versions of this script for Arma 2, it's a good example of dynamic code generation but it isn't the most efficient or best written implementation.

when I try and load the mission up it comes up saying "script weapons_respawn.sqs" can not be found? any idea why that is?

Thank you for helping me with this matter :)

The error means it can't find a script by that file name.

Is there a script with that file name in your mission's folder? Your mission folder would be in Operation Flashpoint\Users\profile name\MPMissions\mission name.island name (assuming you're using OFP not Arma:CWA).

Check the file name extension is correct, for some reason the version on OFPEC is using the extension .xsqs. When it really should be .sqs so either rename the file extension to .sqs or change the exec call to the .xsqs.

Share this post


Link to post
Share on other sites

Yeah im using it for ofp, the file name is "weapons_respawn.xsqs" and in my units int ive put "["w1",0] exec "weapons_respawn.xsqs" and still comes up with that problem, ive tryed it without the xsqs and put sqs.

Share this post


Link to post
Share on other sites

W1 is just the name of the unit or soldier, be sure to name the unit or soldier w1 too or it wont work.

the name can be anything not w1, I just use that as its small less to type in the editor.

Share this post


Link to post
Share on other sites

Here's a demo mission with that script working. It's pretty barebones but it has a timer script and outros, as well as selectable loadouts in the briefing. Basically all the background stuff needed for an infantry mission. There's no vehicle respawning or game mode scripting included since that might be confusing if you're just trying to get infantry respawn with weapons working.

If you're still having issues zip up the mission folder and upload it somewhere we will take a look.

Edited by *Zeewolf*

Share this post


Link to post
Share on other sites

Ive got it! :D, i just looked on how the demo mission did it :), cheers guys! :icon_dj:

Ive tried looking for the vehicle one but I cant find a thread? if there one out there? and do you guys no of a script where say the tank (which has AI in it) gets destroyed but re spawns again with the ai in it and dose its way points?

Edited by kierandobbin54

Share this post


Link to post
Share on other sites

:j: Vehicle respawn script on OFPEC

Here's the same mission again with the vehicle respawn script. Note that this only respawns empty vehicles for players to use (or command their AI to use). AI will not automatically board available empty vehicles, that would all have to be scripted. For this vehicle respawn script the first vehicle placed down in the editor must have "vehicles = [this]" in its init line, all vehicles placed after that need to have "vehicles = vehicles + [this]" in their init lines.

It really depends on what kind of mission you are making if you want AI to use vehicles. You can either use them in a "single player" style of spawning an entire crew, telling them to get in a vehicle (using script) then moving their waypoints around to control them, they then fight together as a team in the same way as they do in single player. The other style is if you want "bots" which act like spawned humans to occupy playable slots in a multiplayer mission, these are much harder to script, since generally they need to locate a vehicle (having decided they need one), decide which position they need to occupy then control the vehicle in a human like way. The last part is very challenging since a human player can control a tank by themselves, changing between the driver and gunner positions when necessary, an AI needs to be told via script when to change to gunner and when to drive.

Either way it is quite a bit more complicated than the respawning empty vehicles or units with weapons. If you want examples of how to do it, you'll have to tell me which style of AI you want.

Share this post


Link to post
Share on other sites

I don't have the original copy, here's something similar.

If you want multiplayer missions with sophisticated back end game mode scripting, I suggest you try my Modern War Crisis mod. It's a multiplayer only mod with a lot of game modes and advanced features like kill streaks, create-a-class mode and wager matches. It includes a load of templates that you can use to quickly make your own missions from the available game types.

Share this post


Link to post
Share on other sites
I don't have the original copy, here's something similar.

If you want multiplayer missions with sophisticated back end game mode scripting, I suggest you try my Modern War Crisis mod. It's a multiplayer only mod with a lot of game modes and advanced features like kill streaks, create-a-class mode and wager matches. It includes a load of templates that you can use to quickly make your own missions from the available game types.

Allright

Thank for your help

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  

×