In what file, and what do I type in it to make soldiers respawn completely unarmed?
In what file, and what do I type in it to make soldiers respawn completely unarmed?
You must either set their default loadout in their config.cpp ( weapons[]={}; magazines[]={}; ), or you can remove their weapons after the respawn by the command "RemoveAllWeapons Player" which you can run from a switch with condition "Alive Player" or something like that.Originally Posted by (Lifter @ Jan. 09 2006,14:21)
MSI P55-GD65 | Core i5 750 @ 2.67GHz | 4GB DDR3 | ATI HD 5970 (Asus EAH5970/G/2DIS/2GD5) | OCZ Revo 120GB PCIe SSD | 2x OCZ Vertex 4 120GB |
Windows 7 64bit Home Premium | Catalysts 13.1 | ArmA2 OA 1.62.0.101480 (beta) +BAF +PMC +ACR | ArmA2 1.11.0.86734 | ArmA 1.18.0.5281 | OFP 1.0.0.96
Be smart, use Sprocket!
As for now the soldiers (lasers rangers) respawn with the standard BIS M16 with 30rds in the mag.
Can't quite figure this out.
Just using alive player condition doesn't work because, well, it removes all weapons when ever the player is alive.
If you don't want to use a respawn script, you can use 2 triggers and a variable like this: (note that this works locally on each player)
-Reset variable playerdead=0; in some units init line or init.sqs
-Make trigger1:
set activation repeatedly
condition NOT alive player AND playerdead==0;
on activation playerdead=1;
-Make trigger2:
set activation repeatedly
condition alive player AND playerdead==1;
on activation removeAllWeapons player; playerdead=0;
Only problem is, that the triggers work somewhat slow, so it takes a fraction of a second before weapon is removed. Someone might shoot you before trigger2 kicks in and grab your rifle. This could be a problem if you're making a mission with only pistols, for example. So, it's better to use a respawn script.
If you want to add load-out automaticly, add it to trigger2 on activation, and if there's more playable sides besides west, you need to use triggers with side condition to get them their corresponding load-outs.
You are right, it will be executed on the mission start - but it's ULTRA easy to prevent it. I thought that it would be obvious.Originally Posted by (Metal Heart @ Jan. 11 2006,09:33)
So here is the exact solution.
Method 1:
Make JUST ONE switch where condition="not Alive Player" and onActivation="[] exec 'some_script.sqs'".
Create the some_script.sqs:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@Alive Player
...and then here goes what should be executed when the player respawns[/QUOTE]
Method 2:
Make a switch [condition="Alive Player", onActivation="[] exec "some_script.sqs"",onDeactivation="respawn=tru e"].
Create mission init.sqs and put "respawn=false" into it.
Create the "some_script.sqs" and put into it whatever you want to be executed when the player respawns.
There are tons of ways, and all of them can be done with just one switch. It makes me angry when i see someone wasting resources by tons of triggers ;-)
Yeah, obvious if you have done scripting or made mp missions before, I think that is not the case here. You shouldn't assume that everyone in the world automaticly knows all the things you consider obvious.Originally Posted by [b
One extra trigger hardly makes a noticeable difference but I do agreeOriginally Posted by [b
![]()
I'm quite lost here, where can I find one of those nice scripts you are talking about?
Lots of tutorials, scripts and command reference with examples & comments: Operation Flashpoint Editing Center
...
You can also setup respawn without triggers... for a quick example with very simple instructions:
1. in main menu-> press multiplayer-> new-> select "new-editor"
2. place player
3. place marker named "respawn_west" (otherwise you'll respawn where you died)
4. save mission as "Respawn example" or something
5. alt+tab to desktop
6. create file description.ext to ofp/users/username/MPMissions/Respawn example.Intro:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">respawn=3;
respawndelay=5;
onLoadMission="Respawn example";[/QUOTE]
7. create file init.sqs:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">~2
[] exec "respawn.sqs";
[/QUOTE]
8. create file respawn.sqs:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#start
@NOT alive player
@alive player
removeAllWeapons player;
goto "start";[/QUOTE]
9. That's it. Make sure you have file type extensions visible so you don't have files ending like respawn.sqs.txt if you create them with notepad
Metal Heart, thank you! It works now.
Only question I have is if that player covers all the players that are going to be in the mp game (8 ppl).
Does every player go as the name "player" or what?
It's not a name, it's sort of a special pointer to the unit that the local player controls. It's pointing to a different unit on every client's computer, and since the "respawn.sqs" is also running _locally_ on each client, it works.
However, if a player disconnects, the AI that takes control of his unit will from then on respawn with the weapon because it's not a player. Makes sense, eh?![]()