SP Ai's, They don't follow player!

Please use this forum to ask all your MoHAA Bots questions / discussions

Moderator: Moderators

Post Reply
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

SP Ai's, They don't follow player!

Post by |NSC|-Steelie-NS*LR* »

Hi guys, I did the tut. on .Map but they don't follow me. here's my script:


main:
exec global/ai.scr
exec global/loadout.scr maps/bankrobinsp.scr
exec gloal/friendly.scr

level waittill prespawn



level waittill spawn

$player item weapons/colt45.tik
level.script = "maps/bankrobinsp.scr"
thread badguy1move // calls badguy1move thread



exec global/auto.scr

level waittill prespawn
level waittill spawn

//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
waitthread InitFriends
waitthread InitObjectives

waitthread InitPlayer


//---------------------------------------------------------------------------
InitPlayer:
//---------------------------------------------------------------------------
// setup our player with weapons
// This gives the player the default weapons that they will start the
// level with.


$player takeall
$player item weapons/Webley_Revolver.tik
$player item weapons/enfield.tik
$player item weapons/sten.tik
$player item weapons/mills_grenade.tik
$player item weapons/M18_smoke_grenade.tik

// give him some ammo
$player ammo pistol 32
$player ammo smg 128
$player ammo rifle 50
$player ammo smokegrenade 3
$player ammo grenade 3

// start out using the smg
$player useweaponclass smg

// give him binoculars and the explosive icon...
$player item items/binoculars.tik

// These two lines add the binoculars and explosive image to the
// top right of the HUD
waitthread global/items.scr::add_item "binoculars" noprint
// Show binoculars inventory icon
waitthread global/items.scr::add_item "explosive" noprint
// Show explosive inventory icon



//---------------------------------------------------------------------------
InitFriends:
//
// Setup our friendlies to wait until the player shows up...
//---------------------------------------------------------------------------

// rename our friendlies to something more "friendly"
level.friendly1.targetname = Mr.1
level.friendly2.targetname = Mr.2
level.friendly3.targetname = Mr.3

thread FriendWait



//---------------------------------------------------------------------------
FriendWait:
//
// wait for player to hit our trigger..
//
//---------------------------------------------------------------------------
$friend_trigger waittill trigger

// objective was accomplished, check it off...
waitthread global/objectives.scr::add_objectives 1 3

// set objective #2 as current...
waitthread global/objectives.scr::add_objectives 2 2
waitthread global/objectives.scr::current_objectives 2

// show our throbbing box now. (don't need this just yet)
// $ThrobbingBox show

// Have some sample dialog with the player.
$Mr.1 turnto $player
$Mr.1 lookat $player
wait 0.2
$Mr.1 anim 11b100_BritCaptGreet
$Mr.1 waittill animdone

$Mr.1 anim 12C105_Dialogue03
$Mr.1 waittill animdone

$Mr.1 turnto NULL
$Mr.1 lookat NULL

// Tells the AI to move to the player
$Mr.1.destination = $player
$Mr.2.destination = $player
$Mr.3.destination = $player

// Sets the type of friendly soldier
$Mr.1.friendtype = 1
$Mr.2.friendtype = 1
$Mr.3.friendtype = 1

// stagger how far away they keep from their destinations
$Mr.1.distance = 175
$Mr.2.distance = 225
$Mr Pastatje.distance = 250

// setup the friendlies to follow the player...
$Mr.1 thread global/friendly.scr::friendlythink
$Mr.2 thread global/friendly.scr::friendlythink
$Mr.3 thread global/friendly.scr::friendlythink

end



Can anyone help me?

Greetz Steelie
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Put exec global/friendly.scr below level waittill prespawn... also I don't think you can have dots (.) in targetnames.
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

and you have no ends in the thread :lol: it's all one huge thread... put an "end" before each word that ends with : like this.


waitthread InitFriends
waitthread InitObjectives

waitthread InitPlayer

end
//---------------------------------------------------------------------------
InitPlayer:
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply