More info needed,
It depends on what kind of path u are trying to make.
If it's a simple walk point to point along a path then no scripting is needed and the whole thing can be done in MohRadiant.
A more complicated Patrol where u want the Ai to stop and wait, include an animation or want to change it's awarness settings etc. requires scripting via a thread.
---- So for a basic AI Patrol -----
As far as the script (.src) is concerned,
For normal AI behaviour such as attack and patrol there are only two basic rules in my expierience.
Your map has to start with - test_
yourmapname
and have following basic script components...
//BASIC AI SCRIPT
main:
exec global/ai.scr
// This activates basic AI behaviour
exec global/loadout.scr maps/test_
yourmapname.scr
level waittill prespawn
level waittill spawn
$player item weapons/colt45.tik // gives player pistol
$player item weapons/springfield.tik // gives player sniper rifle
$player ammo pistol 200 // give player pistol ammo
$player ammo rifle 120 // give player rifle ammo
$player useweaponclass rifle // Player start with Rifle in hand
level.script = "maps/test_
yourmapname.scr" // Level script
end
// END OF SCRIPT
That's all that is needed to make an AI do basic things scriptwise.
The key in the script is
exec global/ai.scr at the start which automatically gives all Ai their abilties.
-------------------------------
To create a patrol path/guy in your map...
Layout your patrol path using
info_waypoints and target them accordingly with the last one targetting the first if you want a loop.
Let's say for this example that the first waypoint targetname here is called ' path1 '
Add your AI model (German or Allies),
if not allready selected then select it and press the ' I ' key. This will bing up the ' AI Parameters ' window.
From the first drop down menu on the top left called
' type_idle' select
'patrol'.
This will change the options on the right, and now an entry box should be visible on the top right called
' patrolpath ' - enter the targetname of your first waypoint here , in this example ' path1 '.
And that's all - u don't even need to add the Ai targetname or target.
Now the guy will walk the path and it works on any AI model whose Key/Value
type_idle is set to
patrol or
runner.
Adding the
Key/Value - patrolpath/waypoint is the magic ingridient here as it tells the
global/ai.scr to run the patrol subroutine.
Anyways, that's the most basic way to get a guy to patrol.
Here is a Pk3 of the example above, map included. I've set hearing and sight to 50 so u can have a real close look but not too close
http://www.eventideimaging.com/aitest.pk3
----------------------------
Hope this makes it clearer, feel free to email me if you need more help. Only too happy to do so
Cheers,
Mirek