Let bots sit down on a chair?

Please use this forum to ask all your MoHAA Bots questions / discussions

Moderator: Moderators

Post Reply
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

Let bots sit down on a chair?

Post by |NSC|-Steelie-NS*LR* »

Yo guys,

How do you let bots sit on a chair? :shock:
But they have to stand up when there's an enemy around.
is that possible? I think so, but dunno how to do it. :roll:

Greetz Steelie :!:
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

you could make a cardgame.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

Post by |NSC|-Steelie-NS*LR* »

Is there realy nothing easier? :?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Small sumo's busy_tutorial.pk3 is good to learn from maybe he will send it to you .
Image
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

Post by |NSC|-Steelie-NS*LR* »

k, I checked the map out, and I looked at the script, but I don't get it. :cry:
Can' t anyone just tell me the script? :idea:
It musn't be so hard, I think...
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

well there is an anim for a sitting prisoner from the second SP map wit major grillo (did you nkow JackGrillo was a sound manager for the game? look in the credits!)
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

Post by |NSC|-Steelie-NS*LR* »

You guys here do evereything extremely well: mapping , scripting, modding!

But you can't tell me the script of a 'SITTING' bot? :evil: Man, someone must have done it one time! :cry:
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

But you can't tell me the script of a 'SITTING' bot? Man, someone must have done it one time!
it takes an animation and probably a state. it's not stock and animations are few and far between, as far as i know i'm the only one here who animates and i loathe MilkShape with a passion. and nobody's ever had a use for a sitting AI. it'd make the game better of course, but generally SP levels dont assume that the player is undetected and MP levels certainly a guy is not going to sit down in hte middle of a huge firefight.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

Hey steelie! IF you havent listened to me, listen NOW! If you can open up m1l2a youll find that the prisoner 'bot' is siting down and got up when you entered the room and killed the interrogators... now you just need to find what anim/state/script made him do that...
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Fungus, if you'd listened to him, you would have known he wanted a regular sitting animation, not hanging his head twitching ever so often.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

You should try reading some scripts to see how things are done . Like the stock mohaa scripts . You might find the answers to some of your questions . Like in this part of the global/cardgame.scr

sitthink:

self.originalhealth = self.health
self.health = 1
self holster
self.origin = self.chair.origin
self.angles = self.chair.angles
self anim chair_radio_listenidle

if (randomint (100) > 50)
self.chairdeath = "chair_death_forwards"
else
self.chairdeath = "chair_death_backwards"

self.fighting = 0
self thread chairdeath

self exec global/setdeathanim.scr self.chairdeath

while (self.thinkstate == "idle")
waitframe
Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

so lizard kid, maybe he wants a drunk :P
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post by Axion »

After looking at Small Sumo's buy tutorial, I took the global/eat.scr in there and modified it for sitting only:

Code: Select all

sitting:

		local.oldhealth = self.health
		self.health = 1
		local.chair = spawn script_model
		local.chair model "furniture/cardchair.tik"
		local.chair.origin = self.origin
		local.chair.angles = self.angles + ( 0 -90 0)

	if (randomint (100) > 50)
		self.chairdeath = "chair_death_forwards"
	else
		self.chairdeath = "chair_death_backwards"

	self.fighting = 0
	self thread sittingdeath local.chair

	self exec global/setdeathanim.scr self.chairdeath

	
	self holster

	while (self.thinkstate == "idle")
		{
		self anim chair_radio_listenidle 
		wait 3
		

}
if (isalive self)
	{
		self lookat $player
		self exec global/disable_ai.scr

		self anim dinner_relaxed_leap
		local.chair anim chair_alert_stand
		self unholster
		wait 0.5
//		self waittill animdone
		if (isalive self)
		{
			self.fighting = 1
			self exec global/enable_ai.scr
			self.health = local.oldhealth
			self exec global/setdeathanim.scr NIL
			self runto $player

			wait 1
			local.chair anim chair_alert_stand_end
		}
	}

end

sittingdeath local.chair:

self waittill death

	if (self.fighting == 0)
	{
		
		if (self.chairdeath == "chair_death_forwards")
			local.chair solid
		else
			local.chair notsolid

		waitframe
		println ("Chair is playing animation " + self.chairdeath)
		local.chair anim self.chairdeath
		wait 3
		local.chair anim (self.chairdeath + "_end")
		println ("Chair is playing animation " + (self.chairdeath + "_end"))
		waitframe
	}
end
To use it, just give your AI a targetname and in your script you can call up the global script to make them to sit:

Code: Select all

$sit_guy thread global/sit.scr::sitting

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
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Is that the whole script? if so then you don't need to use

$sit_guy thread global/sit.scr::sitting

because when you execute a script it automatically starts at the top of the scirpt unitil it finds the word end so

$sit_guy exec global/sit.scr

would work too . This would be a usefull script nice job .
Image
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post by Axion »

Here's the final .scr:

Code: Select all

