Trigger Multiples- only some get activated, why dont the o..

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
Goldeneye090
Colour Sergeant
Posts: 79
Joined: Mon May 10, 2004 10:11 pm

Trigger Multiples- only some get activated, why dont the o..

Post by Goldeneye090 »

Alright I got a problem with a singplayer map I've been workin on...I added patrolling bots but only 2 out of 5 actually get activated by my trigger_multiples...if anyone can take a look at the .map or knows a lot about them already can you please post, thanks!

-GoldenEye-
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 »

Make sure all triggers have correct spawnflags.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Goldeneye090
Colour Sergeant
Posts: 79
Joined: Mon May 10, 2004 10:11 pm

( )

Post by Goldeneye090 »

I think all the spawnflags are set correctly....because ALL of the trigger_multiples show they're connected to the right bots, but only two of them actually activate when I walk through them...at first I thought I just put the trigger_multiples too far from the bot they were connected to but then I tried putting it right next to the bot and it still didn't work...I'm pretty sure I did the script correctly because two of the five do work...

Code: Select all

// test_undercover
// mapping by steve
// scripting by steve

main:
exec global/ai.scr
exec global/loadout.scr maps/test_undercover.scr 
exec gloal/friendly.scr

level waittill prespawn
exec global/ambient.scr test_undercover

level waittill spawn
level.script = "maps/test_undercover.scr"
thread objectives
$player item weapons/silencedpistol.tik
$player ammo pistol 500
fadein 2 0 0 0 1
wait 2
end

objectives:
waitthread global/objectives.scr::add_objectives 1 2 "Kill the guards." $obj1.origin
set_objective_pos $obj1
thread objective1
end

objective1:

waitthread global/objectives.scr::current_objectives 1
$player stufftext "tmstart sound/music/suspense.mp3"
iprintln "Objective: Kill the guards"
if (IsAlive $badguy1)
$badguy1 waittill death
if (IsAlive $badguy2)
$badguy2 waittill death
if (IsAlive $badguy3)
$badguy3 waittill death
if (IsAlive $badguy4)
$badguy4 waittill death
if (IsAlive $badguy5)
$badguy5 waittill death
// thread levelend
end

levelend:

waitthread global/objectives.scr::current_objectives 0
iprintln "mission completed"
wait 1
exec global/missioncomplete.scr test_mohdesigntut3 1
end
The // is before the thread for levelend for testing. If you wanna take a look at the .map I'll send it to you on |aim|, it transfers fast. Thanks.
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 »

i think i spotted an error... shouldnt the

Code: Select all

if (isalive $badguy#)
be changed to

Code: Select all

while (isalive $badguy#)
or you could just

Code: Select all

// test_undercover
// mapping by steve
// scripting by steve

main:
exec global/ai.scr
exec global/loadout.scr maps/test_undercover.scr
exec gloal/friendly.scr

level waittill prespawn
exec global/ambient.scr test_undercover

level waittill spawn
level.script = "maps/test_undercover.scr"
thread objectives
$player item weapons/silencedpistol.tik
$player ammo pistol 500
fadein 2 0 0 0 1
wait 2
end

objectives:
waitthread global/objectives.scr::add_objectives 1 2 "Kill the guards." $obj1.origin
set_objective_pos $obj1

while (level.enemydead < 5)
wait 3 //so it doesnt run the thread constantly
thread objective1

end

objective1:

waitthread global/objectives.scr::current_objectives 1
$player stufftext "tmstart sound/music/suspense.mp3"
iprintln "Objective: Kill the guards"
if (IsAlive $badguy1)
$badguy1 waittill death
level.enemydead++
 
if (IsAlive $badguy2)
$badguy2 waittill death
level.enemydead++

if (IsAlive $badguy3)
$badguy3 waittill death
level.enemydead++

if (IsAlive $badguy4)
$badguy4 waittill death
level.enemydead++

if (IsAlive $badguy5)
$badguy5 waittill death
level.enemydead++

// thread levelend
end
i dunno, i think that should work
(open for error check)
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Goldeneye090
Colour Sergeant
Posts: 79
Joined: Mon May 10, 2004 10:11 pm

( )

Post by Goldeneye090 »

I just tried it and the script executed the same as the old one...Everything is set up correctly...The triggers are connected to the bots, the bots just don't seem to respond to them for some reason, it's weird. The same 2/5 bots worked :cry:
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

The AI tend to fall asleep on you, wake em up after trigger activates with;

$aidude ai_on
$aidude.enableEnemy = 1

Edit;

If you have a number of ai that are called by a trigger then I would use a setthread for each group from each trigger, like this.

enemy_group1: //called by trigger in bsp
if ( $group1 )
{
for ( local.i = $group1.size; local.i >= 1; local.i-- )
{
$group1[local.i] show
$group1[local.i] solid
$group1[local.i] ai_on
$group1[local.i].enableEnemy = 1
}
}
end

That might be the problem, or I'm barking up the wrong tree :)
Grassy
An ambiguous question will get a similar answer...
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

If you are useing the global/ai.scr make sure the set numbers of the triggers match the ai's and group numbers of the nodes as well .
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Re: ( )

Post by Rookie One.pl »

Goldeneye090 wrote:I think all the spawnflags are set correctly....because ALL of the trigger_multiples show they're connected to the right bots
Spawnflags have nothing to do with connections. Make sure you've got MONSTERS checkbox checked in all of the triggers.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Make sure you've got MONSTERS checkbox checked in all of the triggers
I thought that was to allow AI to activate the trigger as well as a player???
Grassy
An ambiguous question will get a similar answer...
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 »

not if you tick not_player
:wink:
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Goldeneye090
Colour Sergeant
Posts: 79
Joined: Mon May 10, 2004 10:11 pm

( )

Post by Goldeneye090 »

Alright thanks to u guys I got one more working perfectly. One guy is activated, but not at the right time...I run past the designated trigger_multiple and he doesn't start his patrol route, but when I run through a different area he seems to start moving there instead...kinda weird but at least he's moving...the 5th/last guy still just stands in his place and shoots at me like a normal bot.
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

the 5th/last guy still just stands in his place and shoots at me like a normal bot.
Well you might need to use enableEnemy = 0 //wont attack until re-enabled at destination, and or reduce his sight and awareness a little.

Grassy
An ambiguous question will get a similar answer...
Post Reply