Page 1 of 2 12 LastLast
Results 1 to 10 of 15

  Click here to go to the first Developer post in this thread.  

Thread: Respawning unarmed.

  1. #1
    In what file, and what do I type in it to make soldiers respawn completely unarmed?

  2. #2
    Master Gunnery Sergeant 5133p39's Avatar
    Join Date
    Feb 2 2004
    Location
    Czech Republic
    Posts
    1,383
    Quote Originally Posted by (Lifter @ Jan. 09 2006,14:21)
    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.
    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!

  3. #3
    As for now the soldiers (lasers rangers) respawn with the standard BIS M16 with 30rds in the mag.

    Can't quite figure this out.

  4. #4
    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.




  5. #5
    Master Gunnery Sergeant 5133p39's Avatar
    Join Date
    Feb 2 2004
    Location
    Czech Republic
    Posts
    1,383
    Quote Originally Posted by (Metal Heart @ Jan. 11 2006,09:33)
    Just using alive player condition doesn't work because, well, it removes all weapons when ever the player is alive.
    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.
    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 ;-)




  6. #6
    Quote Originally Posted by [b
    Quote[/b] ]but it&#39;s ULTRA easy to prevent it. I thought that it would be obvious.
    Yeah, obvious if you have done scripting or made mp missions before, I think that is not the case here. You shouldn&#39;t assume that everyone in the world automaticly knows all the things you consider obvious.

    Quote Originally Posted by [b
    Quote[/b] ]It makes me angry when i see someone wasting resources by tons of triggers ;-)
    One extra trigger hardly makes a noticeable difference but I do agree

  7. #7
    I&#39;m quite lost here, where can I find one of those nice scripts you are talking about?

  8. #8
    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&#39;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=&#34;Respawn example&#34;;[/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
    &#91;&#93; exec &#34;respawn.sqs&#34;;
    [/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 &#34;start&#34;;[/QUOTE]
    9. That&#39;s it. Make sure you have file type extensions visible so you don&#39;t have files ending like respawn.sqs.txt if you create them with notepad

  9. #9
    Metal Heart, thank you&#33; 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?

  10. #10
    It&#39;s not a name, it&#39;s sort of a special pointer to the unit that the local player controls. It&#39;s pointing to a different unit on every client&#39;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&#39;s not a player. Makes sense, eh?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •