AI and triggering

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

AI and triggering

Post by Rookie One.pl »

Hi,

I've got two questions this time:
1. Can AI trigger a trigger? :D :D :D
2. Can I identify (with a .scr script, in multiplayer map) which player triggered the trigger_use (once again :D )?
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 :twisted:)!

Rookie One
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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.
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

And?

Post 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Spawnflags?

Post by Rookie One.pl »

Jv_map, those spawnflags you wrote about were NOT_PLAYER and MONSTERS, is that right?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Maybe not. BTW, Monsters? What the hell are they?
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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. :roll:

You might as well take a look at my bot script :wink:
Search for 'action_follow:' (might also be 'task_follow:', not sure).
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

:)

Post by Rookie One.pl »

Great thanks, jv_map! I forgot about it :D 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

:))

Post by Rookie One.pl »

My hostage script seems to work correctly, but I have to test it :)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Cool! Hostages. Cs_hostage.bsp. :D
Live to map, not map to live.
-mohaa_rox, .map
moderator
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Yeah...

Post 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Hei!

Post by Rookie One.pl »

Aha! I see the light! :idea: Thanks! 8)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply