Toribash
Original Post
~ Mod Triggers Documentation ~
I decided to make a very simple trigger tutorial, for the benefit of the other modders.

So, this isn't an in depth view of how exactly to set them up, but a few preset bits of code you can copy and paste to get a variety of effects.

ok, there are 3 bits of code, I'll call them A B and C

#A
# player 0 wins
trig_id 2
trig_mask 1
trig_action 1

#B
# player 1 wins
trig_id 4
trig_mask 1
trig_action 2

#C
#Target
trig_id 1
trig_mask 6

You can cut and paste these in notepad to the desired objects.

It works like this.

A is the trigger for red player to win

B is the trigger for blue player to win

C is the key that triggers the win (when it contacts with A or B)

So, if you wanted to make it so that the red player would win if he touched a certain object with his head, you would add C to the object in notepad, and A to the players head (in notepad again).

You can experiment with different combinations to achieve different outcomes, I think you can do most of what triggers are designed to do with these 3 bits of code.

CM


Example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~

player 0

body l_hand
#A
# player 0 wins
trig_id 2
trig_mask 1
trig_action 1


body r_hand
#A
# player 0 wins
trig_id 2
trig_mask 1
trig_action 1

player 1

body l_hand
#B
# player 1 wins
trig_id 4
trig_mask 1
trig_action 2

body r_hand
#B
# player 1 wins
trig_id 4
trig_mask 1
trig_action 2


env_obj 1
color 0 0 0 1
flag 8
pos 1 -0.1 5
shape box
sides 0.2 0.2 10
#C
#Target
trig_id 1
trig_mask 6


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


So here, there is an object (object 1) is the key, and the players hands are the triggers. So if player 0 (red) or player 1 (blue) touches object 1 with their hands, they win the match.
Last edited by Smilies2; Dec 22, 2013 at 05:53 PM.
<the god> the god
<@Smilies2> modding tiem

np, added a little example for the more confused members of tb.
<the god> the god
<@Smilies2> modding tiem

Haha, this would've saved me a bunch of trouble when I made that nfl mod.
Nice tut clock
<fett175> So what you're saying is, I can type whatever I want here and it will be at the bottom of all my posts?... AWESOME
Thank you ClockworkMonkey,

Very simple and clear

Is it as simple doing this within the in-game editor,Or would you recommend sticking to script editing?
bem loko
https://cache.toribash.com/forum/ihtt...tor/smilie.gif
-----
o aqui é todo mundo bichão memoem doido
Last edited by ibra00; Nov 26, 2015 at 04:31 PM. Reason: <24 hour edit/bump