Page 1 of 1

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

Posted: Tue Apr 05, 2005 11:11 am
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-

Posted: Tue Apr 05, 2005 12:59 pm
by Rookie One.pl
Make sure all triggers have correct spawnflags.

( )

Posted: Tue Apr 05, 2005 7:50 pm
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.

Posted: Tue Apr 05, 2005 10:25 pm
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)

( )

Posted: Wed Apr 06, 2005 2:02 am
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:

Posted: Wed Apr 06, 2005 9:07 am
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

Posted: Wed Apr 06, 2005 9:45 am
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 .

Re: ( )

Posted: Wed Apr 06, 2005 2:02 pm
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.

Posted: Wed Apr 06, 2005 10:01 pm
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

Posted: Wed Apr 06, 2005 10:14 pm
by Master-Of-Fungus-Foo-D
not if you tick not_player
:wink:

( )

Posted: Wed Apr 06, 2005 10:31 pm
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.

Posted: Thu Apr 07, 2005 6:50 am
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