Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: AI code generator
PostPosted: Fri May 09, 2014 4:15 pm 
Site Admin
Joined: Sun Aug 12, 2007 2:06 pm
Posts: 167
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


Profile  Offline
 
 Post subject: Re: AI code generator
PostPosted: Fri May 09, 2014 4:57 pm 
Joined: Sun Dec 28, 2008 11:27 am
Posts: 223
Well....this is rather unexpected. Thanks.


Profile E-mail Offline
 
 Post subject: Re: AI code generator
PostPosted: Mon May 12, 2014 10:40 am 
Site Admin
Joined: Sun Aug 12, 2007 2:06 pm
Posts: 167
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.


Profile  Offline
 
 Post subject: Re: AI code generator
PostPosted: Fri Oct 17, 2014 5:55 am 
Joined: Wed Oct 15, 2014 11:55 am
Posts: 14
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


Profile E-mail Offline
 
 Post subject: Re: AI code generator
PostPosted: Thu Apr 16, 2015 4:08 pm 
Site Admin
Joined: Sun Aug 12, 2007 2:06 pm
Posts: 167
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 :)


Profile  Offline
 

Display posts from previous:  Sort by  

Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests

Panel

Top You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Dizayn Ercan K.
Updated by phpBBservice.nl