by date
Gotta love scripts...
Gotta love scripts...
| Name: | Scott Coursey | |
|---|---|---|
| Date Posted: | Dec 17, 2006 | |
| Rating: | Not Rated | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Scott Coursey |
Blog post
I'm working on the AI components of my game right now. It's in the early phases, so there's plenty of work to be done. I've made a few false starts on it and decided to take a step back and model the AI's behavior so I could visualize it better.
Since I'm a Mac user, the most logical choice (for me) was to use OmniGraffle. I already had the tool and was familiar with it. So, off I went to design the thought process.
The diagram soon became quite large and the idea of turning it back into code was daunting, to say the least. I looked at the data file from Graffle and saw that it was XML. Cool.
So, after a while of putting some script together, I was able to translate this:

into skeletal TorqueScript. Very cool indeed. It not only writes the main if/then/else blocks, but includes the function stubs so I can fill those out later. Like I said, there's LOTS to do, but this is a great start.
Now, if I just change a part of the model, I can re-extract the code from it and have the TScript re-written.
Since I'm a Mac user, the most logical choice (for me) was to use OmniGraffle. I already had the tool and was familiar with it. So, off I went to design the thought process.
The diagram soon became quite large and the idea of turning it back into code was daunting, to say the least. I looked at the data file from Graffle and saw that it was XML. Cool.
So, after a while of putting some script together, I was able to translate this:

into skeletal TorqueScript. Very cool indeed. It not only writes the main if/then/else blocks, but includes the function stubs so I can fill those out later. Like I said, there's LOTS to do, but this is a great start.
Now, if I just change a part of the model, I can re-extract the code from it and have the TScript re-written.
Recent Blog Posts
| List: | 01/24/07 - Claude gets a makeover 12/30/06 - Finally, I can beat my game! 12/24/06 - My AI is so frustrating 12/22/06 - Progress on strategy AI... 12/17/06 - Gotta love scripts... 12/12/06 - My brain hurts... 11/29/06 - Raiders of Leeros pre-beta DEMO 11/26/06 - Filtered Movement Maps Done |
|---|
Submit your own resources!| Richard_H (Dec 17, 2006 at 17:10 GMT) |
| Tom Eastman (Eastbeast314) (Dec 17, 2006 at 17:40 GMT) |
| Scott Coursey (Dec 17, 2006 at 17:47 GMT) |
Everything I have is extremely fast, so there's tons of features I can add. And, I have yet to move away from Torque Script. So far, everything runs with the stock TGB binaries with no problems at all.
| Don Hogan (Dec 17, 2006 at 18:14 GMT) |
| Scott Coursey (Dec 17, 2006 at 19:57 GMT) |
So far, the script (written in TCL) is 337 lines, and there's several more features I need to add.
| Bob (Dec 18, 2006 at 06:39 GMT) |
My email address is in my profile page.
| Allyn "Mr_Bloodworth" Mcelrath (Dec 18, 2006 at 16:25 GMT) |
| Scott Coursey (Dec 18, 2006 at 16:53 GMT) |
You must be a member and be logged in to either append comments or rate this resource.


Not Rated


