Trigger Multiples- only some get activated, why dont the o..
Moderator: Moderators
-
Goldeneye090
- Colour Sergeant
- Posts: 79
- Joined: Mon May 10, 2004 10:11 pm
Trigger Multiples- only some get activated, why dont the o..
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-
-GoldenEye-
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
-
Goldeneye090
- Colour Sergeant
- Posts: 79
- Joined: Mon May 10, 2004 10:11 pm
( )
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...
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.
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
-
Master-Of-Fungus-Foo-D
- Muffin Man
- Posts: 1544
- Joined: Tue Jan 27, 2004 12:33 am
- Location: cali, United States
i think i spotted an error... shouldnt the
be changed to
or you could just
i dunno, i think that should work
(open for error check)
Code: Select all
if (isalive $badguy#)Code: Select all
while (isalive $badguy#)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(open for error check)
-
Goldeneye090
- Colour Sergeant
- Posts: 79
- Joined: Mon May 10, 2004 10:11 pm
( )
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 
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
$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...
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
Re: ( )
Spawnflags have nothing to do with connections. Make sure you've got MONSTERS checkbox checked in all of the triggers.Goldeneye090 wrote:I think all the spawnflags are set correctly....because ALL of the trigger_multiples show they're connected to the right bots
-
Master-Of-Fungus-Foo-D
- Muffin Man
- Posts: 1544
- Joined: Tue Jan 27, 2004 12:33 am
- Location: cali, United States
-
Goldeneye090
- Colour Sergeant
- Posts: 79
- Joined: Mon May 10, 2004 10:11 pm
( )
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.



