Jump to content
  • 0

AI script (java or python)


sember

Question

translate #1:

 

I need to write the script. (AI)

 

Spawn a mob(#1), => kill this mob(#1), wait 20 seconds and automatically this AI spawn another mob(#2), kill it (#2), wait else 20 seconds and at the same place spawn another mob(#3), and when we kill it, wait 20 seconds and gets(spawn) at the same place the first mob (mob #1) and then everything goes in a circle, and so indefinitely.

 

example:

 

1 mob = Fox

2 mob = Goblin

3 mob = Marsh Zombie

 

not same. different

 

translate #2:

 

spawn fox, if any player kill this fox -> wait 20 sec. -> spawn Goblin on same place (loc) of fox -> if any player kill this Goblin -> spawn Marsh Zombie on same place (loc) of fox and Goblin -> if any player kill this Marsh Zombie -> again wait 20 sec -> spawn fox (first mob)(at this place/loc of mob 1 and mob 2 and 3) - > and everything is repeated, on a circle.

 

spawn loc1 = spawn loc2 = spawn loc3.

 

spawn only occurs when they kill a mob, if not continue to kill the system will wait until they kill a mob that would be another spawn.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

update your topic title, to request.

 

Later edit >.>

 

Hope your not expecting a script xD, heres how you should do it:

 I. Things you'll need: 3 fields - 1 int[3] array containing the spawn point (or just do it dirty), 2 int field witch the last npc id will be incremented, 3 an array with npc ids

II. When you will you use spawn method make sure u increment the npc id to the "last used npc field".

III. To restart the procedure, check if the last npc id of the npcId array is also the last incremented npcid, set the "last used npc field" to the first entry of the npcid array.

IV. Create a runnable task for the spawning procedure, also you could set the runnable's constructor handle the next npc parsing.

 

Hope it helps, cheers.

Link to comment
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
Answer this question...

×   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.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock