Hi everyone,
I created a quick python script to help generate AI code for your levels. It's not fully functional, but I'm hoping it one day will be. I put up the source code on GitHub, so that perhaps others will contribute and expand it!
As an example of how to use it, I've included the AI code and raw parts list of my level, "Checkers", in checkersLevel-aiCode.py and checkersLevel-parts.txt.
Just run "python checkersLevel-aiCode.py"
It would be awesome if others would add to it!
Go to the GitHub repository now.
Cheers,
~MD
AI code generator
Re: AI code generator
Well....this is rather unexpected. Thanks.
Re: AI code generator
Yup! I wrote it over a year ago, and figured since I probably won't have time to polish it and make better I may as well just post it as-is and see if someone finds it useful.
~MD
p.s. I'll move this thread to Editor Help - just realized I posted this in the wrong section.
~MD
p.s. I'll move this thread to Editor Help - just realized I posted this in the wrong section.
Re: AI code generator
MD I Cant understand how u make the rocket make explode..can u write me he code here ?
i checked the Github code i didnt understand it..same as machine guns
i checked the Github code i didnt understand it..same as machine guns
Re: AI code generator
The "exploding" rocket consists of two parts:
1. The body of the rocket moves linearly away from its parent object (the mothership), then disappears by moving off screen (distance = 9999).
(see macro_linearMove in zfai.py)
2. At the same time that the rocket disappears, a timer is set to do the following 3 things:
- enable the singularity guns (which cause the "explosion" - the guns themselves are hidden).
- set each gun's timer to play the firing sequence ("explode")
- then disable the singularity guns (until it's enabled again in the next explosion)
(see macro_singularityFire in zfai.py)
Also, you can try out the level within the level editor yourself by:
- copying the part list from checkersLevel-parts.txt into the "text edit" window
- execute checkersLevel-aiCode.py using the typical Python command:
> python checkersLevel-aiCode.py
which will generate a long list of text, which are AI commands - copy these into the AI code window in the editor.
- now run the level, and tinker with it as much as you like
1. The body of the rocket moves linearly away from its parent object (the mothership), then disappears by moving off screen (distance = 9999).
(see macro_linearMove in zfai.py)
2. At the same time that the rocket disappears, a timer is set to do the following 3 things:
- enable the singularity guns (which cause the "explosion" - the guns themselves are hidden).
- set each gun's timer to play the firing sequence ("explode")
- then disable the singularity guns (until it's enabled again in the next explosion)
(see macro_singularityFire in zfai.py)
Also, you can try out the level within the level editor yourself by:
- copying the part list from checkersLevel-parts.txt into the "text edit" window
- execute checkersLevel-aiCode.py using the typical Python command:
> python checkersLevel-aiCode.py
which will generate a long list of text, which are AI commands - copy these into the AI code window in the editor.
- now run the level, and tinker with it as much as you like
Re: AI code generator
I have updated this library. Go to https://github.com/skylogic004/zetaflow-levels to check it out.