Jump to content
  • 0

AI script (java or python)


Question

Posted

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.

4 answers to this question

Recommended Posts

  • 0
Posted

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.

  • 0
Posted

so hardly to understand it (because im russian). sry.

 

please give me a little code example of this script.

  • 0
Posted
so hardly to understand it (because im russian). sry.

 

please give me a little code example of this script.

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

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