Author Topic: Endless Zombies Modification  (Read 2284 times)

I am trying to make a slight adjustment to the "Endless Zombies" gamemode by Gravity Cat. I'm trying to remove all custom weapons that the zombies hold so that they appear as normal zombies with both hands forward. I also have tried to reduce the boss zombie to normal size, but whatever I did, it didn't work. If anyone has any idea how to help me out, I would greatly appreciate it.

http://www.mediafire.com/download/emfqvoq8rq1dmov/Gamemode_EndlessZombies.zip

Server.cs
Quote
//########## Endless Zombies for Slayer

// Grab date for stuff
$date = strReplace(getDateTime(),"/"," ");
$sysmonth = getWord($date,0);

%error1 = forceRequiredAddon("Gamemode_Slayer");
%error2 = forceRequiredAddon("Weapon_Gun");
%error3 = forceRequiredAddon("Weapon_Guns_Akimbo");
%error4 = forceRequiredAddon("Weapon_Rocket_Launcher");
%error5 = forceRequiredAddon("Weapon_Sword");
%error6 = forceRequiredAddon("Vehicle_Horse");
%error7 = forceRequiredAddon("Vehicle_Tank");
%error8 = forceRequiredAddon("Weapon_Bow");
if(%error1 == $Error::Addon_NotFound)
  error("ERROR: Gamemode_EndlessZombies - Required add-on Gamemode_Slayer not found!");
if(%error8 == $Error::Addon_NotFound)
  error("ERROR: Gamemode_EndlessZombies - Required add-on Weapon_Bow not found!");
if(%error2 == $Error::Addon_NotFound)
  error("ERROR: Gamemode_EndlessZombies - Required add-on Weapon_Sword not found!");
if(%error6 == $Error::Addon_NotFound)
  error("ERROR: Gamemode_EndlessZombies - Required add-on Weapon_Gun not found!");
if(%error3 == $Error::Addon_NotFound)
  error("ERROR: Gamemode_EndlessZombies - Required add-on Weapon_Guns_Akimbo not found!");
if(%error4 == $Error::Addon_NotFound)
  error("ERROR: Gamemode_EndlessZombies - Required add-on Weapon_Rocket_Launcher not found!");
if(%error5 == $Error::Addon_NotFound)
  error("ERROR: Gamemode_EndlessZombies - Required add-on Vehicle_Horse not found!");
if(%error7 == $Error::Addon_NotFound)
  error("ERROR: Gamemode_EndlessZombies - Required add-on Vehicle_Tank not found!");

if(%error1 != $Error::Addon_NotFound)
 if(%error2 != $Error::Addon_NotFound)
  if(%error3 != $Error::Addon_NotFound)
   if(%error4 != $Error::Addon_NotFound)
    if(%error5 != $Error::Addon_NotFound)
     if(%error6 != $Error::Addon_NotFound)
      if(%error7 != $Error::Addon_NotFound)
       if(%error8 != $Error::Addon_NotFound)
       {
        exec("./basic.cs");
        if($sysmonth $= "12") exec("./items/christmas.cs");
       }

zombiedata.cs
Quote
//########## Zombie Data Stuff

function EZM_addZombie(%name,%namelist,%datablock,%playersize,%melee,%ranged,%specialwave,%propability,%allow)
{
  if(%name $= "") return;
  if(%datablock $= "") return;

  %i = 0;
  while($EZM_Zombies[%i,"Name"] !$= "") %i += 1;

  if(%namelist $= "" || %namelist $= 0) %namelist = %name;
  if(%melee $= "" || %melee $= 0) %melee = "EZM_SwordImage EZM_ShovelImage EZM_PickaxeImage EZM_FryingPanImage EZM_ButcherKnifeImage";
  if(%ranged $= "" || %ranged $= 0) %ranged = "EZM_BowImage EZM_GunImage EZM_AkimboGunImage";
  if(%propability < 1) %propability = 1;
  if(%allow $= "" || %allow $= 0) %allow = -1;
  if(%specialwave $= "" || %specialwave !$= 1) %specialwave = 0;

  $EZM_Zombies[%i,"Name"] = %name;
  $EZM_Zombies[%i,"Namelist"] = %namelist;
  $EZM_Zombies[%i,"Datablock"] = %datablock;
  $EZM_Zombies[%i,"PlayerSize"] = %playersize;
  $EZM_Zombies[%i,"Melee"] = %melee;
  $EZM_Zombies[%i,"Ranged"] = %ranged;
  $EZM_Zombies[%i,"SpecialWave"] = %specialwave;
  $EZM_Zombies[%i,"Propability"] = %propability;
  $EZM_Zombies[%i,"Allow"] = %allow;
}

