Help with States and Ai :)
thatoneguy117
Member Posts: 31
Hey guys, this is an update of this thread: http://gamesalad.com/forums/topic.php?id=9939&replies=24#post-72531
(I started this new thread because I think the title of the old one put some people off and I really need help )
Problem:
Sorry, what I mean is I need it to change based off a set of commands I.E.
When attribute is above 240 change to state 1
When attribute is below 240 change to state 2
Etc.
The thing is I need it to be able to run the commands multiple times without having to change the attribute.
CodeMonkey Helped me with this and almost got it working.
I got it so it would change to state 0 and reload back to the other ones and this worked GREAT.
One problem though after the object that is chasing (state 1) change x and y coordinates via change attribute it no longer worked. So I need something that takes this into consideration with the other commands also, Thanks.
Here are some graphics of the problem:
Thanks again for the help I really appreciate it.
EDIT: Just realized the images came out kinda small, might need to zoom. Sorry
(I started this new thread because I think the title of the old one put some people off and I really need help )
Problem:
Sorry, what I mean is I need it to change based off a set of commands I.E.
When attribute is above 240 change to state 1
When attribute is below 240 change to state 2
Etc.
The thing is I need it to be able to run the commands multiple times without having to change the attribute.
CodeMonkey Helped me with this and almost got it working.
I got it so it would change to state 0 and reload back to the other ones and this worked GREAT.
One problem though after the object that is chasing (state 1) change x and y coordinates via change attribute it no longer worked. So I need something that takes this into consideration with the other commands also, Thanks.
Here are some graphics of the problem:
Thanks again for the help I really appreciate it.
EDIT: Just realized the images came out kinda small, might need to zoom. Sorry
Comments
Anybody? I could really use some help. I've been working on this for weeks.
Maybe a better description of what the gamer should experience when this AI system is working. In other words, what is the desired out come from the player's view point. I ask this because so far I have not been able to understand your descriptions that are from the developer's viewpoint.
Im creating a simple Ai, basically air hockey..
When its above 240 it activates a state, when its below 240 it also activates a state.
The problem is it doesn't play the commands multiple times.
When attribute is above 240 change state to 1
When state = 1 move to bankety blank.
The problem is it will only do this ONCE unless you change the state by making it go under 240. When it goes under 240 it changes to state 2. When it goes above 240 it will go back to state 2 and then it will work ONCE. This is the problem.
EDIT: If theres is better way to build a AI PLEASE let me know.
hmm... I'll think on it.
List of air hockey demos
For example, eaguirre uploaded Tutorial: AI for Hockey recently. You can download the project, open it up, and see how he did it.
state1 < 240 state? <state2
Second, you need a timer to told the actor keep checking,
if you can, you better use only one timer to active all the actor.
when attribute is > 240
set state1 to true
set state2 to false
otherwise
set state2 to true
set state1 to false
if state1 is true
every X seconds
do myRoutine1
if state2 is true
every x seconds
do myRoutine2