Tutorial Request
Moderator: Moderators
-
vonderbakluft
- Corporal
- Posts: 46
- Joined: Fri Aug 01, 2003 11:15 am
- Location: NL
- Contact:
Example of an AI healing the player (or another AI). You can allmost rip it from the friendly.scr script, with some adustments as done here.
self = the healing one, local.ent = the one to heal
Next some one that heals himself.
self = AI that heals himself
Simply call one of the scripts from at the moment you want
Von
self = the healing one, local.ent = the one to heal
Code: Select all
heal local.ent:
if (isalive local.ent)
{
self.no_idle = 0
self.movedoneradius = 100
self runto local.ent
self waittill movedone
self exec global/stand.scr
if (isalive local.ent)
{
local.vec = vector_length (self.origin - local.ent.origin)
if (local.vec < 140)
{
self nodamage
self.avoidplayer = 0
// self.no_idle = 1
self upperanim pass_canteen_start
self waittill upperanimdone
local.ent heal 0.5
self playsound med_kit
self upperanim pass_canteen_end
self waittill upperanimdone
self.avoidplayer = 1
if (getcvar(alive) != "1")
self takedamage
// self.no_idle = 0
}
}
}
end
Next some one that heals himself.
self = AI that heals himself
Code: Select all
healself:
if !(isAlive self)
end
local.w = randomfloat (5.0)
wait local.w
// Thinkstate killed must here applied to - Von
while ( !(self.thinkstate == "idle") && !(self.thinkstate == "killed") )
waitframe
println "canteen"
self exec global/disable_ai.scr
if !(isAlive self)
end
local.friendtype = self.friendtype
self.friendtype = -1
self holster
wait 1
if !(isAlive self)
end
self lookat NULL
self upperanim pass_canteen_drink
self waittill upperanimdone
if !(isAlive self)
end
self.health = self.maxhealth
self.friendtype = 1
self unholster
self exec global/enable_ai.scr
end
Von
Real mappers map in wordpad 
- silversound
- Second Lieutenant
- Posts: 167
- Joined: Wed Jun 18, 2003 6:33 am
- Location: West Seattle, WA, USA, Earth, Milky Way
-
smartaiguy
- Brigadier General
- Posts: 512
- Joined: Tue Jul 08, 2003 2:52 pm