function EZM_addBoss(%name,%namelist,%datablock,%playersize,%melee,%ranged,%propability,%allow)
{
  if(%name $= "") return;
  if(%datablock $= "") return;

  %i = 0;
  while($EZM_Bosses[%i,"Name"] !$= "") %i += 1;

  if(%namelist $= "" || %namelist $= 0) %namelist = %name;
  if(%melee $= "" || %melee $= 0) %melee = "EZM_RocketLauncherImage";
  if(%ranged $= "" || %ranged $= 0) %ranged = "EZM_RocketLauncherImage";
  if(%propability < 1) %propability = 1;
  if(%allow $= "" || %allow $= 0) %allow = -1;

  $EZM_Bosses[%i,"Name"] = %name;
  $EZM_Bosses[%i,"Namelist"] = %namelist;
  $EZM_Bosses[%i,"Datablock"] = %datablock;
  $EZM_Bosses[%i,"PlayerSize"] = %playersize;
  $EZM_Bosses[%i,"Melee"] = %melee;
  $EZM_Bosses[%i,"Ranged"] = %ranged;
  $EZM_Bosses[%i,"Propability"] = %propability;
  $EZM_Bosses[%i,"Allow"] = %allow;
}

function EZM_addAppearance(%name,%appearance,%hidenodes,%facedecal,%chestdecal,%mountedimage)
{
  if(%name $= "") return;

  %i = 0;
  while($EZM_ZombieAppearances[%name,%i,"Appearance"] !$= "") %i += 1;

  if(%appearance $= "" || %appearance $= 0) %appearance = -1;
  if(%hidenodes $= "" || %hidenodes $= 0) %hidenodes = -1;
  if(%facedecal $= "" || %facedecal $= 0) %facedecal = "Smiley";
  if(%chestdecal $= "" || %chestdecal $= 0) %chestdecal = "AAA-None";
  if(%mountedimage $= "" || %mountedimage $= 0) %mountedimage = -1;

  $EZM_ZombieAppearances[%name,%i,"Appearance"] = %appearance;
  $EZM_ZombieAppearances[%name,%i,"HideNodes"] = %hidenodes;
  $EZM_ZombieAppearances[%name,%i,"FaceDecal"] = %facedecal;
  $EZM_ZombieAppearances[%name,%i,"ChestDecal"] = %chestdecal;
  $EZM_ZombieAppearances[%name,%i,"MountedImage"] = %mountedimage;
}

//### Spawn Functions

