Jump to content

Spawn a Zombie


Aro2220

Recommended Posts

Shot answer.... Yes :)

getVirtualZombieManager():createRealZombieNow(GridX, GridY, GridZ)

While I haven't actually implemented spawning zombies from NecroForge YET, I use it to spawn 360 Zombies in a circle around the player if "the button" is pressed :P

 

If you want to experiment with it try:

X = getPlayer():getX();Y = getPlayer():getY();Z = getPlayer():getZ();ZeD = getVirtualZombieManager():createRealZombieNow(X + 2, Y, Z)

Though that will have an error if that square is occupied

 

EDIT:

Sorry about my late reply but I've had some filesystem corruption on my operating drive & had to clear ALL of IntelliJ's data & re-install it before I could double check the syntax I used :(

Link to comment
Share on other sites

Shot answer.... Yes :)

getVirtualZombieManager():createRealZombieNow(GridX, GridY, GridZ)

While I haven't actually implemented spawning zombies from NecroForge YET, I use it to spawn 360 Zombies in a circle around the player if "the button" is pressed :P

 

If you want to experiment with it try:

X = getPlayer():getX();Y = getPlayer():getY();Z = getPlayer():getZ();ZeD = getVirtualZombieManager():createRealZombieNow(X + 2, Y, Z)

Though that will have an error if that square is occupied

You just answered a question I had on another post regarding the co-ordinates. THANK YOU!!!

Link to comment
Share on other sites

 

You just answered a question I had on another post regarding the co-ordinates. THANK YOU!!!

 

As long as the co-ordinates are in the currently loaded cell, it will work fine.... Otherwise you will need to create a virtual zombie

 

I just needed to know how to get co-ordinates for changing the spawn point on our server.

Link to comment
Share on other sites

  • 3 weeks later...

aye... it appears your right

 

from VirtualZombieManager.class

  public void createHordeFromTo(float x, float y, float x2, float y2)  {    VirtualZombie z = new VirtualZombie();    z.targx = (int)x2;    z.targy = (int)y2;    z.x = x;    z.y = y;    z.doneMergeAttempt = true;    z.Count = (200 + Rand.Next(80));    this.virtualZombies.add(z);  }  public void createHordeFromTo(float x, float y, float x2, float y2, int count)  {    VirtualZombie z = new VirtualZombie();    z.targx = (int)x2;    z.targy = (int)y2;    z.x = x;    z.y = y;    z.doneMergeAttempt = true;    z.Count = count;    this.virtualZombies.add(z);  }

However addZombiesToMap() adds them randomly to the chunk

 

I would suggest

function duplicateFunction(zombie)   X = zombie:getX();   Y = zombie:getY();   Z = zombie:getZ();   getVirtualZombieManager():createHordeFromTo(X, Y, X, Y, 2);end

untested :)

 

Note, I only used Zed = in my example because, when I was using createRealZombieNow() in NecroForge, I wanted to set them as not forceFakeDead & make them talk in a different function

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...