Triggers problem!
Moderator: Moderators
Triggers problem!
My triggers, like trigger multiple, trigger use and trigger, all don't work! Is this normal? When I run the game, the player doesn't trigger off the triggers.
Target
Trigger_use is set off by a player pressing the "use" key (normally key e), but trigger_multiple will fire when a player walks through it. If you want to see if your triggers are firing, give it a message text (Key: message; value: trigger1 has fired), or whatever message you want, and it will show up on the screen when you trip it in the game.
Your problem is probably that your triggers don't know what to target. So give the thing you want to target a targetname (key: targetname; value: mydoor1, or whatever). Now you can give that name to the trigger as a target (key: target; value: mydoor1). A line will appear in the editor to show they are connected. You can also set up triggers in the main script for your map, but for that you'll need a scripting tutorial.
Your problem is probably that your triggers don't know what to target. So give the thing you want to target a targetname (key: targetname; value: mydoor1, or whatever). Now you can give that name to the trigger as a target (key: target; value: mydoor1). A line will appear in the editor to show they are connected. You can also set up triggers in the main script for your map, but for that you'll need a scripting tutorial.
So if I want to script an objective, saying "find the missing bazooka team", then I put a trigger multiple, giving the keys and values:
setthread objective1
message You have found the team!
Put a script origin targetname obj1 above the bazooka team.
then script:
exec global/ai.scr
exec global/loadout.scr maps/test_xx.scr
main:
level waittill prespawn
exec global/ambient.scr test_xx
level waittill spawn
$player item weapons/colt45.tik
fadein 2 0 0 0 1
wait 2
level.script = "maps/test_xx.scr"
thread objectives
end
////////////
objectives:
waitthread global/objectives.scr::add_objectives 1 2 "Locate the missing bazooka team." $obj1.origin
set_objective_pos $obj1
end
///////////
objective1:
goto levelend
end
//////////
levelend:
waitthread global/objectives.scr::add_objectives 1 3 "Locate the missing bazooka team." $obj1.origin
waitthread global/objectives.scr::current_objectives 0
exec global/missioncomplete.scr test_xx 1
end
Will that work and the message display "You have found the team"?
setthread objective1
message You have found the team!
Put a script origin targetname obj1 above the bazooka team.
then script:
exec global/ai.scr
exec global/loadout.scr maps/test_xx.scr
main:
level waittill prespawn
exec global/ambient.scr test_xx
level waittill spawn
$player item weapons/colt45.tik
fadein 2 0 0 0 1
wait 2
level.script = "maps/test_xx.scr"
thread objectives
end
////////////
objectives:
waitthread global/objectives.scr::add_objectives 1 2 "Locate the missing bazooka team." $obj1.origin
set_objective_pos $obj1
end
///////////
objective1:
goto levelend
end
//////////
levelend:
waitthread global/objectives.scr::add_objectives 1 3 "Locate the missing bazooka team." $obj1.origin
waitthread global/objectives.scr::current_objectives 0
exec global/missioncomplete.scr test_xx 1
end
Will that work and the message display "You have found the team"?
No expert
I'm no scriting expert, but I think you would need something to tell the game that the player is near the objective origin--vector stuff.
A much simpler way would be to just place a large trigger multiple around your (dead?) bazooka team, or the door to that room, and have it set the levelend thread and play the message. Put a wait in the levelend thread and maybe a fadeout before it goes to mission complete.
A much simpler way would be to just place a large trigger multiple around your (dead?) bazooka team, or the door to that room, and have it set the levelend thread and play the message. Put a wait in the levelend thread and maybe a fadeout before it goes to mission complete.
