(Note: it may not be the best way, and somethings might have nothing to do with it, but it works and thats all i care about.)
1. after "level waittill spawn" put "level.medic waitthread global/friendly.scr::heal $player"
2. somewhere after that put "thread medicsetup"
3. for medicsetup thread put this.
Code: Select all
medicsetup:
if (isalive level.medic)
level.medic thread medicstart
end4. for medicstart thread put this.
Code: Select all
medicstart:
self.avoidplayer = 1
self.friendtype = 5
self thread global/friendly.scr::friendlythink
self waittill death
endthen poof your medic should be a lean mean healin machine.
p.s. this assumes your medic has an alias of "level.medic"
i just looked at the basic format for the medic in m5l1b and this is what it was like. a thread in a thread and that thread had self waittill death after it. you may not need it but it was there so i used it and it worked.
also, jv_map: i used that script you helped me make for when the soldiers follow the leader. i tweaked it a bit and it works great! the way it's setup now, they will run to the leader, but they'll stop before they get close enough to merge into him. when they merge into him, he doesnt advance, and hes on major grillo behaviour, but thats all fixed now! thanks!
heres my script if you wanted to see what it looks like now...
Code: Select all
main:
level waittill prespawn
exec global/ai.scr
exec global/friendly.scr
exec global/loadout.scr maps/test_alliedraid.scr
level.captain = level.friendly1
level.medic = level.friendly5 //HE HEALS! YES!!!!!!
level.script = maps/test_alliedraid.scr
level waittill spawn
$player item weapons/bar.tik
$player item weapons/colt45.tik
$player ammo mg 200
$player ammo pistol 70
$player useweaponclass mg
$player item weapons/m2frag_grenade.tik
$player ammo grenade 4
level.medic waitthread global/friendly.scr::heal $player
level.friendly2 thread friendly2followleader
level.friendly3 thread friendly3followleader
level.friendly4 thread friendly4followleader
//Threads
thread friendlysetup
thread medicsetup
thread germansfound
end
germansfound:
level.captain say dfr_sighted_01e_1 //GERMANS!
level.captain waittill saydone
wait 1
level.captain say actor_M1L1_102 //cmon get moving! go! go!
end
friendly2followleader:
while (isalive level.friendly2)
{
if (isalive level.captain)
{
if (vector_within level.friendly2.origin level.captain.origin 256 == 0)
{
self runto level.captain
wait 1
}
else
self runto NULL
}
else
{
self runto NULL
break
}
waitframe
}
end
friendly3followleader:
while (isalive level.friendly3)
{
if (isalive level.captain)
{
if (vector_within level.friendly3.origin level.captain.origin 256 == 0)
{
self runto level.captain
wait 1
}
else
self runto NULL
}
else
{
self runto NULL
break
}
waitframe
}
end
friendly4followleader:
while (isalive level.friendly4)
{
if (isalive level.captain)
{
if (vector_within level.friendly4.origin level.captain.origin 256 == 0)
{
self runto level.captain
wait 1
}
else
self runto NULL
}
else
{
self runto NULL
break
}
waitframe
}
end
friendlysetup:
level.captain thread global/friendly.scr::friendlythink
level.friendly2 thread global/friendly.scr::friendlythink
level.friendly3 thread global/friendly.scr::friendlythink
level.friendly4 thread global/friendly.scr::friendlythink
level.captain.friendtype = 4
level.friendly2.friendtype = -1
level.friendly3.friendtype = -1
level.friendly4.friendtype = -1
level.captain.avoidplayer = 1
level.friendly2.avoidplayer = 1
level.friendly3.avoidplayer = 1
level.friendly4.avoidplayer = 1
level.captain.health = 1000
level.friendly2.health = 1000
level.friendly3.health = 1000
level.friendly4.health = 1000
level.medic.health = 1000
level.friendly2.interval = 64
level.friendly3.interval = 64
level.friendly4.interval = 64
level.captain thread deathleader
level.friendly2 thread deathfriend2
level.friendly3 thread deathfriend3
level.friendly4 thread deathfriend4
level.medic thread deathmedic
end
medicsetup:
if (isalive level.medic)
level.medic thread medicstart
end
deathleader:
self waittill death
iprintlnbold_noloc "Captain Smith has been killed in action. You are the new leader."
thread newleader
end
deathfriend2:
self waittill death
iprintlnbold_noloc "Private Duncan has been killed in action."
end
deathfriend3:
self waittill death
iprintlnbold_noloc "Private Jordan has been killed in action."
end
deathfriend4:
self waittill death
iprintlnbold_noloc "Sharpshooter Jones has been killed in action."
end
deathmedic:
self waittill death
iprintlnbold_noloc "Medic Henry has been killed in action."
end
newleader:
iprintlnbold_noloc "The Captain has died. You are the new leader."
thread newleadersetup
end
medicstart:
self.avoidplayer = 1
self.friendtype = 5
self thread global/friendly.scr::friendlythink
self waittill death
end
newleadersetup:
level.friendly2.friendtype = 0
level.friendly3.friendtype = 0
level.friendly4.friendtype = 0
level.friendly2.mins = -128
level.friendly2.maxs = -512
level.friendly3.mins = -128
level.friendly3.maxs = -512
level.friendly4.mins = -128
level.friendly4.maxs = -512
end