Jump to content
主视角中国

资料备查


S-22

Recommended Posts

Adding Triggers

A trigger is simply an invisible square you define that executes a command of your choosing onto a player who walks into that invisible box you made.

Once you’ve learned how to edit maps, You’ll probably want to know how to add triggers to maps. With triggers you can make players taller, shorter,

have god mode, play a sound, glow a color and many more things.

Step 1:

Open the map fix file that you made from the Map Modding Tutorial that you want the trigger in. Go to the very bottom of that file, make a blank line to separate items and triggers.

Open the game, go to the exact spot you want the trigger to be on the map.

Once in that spot open console and type in the word coord.

It will give you a list of numbers, the only ones you are interested in are the first three. Ex: Location: -1864.26 944 12.03

Now with those three numbers go to the mapfix file,

//=======================================================================

//========================= START OF TRIGGER1 ============================

//=======================================================================

local.trig = spawn trigger_multiple

local.trig.origin = ( -1864.26 944 12.03 ) // This is where you place the cords you have.

local.trig setsize ( -10 -10 -10 ) ( 10 10 10 ) //The way this works is it defines the box size. (the larger the numbers the larger the area)

//Directions for the size(south east down) (north west up) I believe these are in inches

local.trig setthread Trigger1 //Name of thread.

local.trig message "You are touching Trigger1" //This is what flashes on the players screen when they are on the trigger.

local.trig wait 1 // How often the trigger repeats itself.

local.trig delay 0 // How long before trig acts.

Trigger1: //This is the name of the thread you defined earlier in setthread.

self waittill trigger //Tells it to wait until the trigger is set off and is something you will never change.

local.player=parm.other //Something you will never change.

if (local.player.isTrigger1==1) //Change this to the name of the thread, in this case Trigger1.

end //This defines the end of this thread.

local.player.isTrigger1=1 //Since we made the player turn on the trigger, this says what to do once it’s turned on.

local.player tele 0 0 900 // This is where you execute the command. You never change the words “local.player”.

wait 5 //If you want 2 commands to execute per trigger this is the pause between them.

local.player kill // This is where you execute the 2nd command. You never change the words “local.player”.

local.player.isTrigger1=0 //Again make sure this has the name of the thread above for it to work.

end //This defines the end of this trigger.

//======================== END OF TRIGGER1 ==============================

Now that you have the trigger in your file, here are some options that I know work for the triggers

local.player dog //Gives the player god mode

local.player wuss //Gives the player all guns

local.player noclip //This makes the player fly through anything like a ghost

local.player.scale = .5 //This makes the player a midget

local.player.scale = 2 //This makes the player a giant

local.player light 1 0 0 200 // 1st number is red 2nd is green, 3rd is blue and 4th is size of circle

local.player jumpxy 100 100 100 //Mess with these numbers for fun it makes the player jump

local.player gravity .2 //This lowers gravity for the person

local.player respawn //This makes the player respawn

local.player stufftext “say I LIKE PINK FLOWERS” //This makes the player say what ever you want

local.player kill //This kills the player

local.player volumedamage 2 //This hurts the player 2 health points every time they touch the trigger

Once you have the trigger in the map, save it and reload it and see if it works

Link to comment
Share on other sites

FOR LEARNING PURPOSES COPY AND PASTE THE FOLLOWING INTO YOUR MAPFIX FILE

local.fix = spawn script_model

local.fix model "static/vehicle_bmwbike.tik" //under bridge

local.fix.origin = ( 228 474 384 )

local.fix.angles = ( 0 0 0 )

local.fix.scale = 1.0

local.fix ghost

local.fix = spawn script_model

local.fix model "static/vehicle_bmwbike.tik" //under bridge

local.fix.origin = ( 228 474 384 )

local.fix.angles = ( 0 0 0 )

local.fix.scale = 1.0

local.fix ghost

//========================= START OF TRIGGER1 ============================

//=======================================================================

local.trig = spawn trigger_multiple

local.trig.origin = ( 228 474 384 )

local.trig setsize ( -10 -10 -10 ) ( 10 10 10 )

local.trig setthread Trigger1

local.trig message "You are touching Trigger1"

local.trig wait 1

local.trig delay 0

//========================= START OF TRIGGER2 ============================

//=======================================================================

local.trig = spawn trigger_multiple

local.trig.origin = ( 0 0 100 )

local.trig setsize ( -10 -10 -100 ) ( 10 10 100 )

local.trig setthread Trigger1

local.trig message "You are touching Trigger2"

local.trig wait 1

local.trig delay 0

Trigger1:

self waittill trigger

local.player=parm.other

if (local.player.isTrigger1==1)

end

local.player.isTrigger1=1

local.player tele 0 0 900

wait 10

local.player.scale .5

local.player.isTrigger1=0

end

Trigger2:

self waittill trigger

local.player=parm.other

if (local.player.isTrigger2==1)

end

local.player.isTrigger2=1

local.player wuss

wait 5

local.player dog

local.player.isTrigger2=0

end

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

访客
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 创建新的...