function EZM_SpawnZombie(%this,%mini)
{
  if(!isObject(%this)) return;
  if(!isObject(%mini)) return;
  if(%mini.EZM_IsSpecialWave) %len = %mini.EZM_SpecialWaveZombieType;
  else
  {
    %len = %rnd = 0;
    %propability = $EZM_Zombies[0,"Propability"];
    while($EZM_Zombies[%len + 1,"Name"] !$= "")
    {
      %len += 1;
      %allow = -1;
      if($EZM_Zombies[%len,"Allow"] !$= -1) eval("%allow = %mini." @ $EZM_Zombies[%len,"Allow"] @ "; $evalNoError = 0;");
      if(%allow != 0) %propability += $EZM_Zombies[%len,"Propability"];
    }
    %rnd = getRandom(%propability);
    %len = 0;
    while($EZM_Zombies[%len,"Name"] !$= "")
    {
      %allow = -1;
      if($EZM_Zombies[%len,"Allow"] !$= -1) eval("%allow = %mini." @ $EZM_Zombies[%len,"Allow"] @ "; $evalNoError = 0;");
      if(%allow != 0)
      {
        if($EZM_Zombies[%len,"Propability"] < %rnd)
        {
          %rnd -= $EZM_Zombies[%len,"Propability"];
          %len += 1;
        }
        else
          break;
      }
      else
        %len += 1;
    }
  }
  %name = $EZM_Zombies[%len,"Name"];
  %namelist = $EZM_Zombies[%len,"Namelist"];
  %db = $EZM_Zombies[%len,"Datablock"];
  %playersize = $EZM_Zombies[%len,"PlayerSize"];
  %melee = $EZM_Zombies[%len,"Melee"];
  %ranged = $EZM_Zombies[%len,"Ranged"];

  %intelligence = mClampF(%mini.EZM_ZombieIntelligence + %mini.EZM_ZombieIntelligenceInc,0,100);
  if(%db $= "") return;
  %this.bot = new AIPlayer()
  {
    dataBlock = %db;
    position = %this.getPosition();
    EZMisZombie = true;
    home = %this;
    intelligence = %intelligence;
    sightRange = 50 + (%intelligence * 4.5);
    attackRange = 5;
    minigame = %mini;
    name = %namelist;
  };
  if(isObject(%this.bot))
  {
    %this.bot.setPlayerScale(%playersize);
    %this.bot.spawnexplosion(SpawnProjectile,%this.bot.getScale());
    %this.bot.hType = "enemy";
    %mini.EZM_ZombieCount += 1;
    %mini.EZM_ZombieWaveCount -= 1;
    %this.bot.EZM_Idle();
    %this.bot.client = %this.bot;
    EZMZombies.add(%this.bot);

    %len = %rnd = 0;
    while($EZM_ZombieAppearances[%name,%len,"Appearance"] !$= "") %len += 1;
    %rnd = getRandom(%len - 1);

    %app = $EZM_ZombieAppearances[%name,%rnd,"Appearance"];
    %hide = $EZM_ZombieAppearances[%name,%rnd,"HideNodes"];
    %face = $EZM_ZombieAppearances[%name,%rnd,"FaceDecal"];
    %chest = $EZM_ZombieAppearances[%name,%rnd,"ChestDecal"];
    %image = $EZM_ZombieAppearances[%name,%rnd,"MountedImage"];

    if(%app != -1) {
      for(%i=0;%i<getWordCount(%app);%i++) {
        %this.bot.unHideNode(getWord(%app,%i));
        %this.bot.setNodeColor(getWord(%app,%i),getWords(%app,%i + 1,%i + 4));
        %i += 4; }
    }
    if(%hide != -1) { for(%i=0;%i<getWordCount(%hide);%i++) { %this.bot.hideNode(getWord(%hide,%i)); } }
    %this.bot.setFaceName(getWord(%face,getRandom(getWordCount(%face)-1)));
    %this.bot.setDecalName(getWord(%chest,getRandom(getWordCount(%chest)-1)));
    if(%image != -1) %this.bot.mountImage(%image,2);
    else if(%this.bot.getDataBlock().shapeFile $= "base/data/shapes/player/m.dts" && %mini.EZM_Christmas) {
%this.bot.hideNode(bicorn); %this.bot.hideNode(cophat); %this.bot.hideNode(triplume); %this.bot.hideNode(flarehelmet); %this.bot.hideNode(helmet); %this.bot.hideNode(knithat); %this.bot.hideNode(plume); %this.bot.hideNode(pointyhelmet); %this.bot.hideNode(scouthat); %this.bot.hideNode(septplume); %this.bot.hideNode(visor);
%this.bot.mountImage(EZM_SantahatImage,2); }

    %rnd = 0;
    if(%mini.EZM_ZombieWeapons == 0)
      %weapon = 1;
    else if(%mini.EZM_ZombieWeapons == 1)
      %weapon = 2;
    else
    {
      if(getRandom(3)) %weapon = 1;
      else
        %weapon = 2;
    }
    if(%ranged == -1) %weapon = 1;
    if(%melee == -1) %weapon = 2;
    if(%weapon == 1) {
      %rnd = getRandom(0,getWordCount(%melee) - 1);
      %this.bot.mountImage(getWord(%melee,%rnd),0);
      if(%mini.EZM_Christmas && getRandom(1)) %this.bot.mountImage(EZM_CaneSwordImage,0); }
    else {
      %rnd = getRandom(0,getWordCount(%ranged) - 1);
      %this.bot.mountImage(getWord(%ranged,%rnd),0);
      %this.bot.attackRange = %this.bot.sightRange / 2;
      if(%mini.EZM_Christmas && getRandom(1)) %this.bot.mountImage(EZM_CaneGunImage,0); }
    if(%this.bot.getMountedImage(0).armReady) %this.bot.playThread(0,"armReadyRight");
    if(%mini.EZM_SuddenDeathTimeLimit)
    {
      %timediff = (%mini.EZM_SuddenDeathTimeLimit*60) - %mini.EZM_SuddenDeathTimer;
      if(%timediff == 0)
        if(%mini.EZM_SuddenDeath == 0)
          %this.bot.setDamageLevel(%this.bot.maxDamage - 1);
    }
  }
}

