Page 1 of 1

German ai patrol tutorial-HELP-he doesn't move.....

Posted: Sat Aug 10, 2002 3:57 am
by Jesusiscoming203

I can't get the german to move by the script ai tutorial. he was there, but nothing happened.
i had a .scr file in the maps dir in MOHAA folder, but still didn't work.
path and patrol was set........

help.

Posted: Sat Aug 10, 2002 5:20 pm
by Wombat
which script ai tutorial..

i have a patrol tutorial, on

The mapping domain.

Was it this one? or another?

Posted: Mon Aug 12, 2002 6:09 pm
by Wombat
copy the models/human/new_generic_human.tik file from the patrol.pk3 file into your mohaa/main/ folder

Should work then

have you set the ai

$patrolguy exec global/enable_ai.scr

before the waittill prespawn command

Posted: Wed Aug 14, 2002 7:54 am
by Jesusiscoming203
I have done everything.
I even downloaded the files off mappingdomain's site (thanks to Wombat for the good tuts) and placed them accordingly in the MOHAA/main/ dirs.
any ideas, the german won't move.............
Can you tell me where to place all those files please Wombat so i can doublecheck i got the placement right.
apart from that, you got any ideas?
entdefs placed in mohaa dir, ai is in scr file...............
what can i do?

Posted: Tue Aug 27, 2002 2:57 pm
by Jesusiscoming203
I started naming my files 'test_' when I realised my sound didn't work-I couldn't hear a thing!!! (I was checking my headphones!!!)
I got that fixed, but this one has me stumped! At least until I go through an utter thorough problem solving procedure, which might take a while! I placed a file Wombat made called new_generic_human.tik in the mohaa/mainmodels/human/ directory. So far I think I have everything right. The AI now shoots at me (with a globalai script) and moves to shoot (animated?-I guess). They didn't do this before I knew the 'globalai' script mechanism. Now, maybe it is the 'patrol' issue that I have to work on.
I'll try renaming Wombat's file to test_patrol and see if that works. If anyone has any ideas or anything they knew that worked for them please post everything you know/did!! Thankyou!

Hey, Why is Wombat's site not working?

Posted: Tue Aug 27, 2002 5:52 pm
by Jesusiscoming203
I finally got patrol guys working.
This is how I did it.
I am still figuring it out, but with the help of a download of PMH I was able to get them moving!!!!
I had set up pathnodes and i think a thread was in the script for 'thread badguy1move'. Do you think this is helping, the thread in the script?

Posted: Thu Aug 29, 2002 5:20 am
by Mirek
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 :D

Cheers,
Mirek