Page 1 of 1
more ai questions
Posted: Sun Jun 01, 2003 11:35 pm
by small_sumo
How do I get my ai to drop his hammer before he unholsters his gun? How do I add any of the four moods?
Thanks
Posted: Mon Jun 02, 2003 12:04 am
by Alcoholic
i dont think he can / wants to drop his wrench, when i played the game i never saw him drop it. i think the command is like "level.myguy setmood curious" or something like that.
Posted: Mon Jun 02, 2003 12:46 am
by small_sumo
Ok so far my script looks like this. Bare in mind there is a trigger in the level for wakeup jeff and for salute_me.
main:
//exec global/exploder.scr
//exec global/cardgame.scr
level waittill spawn
thread hammerguy1
$salute thread smoking
////////////////////////////////////////////////////////////
smoking:
self holster
self.enableEnemy = 0
while(isAlive self)
{
self anim smoking01
self waittill animdone
self anim smoking02
wait 10
self anim smoking04
self waittill animdone
wait 0.5
}
end
salute_me:
while(isAlive self)
{
self anim smoking05
self waittill animdone
self anim salute
self waittill animdone
}
goto smoking
end
////////////////////////////////////////////////////////////
hammerguy1:
$hammer thread sledgehammering
end
sledgehammering:
self holster
self.enableEnemy = 0
self anim sledgehammer_init
wait 5
while(isAlive self)
{
self anim sledge_hammer_action
wait (randomint(10))
self anim sledge_hammer_idle
self waittill animdone
}
end
wakeup_jeff:
while(isAlive self)
{
//self.isup = 0
self anim working_hammering_putaway
waitframe
waitframe
waitframe
}
waitframe
self unholster
self exec global/enable_ai.scr
end
These are some errors I'm getting.
cache models/emitters/breath_emitter.tik
self anim smoking05 (maps/test__ai.scr, 51)
self ^
^~^~^ Script Error: trying to play animation on (entnum: 1, targetname: '', classname: 'Trigger') which does not have a model
self waittill animdone (maps/test__ai.scr, 52)
self ^
^~^~^ Script Error: invalid waittill animdone for 'Trigger'
self anim salute (maps/test__ai.scr, 54)
self ^
^~^~^ Script Error: trying to play animation on (entnum: 1, targetname: '', classname: 'Trigger') which does not have a model
self waittill animdone (maps/test__ai.scr, 55)
self ^
^~^~^ Script Error: invalid waittill animdone for 'Trigger'
self holster (maps/test__ai.scr, 34)
self ^
Posted: Mon Jun 02, 2003 5:54 am
by jv_map
Don't use self in the salute_me thread. Self is always the trigger in setthread threads. Just replace self with the guy that has to salute, e.g. $salute.
I'm curious about the following:
- Why does the main: thread not have an end?
- Why is the salute thread a looped thread (always bad for setthread threads)? And why should the guy start smoking when he's dead
?
- Why is the wakeup_jeff thread looped as well (don't use self here either)?
Apart from that you'll have to make some modifications to stop the looped anim threads when the guy has to do a special animation like saluting or throwing away the hammer.
To set a mood, just type any of the following:
self.mood = bored
self.mood = curious
self.mood = nervous
self.mood = alert
The change takes effect when the guy restarts his idle animation (or force immediate change by typing self animscript anim/idle.scr).
Posted: Mon Jun 02, 2003 11:38 pm
by Alcoholic
does mood in any way reflect their reaction to you/reaction time/anything? or does it just make their face different.
Posted: Tue Jun 03, 2003 8:23 am
by jv_map
It changes their idle animations mostly. For example, German AI defaults to bored, american to nervous. Therefore German soldiers are always playing with their gun and Americans are nicely swinging. 8)
Posted: Tue Jun 03, 2003 10:24 am
by small_sumo
Well now it works but isnt very smooth, got to iron out some gerky movments and they too slow to do theyre thing, well kinda. I get one qconsole error.
^~^~^ Script Error: Failed execution of command 'holster' for class 'Trigger' Targetname ''
self holster (maps/test__ai.scr, 21)
self ^
New code looks like this
main:
//exec global/exploder.scr
//exec global/cardgame.scr
level waittill spawn
thread hammerguy1
$salute thread smoking
////////////////////////////////////////////////////////////
end
smoking:
self holster
self.enableEnemy = 0
while(isAlive self)
{
self anim smoking01
self waittill animdone
self anim smoking02
wait 10
self anim smoking04
self waittill animdone
wait 0.5
}
end
salute_me:
$salute anim smoking04
$salute waittill animdone
$salute anim salute
goto smoking
end
////////////////////////////////////////////////////////////
hammerguy1:
$hammer thread sledgehammering
end
sledgehammering:
self holster
self.enableEnemy = 0
self anim sledgehammer_init
wait 5
while(isAlive self)
{
self anim sledge_hammer_action
wait (randomint(10))
self anim sledge_hammer_idle
self waittill animdone
}
end
wakeup_jeff:
$hammer anim working_hammering_putaway
$hammer waittill animdone
$hammer unholster
$hammer exec global/enable_ai.scr
end
Posted: Tue Jun 03, 2003 10:27 am
by small_sumo
Can you give them a mood in radient?
Posted: Tue Jun 03, 2003 10:59 am
by jv_map
Not sure, you can try.
Key / value: mood / alert (for example).
Posted: Tue Jun 03, 2003 3:40 pm
by small_sumo
What do you think my error is from?
Posted: Tue Jun 03, 2003 5:48 pm
by jv_map
jv_map wrote:Don't use self in the salute_me thread. Self is always the trigger in setthread threads. Just replace self with the guy that has to salute, e.g. $salute.
Posted: Wed Jun 04, 2003 2:10 am
by small_sumo
Alternatively I could go thread smoking just like the hammer person?
I'm getting there arn I ? It's very exiting.

Posted: Wed Jun 04, 2003 7:11 am
by jv_map
Yeah