function EZM_SpawnBoss(%this,%mini)
{
  if(!isObject(%this)) return;
  if(!isObject(%mini)) return;

  %len = %rnd = 0;
  %propability = $EZM_Bosses[0,"Propability"];
  while($EZM_Bosses[%len + 1,"Name"] !$= "")
  {
    %len += 1;
    %allow = -1;
    if($EZM_Bosses[%len,"Allow"] !$= -1) eval("%allow = %mini." @ $EZM_Bosses[%len,"Allow"] @ "; $evalNoError = 0;");
    if(%allow != 0) %propability += $EZM_Bosses[%len,"Propability"];
  }
  %rnd = getRandom(%propability);
  %len = 0;
  while($EZM_Bosses[%len,"Name"] !$= "")
  {
    %allow = -1;
    if($EZM_Bosses[%len,"Allow"] !$= -1) eval("%allow = %mini." @ $EZM_Bosses[%len,"Allow"] @ "; $evalNoError = 0;");
    if(%allow != 0)
    {
      if($EZM_Bosses[%len,"Propability"] < %rnd)
      {
        %rnd -= $EZM_Bosses[%len,"Propability"];
        %len += 1;
      }
      else
        break;
    }
    else
      %len += 1;
  }
  %name = $EZM_Bosses[%len,"Name"];
  %namelist = $EZM_Bosses[%len,"Namelist"];
  %db = $EZM_Bosses[%len,"Datablock"];
  %playersize = $EZM_Bosses[%len,"PlayerSize"];
  %melee = $EZM_Bosses[%len,"Melee"];
  %ranged = $EZM_Bosses[%len,"Ranged"];

  %intelligence = mClampF(%mini.EZM_ZombieIntelligence + %mini.EZM_ZombieIntelligenceInc,0,100);
  if(%db $= "") return;
  %this.bot = new AIPlayer()
  {
    dataBlock = %db;
    position = %this.getPosition();
    EZMisZombie = true;
    EZMisBoss = true;
    home = %this;
    intelligence = %intelligence;
    sightRange = 50 + (%intelligence * 4.5);
    attackRange = 5;
    minigame = %mini;
    name = %namelist;
  };
  if(isObject(%this.bot))
  {
    %this.bot.setPlayerScale(%playersize);
    %this.bot.spawnexplosion(SpawnProjectile,%this.bot.getScale());

    %rnd = getRandom(11);
    %prefix = "\c3The mighty";
    if(%rnd == 1) %prefix = "\c3The treacherous";
    else if(%rnd == 2) %prefix = "\c3The terrible";
    else if(%rnd == 3) %prefix = "\c3Behold, ";
    else if(%rnd == 4) %prefix = "\c3Behold, ";
    else if(%rnd == 5) %prefix = "\c3Behold, the mighty";
    else if(%rnd == 6) %prefix = "\c3Behold, the treacherous";
    else if(%rnd == 7) %prefix = "\c3Behold, the terrible";
    else if(%rnd == 8) %prefix = "\c3Heads will roll, for";
    else if(%rnd == 9) %prefix = "\c3Heads will roll, as the mighty";
    else if(%rnd == 10) %prefix = "\c3Heads will roll, for the treacherous";
    else if(%rnd == 11) %prefix = "\c3Heads will roll, as the terrible";
    %rnd = getRandom(2);
    %suffix = " \c3 has appeard!";
    if(%rnd == 1) %suffix = " \c3 stepped out of his grave!";
    else if(%rnd == 2) %suffix = " \c3 has returned from the dead!";
    %mini.messageAll(0,%prefix @ " \c0" @ %this.bot.name @ %suffix);
    %mini.EZM_ZombieCount += 1;
    %mini.EZM_BossCount -= 1;
    %this.bot.EZM_Idle();
    %this.bot.client = %this.bot;
    EZMZombies.add(%this.bot);

    %len = %rnd = 0;
    while($EZM_ZombieAppearances[%name,%len,"Appearance"] !$= "") %len += 1;
    %rnd = getRandom(%len - 1);

    %app = $EZM_ZombieAppearances[%name,%rnd,"Appearance"];
    %hide = $EZM_ZombieAppearances[%name,%rnd,"HideNodes"];
    %face = $EZM_ZombieAppearances[%name,%rnd,"FaceDecal"];
    %chest = $EZM_ZombieAppearances[%name,%rnd,"ChestDecal"];
    %image = $EZM_ZombieAppearances[%name,%rnd,"MountedImage"];

    if(%app != -1) {
      for(%i=0;%i<getWordCount(%app);%i++) {
        %this.bot.unHideNode(getWord(%app,%i));
        %this.bot.setNodeColor(getWord(%app,%i),getWords(%app,%i + 1,%i + 4));
        %i += 4; }
    }
    if(%hide != -1) { for(%i=0;%i<getWordCount(%hide);%i++) { %this.bot.hideNode(getWord(%hide,%i)); } }
    %this.bot.setFaceName(getWord(%face,getRandom(getWordCount(%face)-1)));
    %this.bot.setDecalName(getWord(%chest,getRandom(getWordCount(%chest)-1)));
    if(%image != -1) %this.bot.mountImage(%image,2);
    else if(%this.bot.getDataBlock().shapeFile $= "base/data/shapes/player/m.dts" && %mini.EZM_Christmas) {
%this.bot.hideNode(bicorn); %this.bot.hideNode(cophat); %this.bot.hideNode(triplume); %this.bot.hideNode(flarehelmet); %this.bot.hideNode(helmet); %this.bot.hideNode(knithat); %this.bot.hideNode(plume); %this.bot.hideNode(pointyhelmet); %this.bot.hideNode(scouthat); %this.bot.hideNode(septplume); %this.bot.hideNode(visor);
%this.bot.mountImage(EZM_SantahatImage,2); }

    %rnd = 0;
    %this.bot.playThread(0,"armReadyRight");
    if(%mini.EZM_ZombieWeapons == 0)
      %weapon = 1;
    else if(%mini.EZM_ZombieWeapons == 1)
      %weapon = 2;
    else
    {
      if(getRandom(1)) %weapon = 1;
      else
        %weapon = 2;
    }
    if(%ranged == -1) %weapon = 1;
    if(%melee == -1) %weapon = 2;
    if(%weapon == 1) {
      %rnd = getRandom(0,getWordCount(%melee) - 1);
      %this.bot.mountImage(getWord(%melee,%rnd),0);
      if(%mini.EZM_Christmas && getRandom(1)) %this.bot.mountImage(EZM_CaneSwordImage,0); }
    else {
      %rnd = getRandom(0,getWordCount(%ranged) - 1);
      %this.bot.mountImage(getWord(%ranged,%rnd),0);
      %this.bot.attackRange = %this.bot.sightRange / 2;
      if(%mini.EZM_Christmas && getRandom(1)) %this.bot.mountImage(EZM_CaneGunImage,0); }
  }
}
« Last Edit: July 09, 2015, 11:20:00 PM by Suna »

