German Workers

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

German Workers

Post by Axion »

While playing single player I've seen german workers perfoming various tasks like welding, carrying crates, and wrenching. I've taken a look at the global .scrs for these actions, but my feeble brain can't seem to figure out what to do.

If anyone could explain to me in simple, step-by-step instructions how to do any of these, I'd be very grateful, because I'm at a loss at how to even begin.
"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

look at the scripts for those levels, i believe the tank level where you need to blow up tanks and clip wires etc has all these. if not, i KNOW that Trondheim one, m2l3 (?) does.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post by Axion »

I've looked, and I still don't understand how to define the spots for the ai to look at and for where the action in question is to be performed. As taken from the script for m1l2b-

Code: Select all


wrenchguy1_thread:
	while(isalive $wrenchguy1)
	{
		$wrenchguy1 waitthread global/wrenching.scr::wrench wrench1spot1 wrench1look1
	}
end
Is wrenchspot1 a script origin with the same targetname that is used through the script to tell the ai where to act? What about wrench1look1?

It would be nice if someone could answer these questions for me....

:|
Last edited by Axion on Tue Feb 08, 2005 3:59 am, edited 1 time in total.
"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

likely

Post by tltrude »

Seems likely that they are script origins. One tells him what spot to stand on and the other tells him where to look while wrenching.
Tom Trude,

Image
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

Small_Sumo created a SP map entitled Busy Tutorial. It has the .bsp .map and .scr in it. The map shows you how to create AI activities such as patrol, welding, auto repair, eating, card game, sledgehammer, scientists, and moving crates. I can't find a link as he sent it to me direct.

Small_Sumo, if you see this post, can you send this gentlemen your tutorial?
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post by Axion »

Oh, man. That would be awesome. Thanks!
"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Success!

Post by Axion »

I have successfully added a welder and a wrencher to my map. Here is how I did it:

For the welder, I added a german ai (german --> misc --> worker) and gave him a targetname of welderguy1. I then added the following parts to my script:

Code: Select all

 

level waittill spawn

thread workers

     $welderguy1 gun "walter p38"
     $welderguy1 holster

end

////////////////////////////////////////////////////////////////
//** German Workers
///////////////////////////////////////////////////////////////

workers:

$welderguy1 thread welding

end

//////////////////
welding:
/////////////////

self forceactivate
	self thread welderdeath
	self.health = 1
	self exec global/setdeathanim.scr "welding_death"
	self anim welding_init
	self type_attack "alarm"
	self alarmthread maps/m2l2a.scr::weldinginterupt
	wait 5
	while (level.alarm == 0)
	{
		self anim welding_start
		self waittill animdone
		self anim welding_action
		wait (randomint(10) + 5)
		self anim welding_end
		self waittill animdone
		self anim welding_idle
		wait (randomint(10) + 10)
	}
	self thread weldinginterupt
end

weldinginterupt:
	if(self.inturpupted == 1)
		end
	self thread welderbreak
	self exec global/disable_ai.scr
	self.interupted = 1
	wait .1
	self anim welding_stop
	self waittill animdone
	wait .1
	self gun "walter p38"
	self exec global/enable_ai.scr
end

welderbreak:
	if(self.welderbroke != 1)
	{ 	
     	self.welderbroke = 1
     	spawn script_model model "models/miscobj/welding_tank.tik" targetname ((self.targetname) + "big1")
     	//$((self.targetname) + "big1") notsolid
     	$((self.targetname) + "big1").origin = self.origin
     	$((self.targetname) + "big1").angles = self.angles
     	$((self.targetname) + "big1") anim tank_death 
	}
end

welderdeath:
	if(self.ded != 1)
	{
		self waittill death
		self thread welderbreak
	}	
	self.ded = 1
end


For the wrencher, I added another german worker, and gave him a targetname of wrenchguy1. I then created a script_origin with a targetname of wrench1spot1 and placed it where I wanted my wrencher to wrench. Here is the combined script sections for the welder and wrencher:

Code: Select all

 
level waittill spawn

//AI prep and stuff

thread workers

	$wrenchman1 gun "walter p38"
	$wrenchman1 holster
	
	$welderguy1 gun "walter p38"
	$welderguy1 holster

end

////////////////////////////////////////////////////////////////
//** German Workers
///////////////////////////////////////////////////////////////

workers:

$welderguy1 thread welding

thread wrenchguy 

end

//////////////////
welding:
/////////////////

self forceactivate
	self thread welderdeath
	self.health = 1
	self exec global/setdeathanim.scr "welding_death"
	self anim welding_init
	self type_attack "alarm"
	self alarmthread maps/m2l2a.scr::weldinginterupt
	wait 5
	while (level.alarm == 0)
	{
		self anim welding_start
		self waittill animdone
		self anim welding_action
		wait (randomint(10) + 5)
		self anim welding_end
		self waittill animdone
		self anim welding_idle
		wait (randomint(10) + 10)
	}
	self thread weldinginterupt
end

weldinginterupt:
	if(self.inturpupted == 1)
		end
	self thread welderbreak
	self exec global/disable_ai.scr
	self.interupted = 1
	wait .1
	self anim welding_stop
	self waittill animdone
	wait .1
	self gun "walter p38"
	self exec global/enable_ai.scr
end

welderbreak:
	if(self.welderbroke != 1)
	{ 	
     	self.welderbroke = 1
     	spawn script_model model "models/miscobj/welding_tank.tik" targetname ((self.targetname) + "big1")
     	//$((self.targetname) + "big1") notsolid
     	$((self.targetname) + "big1").origin = self.origin
     	$((self.targetname) + "big1").angles = self.angles
     	$((self.targetname) + "big1") anim tank_death 
	}
end

welderdeath:
	if(self.ded != 1)
	{
		self waittill death
		self thread welderbreak
	}	
	self.ded = 1
end

/////////////////
wrenchguy:
////////////////

thread wrenchman1

wrenchman1:

	while(isalive $wrenchman1)
	{
		$wrenchman1 waitthread global/wrenching.scr::wrench wrench1spot1 wrench1look1
	}
end


"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Nice work :wink:
Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

Dude pm me with yer email and I will send it to ya. I really need to put it back up on my site a lot of people like that one.
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Ya that was a cool idea it even has the scientists doing thier thing and the guys carrying crates . I still got my copy . :D
Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

bdbodger wrote:Ya that was a cool idea it even has the scientists doing thier thing and the guys carrying crates . I still got my copy . :D
:)

:D

I sent him one.
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
Post Reply