bots follow ai script problem
Moderator: Moderators
-
sk8infreak896
- Private
- Posts: 6
- Joined: Tue Nov 25, 2008 4:45 am
bots follow ai script problem
hi, i used this script to make an ai follow me and whenever the enemy ai goes to shoot the mission always crashes and goes back to the main menu. Heres the script i used:
exec global/auto.scr
level waittill prespawn
exec global/friendly.scr
level waittill spawn
//---------------------------------------------------------------------------
main:
//---------------------------------------------------------------------------
// Tells the AI to move to the player
$F1.destination = $player
$F2.destination = $player
$F3.destination = $player
// Sets the type of friendly soldier
$F1.friendtype = 1
$F2.friendtype = 1
$F3.friendtype = 1
// stagger how far away they keep from their destinations
$F1.distance = 175
$F2.distance = 225
$F3.distance = 250
// setup the friendlies to follow the player...
$F1 thread global/friendly.scr::friendlythink
$F2 thread global/friendly.scr::friendlythink
$F3 thread global/friendly.scr::friendlythink
end
can someone please help.
exec global/auto.scr
level waittill prespawn
exec global/friendly.scr
level waittill spawn
//---------------------------------------------------------------------------
main:
//---------------------------------------------------------------------------
// Tells the AI to move to the player
$F1.destination = $player
$F2.destination = $player
$F3.destination = $player
// Sets the type of friendly soldier
$F1.friendtype = 1
$F2.friendtype = 1
$F3.friendtype = 1
// stagger how far away they keep from their destinations
$F1.distance = 175
$F2.distance = 225
$F3.distance = 250
// setup the friendlies to follow the player...
$F1 thread global/friendly.scr::friendlythink
$F2 thread global/friendly.scr::friendlythink
$F3 thread global/friendly.scr::friendlythink
end
can someone please help.
-
sk8infreak896
- Private
- Posts: 6
- Joined: Tue Nov 25, 2008 4:45 am
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
I guess there's a bug in Mackey's script... I would check it out but that script is very big, it would take a while.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
sk8infreak896
- Private
- Posts: 6
- Joined: Tue Nov 25, 2008 4:45 am
Targetname friendly? Its no needed... just give them some parms and thread the script... it work for me... maybe u need to add .tether parm? Or smth else... idk... and i cant show you mine script because its on other computer =)jv_map wrote:Oh I think you should give them targetname 'friendly' (not F1, F2, ...), then use their #fnum to access them as level.friendly1, level.friendly2 etc. A bit dodgy but that's how that script was written.
-
sk8infreak896
- Private
- Posts: 6
- Joined: Tue Nov 25, 2008 4:45 am
Friendlies work for me without any fnums and level.friendlies99999 etc, try this:
where self is friend, and local.player is.... player! It should work at all, but im not sure because there's probably small difference between mine friendly.scr and yours....
Code: Select all
friendof local.player:
self.accuracy = 20
self.mindist = 128
self.maxdist = 4000
self.leash = 640
self tether local.player
self.sight = 4000
self.noticescale = 1
self.waittime = 0.1
self thread global/friendly.scr::friendlythink
self.friendtype = 1
self.destination = local.player
self.distance = 192
end
-
sk8infreak896
- Private
- Posts: 6
- Joined: Tue Nov 25, 2008 4:45 am