It would probably be easier to make zombies not equip items.

Also, I can't help you without any code.

It would probably be easier to make zombies not equip items.

Also, I can't help you without any code.
Updated. ^^

I can't post all of the code(s), but this is what I can fit.
« Last Edit: July 09, 2015, 11:24:57 PM by Suna »

basic.cs
Quote
//########## Endless Zombies for Slayer

//### Gamemode

if(!$Slayer::Server::Dependencies::Gamemodes)
   exec("Add-ons/Gamemode_Slayer/Dependencies/Gamemodes.cs");
Slayer.Gamemodes.addMode("Endless Zombies","EZM",0,1);

//### Preferences

if(!$Slayer::Server::Dependencies::Preferences) exec("Add-ons/Gamemode_Slayer/Dependencies/Preferences.cs");

Slayer.Prefs.addPref("EZM","Reset Lives every Wave","%mini.EZM_ResetLives","bool",1,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Delay between Waves (Seconds)","%mini.EZM_WaveDelay","int 10 120",30,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Special Waves","%mini.EZM_AllowSpecialWaves","bool",0,0,1,-1,"Rules EZM Mode");

Slayer.Prefs.addPref("EZM","Sudden Death Mode","%mini.EZM_SuddenDeath","list" TAB "0 Reduce health to 1" TAB "1 All players die" TAB "2 All zombies die",0,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Wave Time Limit (Minutes)","%mini.EZM_SuddenDeathTimeLimit","int 0 60",0,0,1,-1,"Rules EZM Mode");

Slayer.Prefs.addPref("EZM","Zombie Head Damage Only","%mini.EZM_ZombieHeadDmg","bool",0,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Zombie Starting Health (%)","%mini.EZM_ZombieHealth","int 0 200",100,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Health Increase per Wave (%)","%mini.EZM_ZombieHealthInc","int 0 100",10,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Zombie Starting Damage (%)","%mini.EZM_DamageScaling","int 1 200",100,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Damage Increase per Wave (%)","%mini.EZM_DamageScalingInc","int 0 100",1,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Zombie Starting Amount","%mini.EZM_ZombieAmount","int 0 50",25,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Zombie Increase per Wave","%mini.EZM_ZombieAmountInc","int 0 10",5,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Add Boss every X Waves","%mini.EZM_BossCountInc","int 0 50",20,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Max Amount of Zombies Spawned","%mini.EZM_ZombieAmountMaxSpawned","int 1 100",50,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Zombie Starting Intelligence","%mini.EZM_ZombieIntelligence","slide 0 100 99 1",25,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Intelligence Increase per Wave","%mini.EZM_ZombieIntelligenceInc","slide 0 10 9 1",1,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Always Find Players","%mini.EZM_ZombieSuperIntelligence","bool",0,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Zombie Weapons","%mini.EZM_ZombieWeapons","list" TAB "0 Melee Weapons only" TAB "1 Ranged Weapons only" TAB "2 Melee and Ranged Weapons",2,0,1,-1,"Rules EZM Mode");

Slayer.Prefs.addPref("EZM","Allow Skeletons","%mini.EZM_AllowSkeletons","bool",1,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Allow Normal Zombies","%mini.EZM_AllowNormalZombies","bool",1,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Allow Fat Zombies","%mini.EZM_AllowFatZombies","bool",1,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Allow Suicidal Zombies","%mini.EZM_AllowSuicidalZombies","bool",1,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Allow Ninja Zombies","%mini.EZM_AllowNinjaZombies","bool",1,0,1,-1,"Rules EZM Mode");
Slayer.Prefs.addPref("EZM","Allow Soldier Zombies","%mini.EZM_AllowSoldierZombies","bool",1,0,1,-1,"Rules EZM Mode");

Slayer.Prefs.addPref("EZM","Zombie Kill","%mini.EZM_ZombieKillPoints","int 0 999",1,0,1,-1,"Rules EZM Points");
//Slayer.Prefs.addPref("EZM","Miniboss Kill","%mini.EZM_ZombieMiniBossKillPoints","int 0 999",10,0,1,-1,"Rules EZM Points");
Slayer.Prefs.addPref("EZM","Dealing 1% Boss Damage","%mini.EZM_ZombieBossDamagePoints","int 0 999",1,0,1,-1,"Rules EZM Points");
Slayer.Prefs.addPref("EZM","Boss Kill","%mini.EZM_ZombieBossKillPoints","int 0 999",50,0,1,-1,"Rules EZM Points");
Slayer.Prefs.addPref("EZM","Wave Survival","%mini.EZM_WaveSurvivalPoints","int 0 999",10,0,1,-1,"Rules EZM Points");
Slayer.Prefs.addPref("EZM","Late Join Bonus per Wave","%mini.EZM_LateJoinWavePoints","int 0 999",0,0,1,-1,"Rules EZM Points");



//### Other shizzle

if(!isObject(EZMZombies)) new SimSet(EZMZombies);
if(!isObject(EZMZombieSpawns)) new SimSet(EZMZombieSpawns);

exec("./ai.cs");
exec("./director.cs");
exec("./package.cs");
exec("./zombiedata.cs");
exec("./zombies.cs");
exec("./custom zombie example.cs");

exec("./items/sword.cs");
exec("./items/bow.cs");
exec("./items/gun.cs");
exec("./items/gunsakimbo.cs");
exec("./items/rocketlauncher.cs");
exec("./items/items.cs");
exec("./items/dynamite.cs");
exec("./items/deathwand.cs");
exec("./items/kompressorwand.cs");

ai.cs
Quote
//########## Zombie AI

function AIPlayer::addKills(%this) { return; }
function AIPlayer::incScore(%this) { return; }
function AIPlayer::getTeam(%this) { return -1; }
function AIPlayer::onDeath(%this) { return; }

function AIPlayer::EZM_SetAim(%this,%obj)
{
  if(%this.getState() $= "Dead") return;
  if(!isObject(%obj)) return;
  %o = (%this.intelligence / 100) * VectorDist(%this.getPosition(),%obj.getPosition());
  %this.setAimObject(%obj,getRandom(-%o,%o) SPC getRandom(-%o,%o) SPC getRandom(-%o,%o));
}

function AIPlayer::EZM_Attack(%this)
{
  if(%this.getState() $= "Dead") return;
  %this.setImageTrigger(0,1);
  %this.schedule(50,"setImageTrigger",0,0);
  if(!getRandom(20)) serverPlay3D(EZM_ZombiePainSound,%this.getTransform());
}

function AIPlayer::EZM_Jump(%this)
{
  if(%this.getState() $= "Dead") return;
  %this.setJumping(true);
  %this.schedule(250,"setJumping",false);
  %this.setJetting(true);
  %this.schedule(1500,"setJetting",false);
  if(!getRandom(20)) serverPlay3D(EZM_ZombieJumpSound,%this.getTransform());
}

function AIPlayer::EZM_Crouch(%this)
{
  if(%this.getState() $= "Dead") return;
  %this.setCrouching(true);
  %this.schedule(1000,"setCrouching",false);
}

function AIPlayer::EZM_Strafe(%this)
{
  if(%this.getState() $= "Dead") return;
  if(getRandom(1)) %this.setMoveX(1);
  else
    %this.setMoveX(-1);
  %this.schedule(1000,"setMoveX",0);
}

function AIPlayer::EZM_Wander(%this)
{
  %this.setMoveDestination(VectorAdd(%this.getPosition(),getRandom(-10,10) SPC getRandom(-10,10) SPC 0));
}

function AIPlayer::EZM_CanSeeObject(%this,%obj)
{
  if(%this.getState() $= "Dead") return 0;
  if(!isObject(%obj)) return 0;
  %pos1 = %this.getEyePoint();
  %pos2 = %obj.getPosition();
  %dist = vectorDist(%pos1,%pos2);
  if(getMinigameFromObject(%obj).EZM_ZombieSuperIntelligence) return %dist;
  if(%dist > %this.sightRange) return 0;
  %ray = containerRayCast(%pos1,%pos2,$TypeMasks::FxBrickObjectType,%this);
  if(isObject(%ray)) return 0;
  return %dist;
}

function AIPlayer::EZM_Idle(%this)
{
  if(%this.getState() $= "Dead") return;
  cancel(%this.moveSchedule);
  if(!getRandom(20)) serverPlay3D(EZM_ZombieDeathSound,%this.getTransform());
  if(isObject(%this.getMoveObject())) { %this.clearAim(); %this.setMoveObject(0); }

  if(getMinigameFromObject(%this).EZM_ZombieSuperIntelligence)
  {
    %mini = getMinigameFromObject(%this);
    for(%i=0;%i<%mini.numMembers;%i++)
    {
      if(!isObject(%target = %mini.member[%i].player)) continue;
      %dist = VectorDist(%this.getEyePoint(),%target.getPosition());
      if(%currdist !$= "" && %dist > %currdist) continue;
      if(getMinigameFromObject(%this) != getMinigameFromObject(%target)) continue;
      %currdist = %dist;
      %currobj = %target;
    }
  }
  else
  {
    InitContainerRadiusSearch(%this.getPosition(),%this.sightRange,$TypeMasks::PlayerObjectType);
    for(%i=0;%i<15;%i++)
    {
      %target = containerSearchNext();
      if(!isObject(%target)) continue;
      if(%target == %this) continue;
      if(%target.EZMisZombie) continue;
      if(%target.getState() $= "Dead") continue;
      if(!(%dist = %this.EZM_CanSeeObject(%target))) continue;
      if(%currdist !$= "" && %dist > %currdist) continue;
      if(getMinigameFromObject(%this) != getMinigameFromObject(%target)) continue;
      %currdist = %dist;
      %currobj = %target;
    }
  }
  if(isObject(%currobj)) %this.EZM_Chase(%currobj);
  else
  {
    %this.EZM_Wander();
    %this.moveSchedule = %this.schedule(getRandom(2000,3000),"EZM_Idle");
  }
}

function AIPlayer::EZM_Chase(%this,%obj)
{
  if(%this.getState() $= "Dead") return;
  cancel(%this.moveSchedule);
  if(!isObject(%obj) || %obj.EZMisZombie) { %this.moveSchedule = %this.schedule(2000 - %this.intelligence * 10,"EZM_Idle"); return; }
  if(%obj.getState() $= "Dead") { %this.moveSchedule = %this.schedule(2000 - %this.intelligence * 10,"EZM_Idle"); return; }
  if(!getRandom(20)) serverPlay3D(EZM_ZombieDeathSound,%this.getTransform());
  if(getWord(%this.getPosition(),2) - getWord(%dest,2) < -5) %this.EZM_Jump();
  %ray = containerRayCast(VectorSub(VectorAdd(%this.getPosition(),%this.getForwardVector()),"0 0" SPC getWord(%this.getScale(),2)),VectorAdd(VectorAdd(%this.getPosition(),%this.getForwardVector()),"0 0" SPC getWord(%this.getScale(),2)),$TypeMasks::FxBrickObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType,%this);
  if(isObject(firstWord(%ray)))
  {
    if(getRandom(1)) %this.EZM_Jump();
    else
      %this.EZM_Crouch();
  }
  if(!getRandom(5))
  {
    if(getRandom(1)) %this.EZM_Jump();
    else
      %this.EZM_Crouch();
  }
  if(!getRandom(5)) %this.EZM_Strafe();
  if(VectorDist(%this.getPosition(),%obj.getPosition()) < %this.attackRange) %this.EZM_Attack();
  if(%this.EZM_CanSeeObject(%obj)) { %this.setAimObject(%obj); %this.setMoveObject(%obj); }
  %this.moveSchedule = %this.schedule(2000 - %this.intelligence * 15,"EZM_Chase",%obj);
}

One of the variables on EZM_addBoss() is playersize. Find where that function call is and change "5 5 5" or whatever to "1 1 1" to fix their size.

Weapons are mounted by calling AIPlayer::mountImage with the second variable being 0. Find where those calls are and change them to whatever weapon you want. I recommend downloading an add-on like fists and using that if you want their hands out.

Weapons are mounted by calling AIPlayer::mountImage with the second variable being 0. Find where those calls are and change them to whatever weapon you want. I recommend downloading an add-on like fists and using that if you want their hands out.

Would simply playthread hug work on it?

It would make them hug you, but it wouldn't do any damage.

One of the variables on EZM_addBoss() is playersize. Find where that function call is and change "5 5 5" or whatever to "1 1 1" to fix their size.

Weapons are mounted by calling AIPlayer::mountImage with the second variable being 0. Find where those calls are and change them to whatever weapon you want. I recommend downloading an add-on like fists and using that if you want their hands out.

For the weapons, I tried equipping the zombies with an empty hand model (Like the fists weapon) but it only raises one arm up, not the other. All the bots carrying weapon datablocks tend to slow down my gameplay/fps, I don't have the best computer.

Put this in the weapon you made to raise both hands when one is holding the invisible weapon
Code: [Select]
   function NameOfWeaponImage::onMount(%this,%obj,%slot)
   {
      Parent::onMount(%this,%obj,%slot);
      %obj.playthread(0, armreadyboth);
   }

The gamemode uses a system where it has a list containing every enemy type, their looks (A separate list to allow randomization), their playertype, size, melee weapons, long range weapons, probability to spawn, images that are mounted upon spawning (for example particle effects or hats) and a class that allows players to enable/disable any specified class of enemy. The system provides two functions:

The below functions add a new type of enemy or boss for the gamemode to use.
Code: [Select]
EZM_addZombie(name,namelist,player_datablock,size,list_of_melee_weapons,list_of_ranged_weapons,has_special_wave,spawn_propability,class);
EZM_addBoss(name,namelist,player_datablock,size,list_of_melee_weapons,list_of_ranged_weapons,has_special_wave,spawn_propability,class);
name is simply the name of the enemy.
namelist is not used if I remember correctly. Just to make sure it should be set to the same value as name.
player_datablock is the PlayerData this enemy uses.
size is the enemys size.
list_of_melee_weapons is a string containing the names of melee weapons used. A random one is selected upon spawning.
list_of_ranged_weapons is the same as above, but ranged. Both values can be set to -1 to disable.
has_special_wave allows this enemy to be used in special waves (which occur randomly), in which only this type of enemy will spawn.
spawn_propability is the likelihood of this enemy spawning. I can't remember exactly how it determines that.
class is the name of the enemy class.

To allow players the disabling of enemy classes, one has to add a Slayer hook:
Code: [Select]
Slayer.Prefs.addPref("EZM","Allow Soldier Zombies","%mini.EZM_AllowSoldierZombies","bool",1,0,1,-1,"Rules EZM Mode");
The second value is what shows up in Slayer, the third is the string used in class. The "%mini." must be there or it won't work. Nothing else must be changed there.


This one adds apperances for a specific enemy or boss. Any enemy/boss can have an infinite number of different appearances, from which the gamemode selects a random one when it spawns that enemy.
Code: [Select]
function EZM_addAppearance(name,appearance,hide_nodes,face_decal,chest_decal,mounted_image)
name refers to the enemy name (name in EZM_addZombie).
appearance is a list of nodes and their colors (e.g. "headskin 1 1 1 1 lhand 0 0 0 0.5" sets the enemy head to white and makes the left hand black semitransparent). It must follow the pattern (nodename, red, green, blue, alpha,...) or it won't work. Nodes that are invisible will be turned visible.
hide_nodes is a list of nodes that will be hidden (e.g. "chest lshoe rshoe").
face_decal is the name of the face decal used.
face_decal is the name of the chest decal used.
mounted_image is the ShapeBaseImageData that will be mounted to the enemy when it spawns.



So instead of trying to mod the gamemode so the zombies don't spawn with weapons you could simply change their parameters in zombies.cs so they won't have any weapons. Or add your own weaponless enemies. But that's boring. How about giving them all rapid-fire rocketlaunchers?

And if you want to disable bosses you can just set "Add Boss every X Waves" to 10000. I set the limit for that to 50, but after changing the "int 0 50" to "int 0 10000" at line 27 in basic.cs you can do that.
Code: [Select]
Slayer.Prefs.addPref("EZM","Add Boss every X Waves","%mini.EZM_BossCountInc","int 0 10000",20,0,1,-1,"Rules EZM Mode");