Jump to content
Aro2220

Spawn a Zombie

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 :(

Share this post


Link to post
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!!!

Share this post


Link to post
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.

Share this post


Link to post
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

 

And how would one create a virtual zombie?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

What's not forceFakeDead? I'm guessing it makes them lie down until they notice the player, right? That sounds really awesome. 

 

Right, I looked at the Javadocs and found two variables. fake dead and force fake dead. What's the difference?

 

It makes them into crawlers.  :cry:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...