German Workers
Moderator: Moderators
- Axion
- Major General
- Posts: 683
- Joined: Mon Sep 29, 2003 5:14 am
- Location: Northern California
- Contact:
German Workers
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.
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

- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9

- Axion
- Major General
- Posts: 683
- Joined: Mon Sep 29, 2003 5:14 am
- Location: Northern California
- Contact:
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-
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....

Code: Select all
wrenchguy1_thread:
while(isalive $wrenchguy1)
{
$wrenchguy1 waitthread global/wrenching.scr::wrench wrench1spot1 wrench1look1
}
endIt 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

- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9

likely
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.
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
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?
Small_Sumo, if you see this post, can you send this gentlemen your tutorial?
- Axion
- Major General
- Posts: 683
- Joined: Mon Sep 29, 2003 5:14 am
- Location: Northern California
- Contact:
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

- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9

- Axion
- Major General
- Posts: 683
- Joined: Mon Sep 29, 2003 5:14 am
- Location: Northern California
- Contact:
Success!
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:
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:
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
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

- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9

-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:



