Page 1 of 1
German Workers
Posted: Mon Feb 07, 2005 5:56 pm
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.
Posted: Mon Feb 07, 2005 9:27 pm
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.
Posted: Mon Feb 07, 2005 10:30 pm
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....

likely
Posted: Mon Feb 07, 2005 10:56 pm
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.
Posted: Tue Feb 08, 2005 3:21 pm
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?
Posted: Tue Feb 08, 2005 4:14 pm
by Axion
Oh, man. That would be awesome. Thanks!
Success!
Posted: Tue Feb 08, 2005 7:49 pm
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
Posted: Tue Feb 08, 2005 8:35 pm
by Green Beret
Nice work

Posted: Wed Feb 09, 2005 3:46 am
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.
Posted: Wed Feb 09, 2005 8:00 am
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 .

Posted: Fri Feb 11, 2005 4:42 pm
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 .

I sent him one.