Page 1 of 1

Carrying the crate of death....

Posted: Tue Oct 28, 2003 3:42 pm
by Butch
I want to get one of my engineers to carry an explosives crate, here's an adapted version of the movecrate.scr, do I need to implement or change anything else?

Code: Select all

//To activate this:
//
//crateguy1_thread:
//	$crateguy1 waitthread global/movecrate.scr::movecrate crate1_start crate1_end
//	$crateguy1 waitthread global/movecrate.scr::movecrate crate2_start crate2_end
//	$crateguy1 waitthread global/movecrate.scr::movecrate crate3_start crate3_end
//end
//
//$crateguy1 = the guy moving the crate
//crate1_start = the position to pick up the crate
//crate1_end = the position to drop the crate
//
//$crate1_end = the finished crate
//$crate1_start = the crate to pick up
//
//

movecrate local.cratetomove local.cratetomoveto:
	wait 1
	if(self.thinkstate != "idle" && self.thinkstate != "currious")
		end
	if(self.cratebreak == 1)
		end	
	self alarmthread dropthecrate
	if(self.gun == "" || self.gun == NULL || self.gun == NIL || self.gun == "none")
		self gun "colt45"
	waitframe
	self holster
	self type_attack "alarm"
	self type_disguise "none"
	local.o = local.cratetomove gettagposition "pickup"
	self exec global/walkto.scr local.o
	self waittill movedone
	local.o = local.cratetomove gettagposition "box"
	self exec global/turnto.scr local.o
	local.distance = vector_length (self.origin - local.o)
	println "distance to pickup crate '" local.o "' is " local.distance
	if(local.distance > 45 )
	{
		println "crate guy " self.targetname " failed to get to " local.o
		if(self.thinkstate == "curious")
			println "cause of failure: curious"
		self waitthread dropthecrate
		end
	}
	self anim crate_pickup1
	self waittill animdone
	self.hasthecrate = 1
	local.cratetomove hide
	self anim crate_pickup2
	self waittill animdone
	local.o = local.cratetomoveto gettagposition "pickup"
	self exec global/moveto.scr "anim/crate_walk.scr" local.o
	if(self.cratebreak != 1)
	{
		self waittill movedone
		local.o = local.cratetomoveto gettagposition "box"
		local.distance = vector_length (self.origin - local.o)
		println "distance to putdown crate '" local.o "' is " local.distance
		if(local.distance > 45)
     	{
     		println "crate guy " self.targetname " cannot find his way to box drop location at " local.o
     		if(self.thinkstate == "curious")
     			println "cause of failure: curious"
			self waitthread dropthecrate
     		end
     	}
		self exec global/turnto.scr local.o
		self anim crate_putdown1
		self waittill animdone
		wait .05
		local.cratetomoveto show
		self.hasthecrate = 0
		self anim crate_putdown2
		self waittill animdone
	}
end

dropthecrate:
	if(self.cratebreak == 1)
		end
	self.cratebreak = 1
	self exec global/disable_ai.scr
	self turnto NULL
	waitframe
	if(self.hasthecrate == 1)
	{	
		self anim_noclip crate_drop
		wait .2
		self anim crate_detach
	}
	self turnto NULL
	if(self.gun == "" || self.gun == NULL || self.gun == NIL || self.gun == "none")
		self gun "colt45"
	waitframe
	self unholster
	self exec global/enable_ai.scr
end

Posted: Wed Oct 29, 2003 12:14 am
by nuggets
as your calling it the crate of death, i'm guessing your wanting it to explode...?

personally i'd add...

radiusdamage

and spawn an bomb fx

Posted: Wed Oct 29, 2003 7:44 am
by Butch
well, i was going to use the exploder.scr to make it blow up, but what i meant washave i got the targetnames etc correct?

Posted: Wed Oct 29, 2003 10:05 pm
by bdbodger
Does the crate you are going to use have those tags ? Or are you going to make a custom one maybe reskin the cratecarry .