/////  Global Sitting Script by Axion
/////  **HOW TO USE**
/////  -Place a German AI guy and give him a targetname (Example, ai_guy1)
/////  To call up a sitting animation in your main script, use this method-
/////
/////  $ai_guy1 thread global/sit.scr::listening (Sitting down and listening)
/////  $ai_guy1 thread global/sit.scr::sitting   (Sitting down and relaxing) 
/////  $ai_guy1 thread global/sit.scr::writing   (Sitting down and writing)
/////
/////-----------------------------------------------------------------------------

listening:

		local.oldhealth = self.health
		self.health = 1
		local.chair = spawn script_model
		local.chair model "furniture/cardchair.tik"
		local.chair.origin = self.origin
		local.chair.angles = self.angles + ( 0 -90 0)

	if (randomint (100) > 50)
		self.chairdeath = "chair_death_forwards"
	else
		self.chairdeath = "chair_death_backwards"

	self.fighting = 0
	self thread listeningdeath local.chair

	self exec global/setdeathanim.scr self.chairdeath

	
	self holster

	while (self.thinkstate == "idle")
		{
		self anim chair_radio_listenidle 
		wait 3
		

}
if (isalive self)
	{
		self lookat $player
		self exec global/disable_ai.scr

		self anim dinner_relaxed_leap
		local.chair anim chair_alert_stand
		self unholster
		wait 0.5
//		self waittill animdone
		if (isalive self)
		{
			self.fighting = 1
			self exec global/enable_ai.scr
			self.health = local.oldhealth
			self exec global/setdeathanim.scr NIL
			self runto $player

			wait 1
			local.chair anim chair_alert_stand_end
		}
	}

end

listeningdeath local.chair:

self waittill death

	if (self.fighting == 0)
	{
		
		if (self.chairdeath == "chair_death_forwards")
			local.chair solid
		else
			local.chair notsolid

		waitframe
		println ("Chair is playing animation " + self.chairdeath)
		local.chair anim self.chairdeath
		wait 3
		local.chair anim (self.chairdeath + "_end")
		println ("Chair is playing animation " + (self.chairdeath + "_end"))
		waitframe
	}
end

/////-----------------------------------------------------------------------------

sitting:

		local.oldhealth = self.health
		self.health = 1
		local.chair = spawn script_model
		local.chair model "furniture/cardchair.tik"
		local.chair.origin = self.origin
		local.chair.angles = self.angles + ( 0 -90 0)

	if (randomint (100) > 50)
		self.chairdeath = "chair_death_forwards"
	else
		self.chairdeath = "chair_death_backwards"

	self.fighting = 0
	self thread sittingdeath local.chair

	self exec global/setdeathanim.scr self.chairdeath

	
	self holster

	while (self.thinkstate == "idle")
		{
		self anim dinner_relaxed_resting	
		wait 3

}
if (isalive self)
	{
		self lookat $player
		self exec global/disable_ai.scr

		self anim dinner_relaxed_leap
		local.chair anim chair_alert_stand
		self unholster
		wait 0.5
//		self waittill animdone
		if (isalive self)
		{
			self.fighting = 1
			self exec global/enable_ai.scr
			self.health = local.oldhealth
			self exec global/setdeathanim.scr NIL
			self runto $player

			wait 1
			local.chair anim chair_alert_stand_end
		}
	}

end

sittingdeath local.chair:

self waittill death

	if (self.fighting == 0)
	{
		
		if (self.chairdeath == "chair_death_forwards")
			local.chair solid
		else
			local.chair notsolid

		waitframe
		println ("Chair is playing animation " + self.chairdeath)
		local.chair anim self.chairdeath
		wait 3
		local.chair anim (self.chairdeath + "_end")
		println ("Chair is playing animation " + (self.chairdeath + "_end"))
		waitframe
	}
end

/////-----------------------------------------------------------------------------

writing:

		local.oldhealth = self.health
		self.health = 1
		local.chair = spawn script_model
		local.chair model "furniture/cardchair.tik"
		local.chair.origin = self.origin
		local.chair.angles = self.angles

	if (randomint (100) > 50)
		self.chairdeath = "chair_death_forwards"
	else
		self.chairdeath = "chair_death_backwards"

	self.fighting = 0
	self thread writingdeath local.chair

	self exec global/setdeathanim.scr self.chairdeath

	
	self holster

	while (self.thinkstate == "idle")
		{
		self anim chair_write	
		//self waittill animdone
		wait 2

}
if (isalive self)
	{
		self lookat $player
		self exec global/disable_ai.scr

		self anim chair_alert_stand
		local.chair anim chair_alert_stand
		self unholster
		wait 0.5
//		self waittill animdone
		if (isalive self)
		{
			self.fighting = 1
			self exec global/enable_ai.scr
			self.health = local.oldhealth
			self exec global/setdeathanim.scr NIL
			self runto $player

			wait 1
			local.chair anim chair_alert_stand_end
		}
	}

end

writingdeath local.chair:

self waittill death

	if (self.fighting == 0)
	{
		
		if (self.chairdeath == "chair_death_forwards")
			local.chair solid
		else
			local.chair notsolid

		waitframe
		println ("Chair is playing animation " + self.chairdeath)
		local.chair anim self.chairdeath
		wait 3
		local.chair anim (self.chairdeath + "_end")
		println ("Chair is playing animation " + (self.chairdeath + "_end"))
		waitframe
	}
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
Post Reply