Page 1 of 1

He Heals! He finally heals!

Posted: Sat May 24, 2003 8:29 pm
by Alcoholic
My medic finally heals! Here is how i made him heal...

(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
	end
4. for medicstart thread put this.

Code: Select all

medicstart:

	self.avoidplayer = 1
	
	self.friendtype = 5
	self thread global/friendly.scr::friendlythink
	
	self waittill death
	end
then 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

Posted: Sat May 24, 2003 8:56 pm
by jv_map
:wink:

Posted: Sun May 25, 2003 5:27 am
by mohaa_rox
good job!

Posted: Mon May 26, 2003 2:39 am
by Alcoholic
since its a problem for some people having non healing medics, maybe you could make this a short tut for people having probs with their medics. :D

Posted: Mon May 26, 2003 8:02 am
by small_sumo
Hey Alcoholic if you send me a pk3 example of this I will place it on my site as a tut.

Tut by Alcoholic.

:)

Posted: Mon May 26, 2003 8:05 am
by Alcoholic
cool ill make one as soon as i can

Posted: Mon May 26, 2003 8:06 am
by Trinculo
is it possible to impliment this into a mp map?

Posted: Mon May 26, 2003 9:01 am
by Alcoholic
never worked with mp it might work though

i finished the .pk3 file

the map in it is actually a map i never finished. i had some nifty stuff in there...

just run to the nazis and get all shot up and the medic will heal you.

sometimes one of your teammates will get wounded enough for the medic to come but the airbones usually clear out the nazis before then.

Posted: Mon May 26, 2003 2:44 pm
by small_sumo
I'm ready when you are Corporal Alcoholic.

:)

Posted: Mon May 26, 2003 4:09 pm
by Trinculo
would love to see this implemented into a mp script :) like randomly select a player on each team and turn him into the medic for the team?

does that sound possible or am i dreaming?

Posted: Mon May 26, 2003 5:14 pm
by jv_map
The friendly script will go nuts if there's more than one player I think :?

Posted: Mon May 26, 2003 7:36 pm
by Alcoholic
hmm i dont knwo maybe if you selected a randomint and modified a weapon so it was a medkit... it might work

Posted: Mon May 26, 2003 7:36 pm
by Alcoholic
whats ur email small sumo

Posted: Tue May 27, 2003 2:16 am
by small_sumo
small_sumo34@hotmail.com , if what your sending me is too big for hotmail just drop me a line and I will mail you my proper address.

Thanks mate