Page 1 of 1
AI and triggering
Posted: Sun Feb 02, 2003 10:12 pm
by Rookie One.pl
Hi,
I've got two questions this time:
1. Can AI trigger a trigger?
2. Can I identify (with a .scr script, in multiplayer map) which player triggered the trigger_use (once again

)?
I need these answers for my new project (it's top-secret at the moment 8) , but when I'll finish it, I will publish it

)!
Rookie One
Posted: Mon Feb 03, 2003 3:02 am
by mohaa_rox
AI should be able to do that. Maybe set up pathnodes leading to the trigger.
I don't think it's possible to display who triggered the trigger.
Posted: Mon Feb 03, 2003 7:31 am
by jv_map
The triggerer is stored in the variable parm.other. You can't detect a player's name by script.
e.g.
$trigger waittill trigger
println "Triggered by " parm.other " class: " parm.other.classname
Remember this value is overwritten when somebody else triggers something.
AI can only trigger trigger_multiples, if you set the right spawnflags that is.
And?
Posted: Mon Feb 03, 2003 8:08 am
by Rookie One.pl
OK, I'll tell you what I want to do.
1. I want to make some AI follow the player and I want to run a thread in the script when the AI reaches a specific area. Is it possible?
2. I don't want to get player's name, I just want to put some stuff in only one player's console when he triggers the trigger (it's a MP map).
Rookie One
Spawnflags?
Posted: Mon Feb 03, 2003 8:25 am
by Rookie One.pl
Jv_map, those spawnflags you wrote about were NOT_PLAYER and MONSTERS, is that right?
Posted: Mon Feb 03, 2003 1:48 pm
by mohaa_rox
Maybe not. BTW, Monsters? What the hell are they?
Posted: Mon Feb 03, 2003 3:48 pm
by jv_map
Monsters are just AI actors.
Rookie One wrote:OK, I'll tell you what I want to do.
1. I want to make some AI follow the player and I want to run a thread in the script when the AI reaches a specific area. Is it possible?
2. I don't want to get player's name, I just want to put some stuff in only one player's console when he triggers the trigger (it's a MP map).
Well that's possible but it requires some scripting.
You might as well take a look at my bot script
Search for 'action_follow:' (might also be 'task_follow:', not sure).
:)
Posted: Mon Feb 03, 2003 4:34 pm
by Rookie One.pl
Great thanks, jv_map! I forgot about it

I think I can tell now what I'm working on. I'm trying to build a hostage rescue map and I need these things for it. It's almost finished! When it will be ready, .map's forum will be the first place where I will publish it 8)
Rookie One
:))
Posted: Mon Feb 03, 2003 6:13 pm
by Rookie One.pl
My hostage script seems to work correctly, but I have to test it

Posted: Tue Feb 04, 2003 2:47 am
by mohaa_rox
Cool! Hostages. Cs_hostage.bsp.

Yeah...
Posted: Tue Feb 04, 2003 9:18 am
by Rookie One.pl
Yeah, cool, but I need a little help with player following thread...
Jv_map, I need to ask you some questions about action_follow thread in your bot script.
1. What is hasbuddy variable (i.e. local.destination.hasbuddy)? Is it included in MoHAA or you made it?
2. The same about task variable (i.e. self.task) - yours or MoHAAs?
3. What is !vector_within and is it yours or MoHAAs?
TIA,
Rookie One
Posted: Tue Feb 04, 2003 2:12 pm
by jv_map
1 and 2 are my custom variables which you probably won't need.
3 is an operator included in mohaa, e.g.
if(vector_within $a.origin $b.origin 128)
returns 1 ('yes') if $a is within 128 game units from $b. An exclamation mark turns an 1 into a 0 (yes into no) or vice versa.
So if (!vector_within $a.origin $b.origin 128)
returns yes if $a is more than 128 units away from $b.
Hei!
Posted: Thu Feb 06, 2003 6:04 pm
by Rookie One.pl
Aha! I see the light!

Thanks! 8)