Adjusting Zombie spawn rates based on time of day

Discussion in 'General Discussion' started by Morgue2903, Feb 16, 2015.

  1. Morgue2903

    Morgue2903 New Member

    Joined:
    May 11, 2014
    Messages:
    9
    Likes Received:
    0
    Guys...
    Whats up... thanks for your help in the past...
    Can anyone help me with a little script code... working on with Reality Dayz 1.8.4. Wanted to know if any of you know of a script that would allow me to change the spawn number and rate at a give server up time... Simple logic is this:

    UpTime=4
    if UpTime=>3
    Zombie spawn rate City 30
    Zombie spawn rate Town 20
    Zombie spawn rate Village 10
    else if UpTime=<3
    Zombie spawn rate City 60
    Zombie spawn rate Town 40
    Zombie spawn rate Village 20

    Any thought how to accomplish this?

    Thanks,

    Matt!
     
  2. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,414
    Likes Received:
    336
    Maybe easiest would be to change the max number of zombies at certain times?
     
  3. Morgue2903

    Morgue2903 New Member

    Joined:
    May 11, 2014
    Messages:
    9
    Likes Received:
    0
    that would require a restart and reset the time of day... I know that it would need to be in the part of the running spawn code, but not sure of the code or the placement...
     
  4. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,414
    Likes Received:
    336
    I dont know that you cant change the maxzombies on the fly. Have you tried it?
    Have this code in your init.sqf

    while {true} do {

    if uptime > 60 then dayzmaxzombies = 20
    f uptime > 120 then dayzmaxzombies = 30
    f uptime > 180 then dayzmaxzombies = 40
    f uptime > 240 then dayzmaxzombies = 60

    sleep 5;
    }
     
  5. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,414
    Likes Received:
    336
    to test if you can change max zombies do this in your init.sqf
    set the max zombies to 60 and go to town, see if they are all over the place, they should be.

    put this code in the bottom of your init.sqf

    Code:
    _this = createTrigger ["EmptyDetector", [7024.4883, 7660.3794, 0]];
    _this setTriggerActivation ["ALPHA", "PRESENT", true];
    _this setTriggerStatements ["this", "dayz_maxzombiesglobal = 0;", Position player, [], 0, ""FORM""];", ""];
    
    Now you press backspace to bring up the menu, click the bottom comms option, then radio and radio alpha.
    Then go to a different city and there should be zero zombies spawned if we were able to change the value.

    Check the variable name though. And as usual, this is off teh top of my head, not tested and might have an error but you get the gist of it all and can work it all out
     
  6. Morgue2903

    Morgue2903 New Member

    Joined:
    May 11, 2014
    Messages:
    9
    Likes Received:
    0
    I'll build this in and give it a try... the trigger code at the bottom is an in game code I have never used before... the "if" statements, do I put this close to the top of the init.
     
  7. Morgue2903

    Morgue2903 New Member

    Joined:
    May 11, 2014
    Messages:
    9
    Likes Received:
    0
    Thanks, by the way...!!
     
  8. Morgue2903

    Morgue2903 New Member

    Joined:
    May 11, 2014
    Messages:
    9
    Likes Received:
    0
    looking through the code, where is the uptime defined? I know it's in the Debug, but can I pull a variable from there... I think I need a "define" at the top to set the uptime as a thing... thoughts?
     
  9. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,414
    Likes Received:
    336
    I believe its called servertime ..
     

Share This Page