Announcement

Collapse
No announcement yet.

An attempt at a "Wave Respawn"

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • An attempt at a "Wave Respawn"

    Now that I've gotten a bit more knowledgeable about the ArmA scripting language ( MP scripting still gives me plenty of trouble :) ), I was intrigued by the idea of a wave respawn.

    My first thoughts were to simply modify the player's respawn time according to some conditions of a trigger, but it seems you can only GET the remaining spawn time, not change it.

    So, it is now a bit more complicated (and a bit rougher).

    I just made this system in about 1 hour so, if there are some problems, forgive me. Plus, I don't have access to a dedicated server, so I can't tell you if it's going to work on one. From what I've coded, I would say it should, but from my past experiences ... I would say SOMETHING is going to not work right ( ... theres always something).


    How it works is as such:

    You die (sucks to be you), you wait 20 seconds to respawn. You respawn (BLUFOR on Antigua, REDFOR on Rahmadi). You are forced into the map (better than a black screen and I don't do dialogs). You have a timer counting down that tells you how long till you respawn (real this time). If more than 4 players are at the on-island base, you are teleported there, if your time limit ends (thinking 3 minutes, all these are easily changeable) you are teleported to the on-island base. Once you are teleported, you are given your equipment and the forced map is closed.


    For anyone interested, this is the sqf file I am using for this, plus two triggers on the map.

    //Written by beta
    //Waits until the player dies, then on respawn adds equipment, waits for players
    //at base or until 3 minutes has passed, then moves player to the base area

    //infinite loop
    for [{_i=0}, {_i<1}, {_i=0}] do
    {
    waitUntil {!alive player}; //player has died
    waitUntil {alive player}; //player has respawned
    removeAllWeapons player; //disarm the player to prevent stupidness in purgatory
    forceMap true;
    _waitTime = 10;

    if (side player == WEST) then
    { //player on BLUFOR
    //if there is not enough people for a wave spawn and the timer isn't done
    while {!waveRespawnBLUFOR && _waitTime > 0} do
    {
    hint format["%1 seconds remaining until respawn", _waitTime];
    _waitTime = _waitTime - 1;
    sleep 1;
    };

    player setPos (getMarkerPos "BLUFOR_base_area");
    sleep 0.5;
    [] execVM "scripts\respawn_arm.sqf";
    forceMap false;
    hint "";
    }
    else
    { //player on REDFOR
    //if there is not enough people for a wave spawn and the timer isn't done
    while {!waveRespawnREDFOR && _waitTime > 0} do
    {
    hint format["%1 seconds remaining until respawn", _waitTime];
    _waitTime = _waitTime - 1;
    sleep 1;
    };

    player setPos (getMarkerPos "REDFOR_base_area");
    sleep 0.5;
    [] execVM "scripts\respawn_arm.sqf";
    forceMap false;
    hint "";
    };
    };

    if (true) exitWith {};


    (Sorry for the lack of indentation, the post didn't let me do it ...)


    Triggers:

    Activation: BLUFOR Present
    Condition: this && count thisList > 3
    On Activation: waveRespawnBLUFOR = true; publicVariable "waveRespawnBLUFOR";
    On Deactivation: waveRespawnBLUFOR = false; publicVariable "waveRespawnBLUFOR";
    Placed over the BLUFOR starting base

    Activation: REDFOR Present
    Condition: this && count thisList > 3
    On Activation: waveRespawnREDFOR = true; publicVariable "waveRespawnREDFOR";
    On Deactivation: waveRespawnREDFOR = false; publicVariable "waveRespawnREDFOR";
    Placed over the REDFOR starting base


    I might have access to a dedi server later today, if I do, I will be trying a quick test of this to see if it works at all. I'll post the findings here for anyone interested.

  • #2
    Re: An attempt at a &quot;Wave Respawn&quot;

    This looks like a damn good idea. Let me know how it works.
    The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. ~
    I have a tendency to key out three or four things and then let them battle for supremacy while I key, so there's a lot of backspacing as potential statements are slaughtered and eaten by the victors. ~
    Feel free to quote me. ~

    Comment


    • #3
      Re: An attempt at a &quot;Wave Respawn&quot;

      Great work beita, I really respect people that can do stuff like that, cause when I try to understand scripting and programming my head goes red and steam start coming out of my ears. I'll look into how I can use it.

      Comment


      • #4
        Re: An attempt at a &quot;Wave Respawn&quot;

        Nice script. I can see that added to a couple missions...
        "The chief foundations of all states, new as well as old or composite, are good laws and good arms; and as there cannot be good laws where the state is not well armed, it follows that where they are well armed they have good laws." -Machiavelli

        Comment


        • #5
          Re: An attempt at a &quot;Wave Respawn&quot;

          Just did a quick test with modified numbers.

          It worked!

          I'm going to put it into my mission, which is about 30 minutes from release (got the damn JIP working!).

          I'll make a thread for that mission shortly.

          Comment


          • #6
            Re: An attempt at a &quot;Wave Respawn&quot;

            How well do you think you'll be able to implement this in other missions?
            The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. ~
            I have a tendency to key out three or four things and then let them battle for supremacy while I key, so there's a lot of backspacing as potential statements are slaughtered and eaten by the victors. ~
            Feel free to quote me. ~

            Comment


            • #7
              Re: An attempt at a &quot;Wave Respawn&quot;

              I think it will be fairly modular.

              You will need a trigger covering the area you want to make the player's "base". The numbers are all easily changeable (300s, 4 players). It can work just as well with 1 side or 2 (probably even 3).

              Later today I can make a quick template mission that has all the stuff you need. Only needs a couple of boolean variables in the init, and the one script file, plus the trigger(s).

              Comment


              • #8
                Re: An attempt at a &quot;Wave Respawn&quot;

                I mean how well do you think YOU will be able to implement it in existing missions, and can we hope for you to modify some of the better ones some time in the future?
                The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. ~
                I have a tendency to key out three or four things and then let them battle for supremacy while I key, so there's a lot of backspacing as potential statements are slaughtered and eaten by the victors. ~
                Feel free to quote me. ~

                Comment


                • #9
                  Re: An attempt at a &quot;Wave Respawn&quot;

                  If I can get the files .. I could take a look.

                  Shouldn't be all that much work.

                  Comment

                  Connect

                  Collapse

                  TeamSpeak 3 Server

                  Collapse

                  Advertisement

                  Collapse

                  Twitter Feed

                  Collapse

                  Working...
                  X