a lot of time i came across in script of things called trigger
trigger spawn active
trigger on
trigger off
even on rtcw with nazis i see a lot of trigger commands what execly are they
how do i use them
and how is builded?
trigger script
nikita
(nikita)
#1
kamikazee
(kamikazee)
#2
trigger can mean several things as a keyword. It is used in scripting only.
It can define a trigger as in:
trigger mytrigger {
//Do some commands
}
Now, you can call this trigger from somewhere else, be it the same entity or another one. Here’s an example:
door_L_r {
spawn {
wait 100
}
trigger open {
// Open door, use some animation code like gotomarker
}
trigger close {
// Close door
}
}
invis_user_r {
spawn {
wait 100
}
activate {
trigger door_L_r open
}
}
Now you see it uses
trigger <routine> <trigger name>
In the example, is ‘door_L_r’, but this can be ‘self’ as well, so you can copy code from one entity to another. An example would be that after you opened the door, it closes itself. Here’s the changed door_L_r routine:
door_L_r {
spawn {
wait 100
}
trigger open {
// Open door, use some animation code like gotomarker.
// Animations done, now close door ( IF ANIMATION IS DONE! DON'T FORGET WAIT THEN)
trigger self close
}
trigger close {
// Close door
}
}