Carrying the crate of death....

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Butch
Lieutenant Colonel
Posts: 398
Joined: Fri Jan 24, 2003 11:30 am

Carrying the crate of death....

Post 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
PFC.Butch
B Company, 2nd Ranger Battalion
US Army
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Butch
Lieutenant Colonel
Posts: 398
Joined: Fri Jan 24, 2003 11:30 am

Post 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?
PFC.Butch
B Company, 2nd Ranger Battalion
US Army
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Post Reply