Jump to content

ToastedFishSandwich

Member
  • Posts

    333
  • Joined

  • Last visited

Posts posted by ToastedFishSandwich

  1. function duplicateFunction(this)   X = this:getx();   Y = this:gety();   Z = this:getz();   ZeD = getVirtualZombieManager():createRealZombieNow(X, Y, Z);endEvents.OnZombieDead.Add(duplicateFunction);

    Any idea why this doesn't work?

  2. http://theindiestone.com/forums/index.php/topic/6699-spawn-a-zombie/?p=87349

     

    IIRC the OnZombieDead event gives you the original zombie as a paramter, so you could use its coordinates to spawn the new ones (with a slight offset of course).

     

    Thanks!

     

    This is what I have now, is it along the right sort of lines?

    function duplicateFunction(zombie)   X = zombie:getX();   Y = zombie:getY();   Z = zombie:getZ();   zed1 = getVirtualZombieManager():createRealZombieNow(X, Y, Z);   zed2 = getVirtualZombieManager():createRealZombieNow(X, Y, Z);endEvents.OnZombieDead.Add(duplicateFunction);

    New question, if that's okay, how could I add a random delay as in you kill the zombie, the game continues as normal for between 10 and 30 seconds and then the zombies spawn? Is there some kind of delay function and random function, do I use random function from Lua or from Java?

     

    Edit: I just realised that the spawn a zombie thing was on the front page. I'm going to assume that it was there the whole time and I'm a complete idiot. Hur dur.

  3. Hi all. I've just started making a mod in which killing a zombie will spawn two zombies. Unfortunately I don't know how to spawn even a single zombie. So far literally all I've got is:

     

    function duplicateFunction(player,item)
       zombie.scripting.commands.World.SpawnZombie();
       zombie.scripting.commands.World.SpawnZombie();

    end

    Events.OnZombieDead.Add(duplicateFunction);

     

    Edit: I was searching through the JavaDocs and I found the bold parts, are they right? How do I tell the game where to put them?

     

    I've got pretty much no prior knowledge of modding or, indeed, lua so please don't overcomplicate things. I basically just need some kind of function to spawn a zombie and I guess I'll need to find the position of the original re-dead'd zombie. Halp pls.

  4. The animation work is actually done, there just isn't any point in including it right now. It will probably arrive at the same time as NPCs so when they're hanging around the safehouse they aren't standing there staring at walls.

  5. Police officers might be more likely to spawn in or near a police station, and they will often "good" but the apocalypse changes people, so I'm sure some of them would just go crazy and start shooting people.

×
×
  • Create New...