Game Development Reference
In-Depth Information
There's more...
It doesn't have to end with that. We can, for example, with some modification trigger the
AI to start walking a path, turn in a certain direction, or take cover and other things. This
functionality can either be built into this class or be made as separate classes.
To explore an example in detail, let's have a look at what will be needed to have the AI
move to a specific location once
AIScriptControl
is triggered.
tificial Intellegence
, explains this. The
SeekCoverState
can easily be modified
to only have a
target
field rather than a list to choose from.
2. We will need something to function as a waypoint or target. Again, the
Cover-
Point
control from the same recipe can function as a waypoint too. It can also be
extended so that using cover at
WayPoint
is an option within the class.
3. Finally, we will need to pass
WayPoint
to the state. Since we're not supplying a
whole class, we can't set it in
AIState
itself. One way would be to pass it
through the
setTarget
method of
AIControl
.