Welcome, Guest. Please login or register.
Did you miss your activation email?
March 24, 2019, 09:43:25 am

Login with username, password and session length
Search:     Advanced search
Savage: XR is a new patch for Savage, created by the Newerth.com staff. The XR1.1 Client is out now! Download it now!
189665 Posts in 10986 Topics by 18250 Members
Latest Member: rugtabazf
* Home Forum Wiki Help Search Login Register
+  Newerth Forums
|-+  Savage XR
| |-+  Mapping & Modding Forum
| | |-+  SUPPORT: Triggers Discussion Thread (Help and Advice)
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 4 Go Down Print
Author Topic: SUPPORT: Triggers Discussion Thread (Help and Advice)  (Read 19453 times)
Mohican
Order of the Stick
Former XR Dev
Legendary Member
*****
Posts: 2647



View Profile
« on: March 31, 2009, 07:12:36 pm »

I have not heard much reaction since the last patch, which featured the addition of Triggers in the Map Editor.
I want to make sure that mappers understand the importance of this feature, so I have linked some useful info here:

* Wiki section on how the Triggers work: Wiki Guide.

* Demo Map called "xr_triggers" that demonstrates what Triggers can do:
    - The objective is to build gars/subs on both hills north of the map.
    - The command centres cannot be damaged, and restone mines are unlimited.

    To make things more interesting there is:
    - A central hill with bushes that contain "surprises". (get on this hill with the jumppad or teleporter).
    - A platform between the north hills, with and "ejector" on each side (and also a "surprise" in the bush)
    - A redstone mine south of the map, standing on an "icerink".



Triggers are THE perfect tool for making mini-mod maps, with "special" game objectives and even "scenarios" driving the map
If you need help getting started, send me a PM or connect on our IRC Channel: #savagemods

 Afro
« Last Edit: October 08, 2011, 09:21:38 am by Mohican » Logged

Blue?
Newbie
*
Posts: 48


View Profile
« Reply #1 on: April 02, 2009, 01:47:48 am »

Too lazy to look it up so I'm asking upfront. 

For instance:
There are 3 spawn flags.
Flags A and B in the same area and flag C across the map.
Is there a trigger that allows a team to gain control of flag C, even though it is unreachable, if they capture flag A or B?
Logged
Mohican
Order of the Stick
Former XR Dev
Legendary Member
*****
Posts: 2647



View Profile
« Reply #2 on: April 02, 2009, 12:15:16 pm »

Too lazy to look it up so I'm asking upfront. 

For instance:
There are 3 spawn flags.
Flags A and B in the same area and flag C across the map.
Is there a trigger that allows a team to gain control of flag C, even though it is unreachable, if they capture flag A or B?

Yes, it is called a "Condition" Trigger.
Logged

Tjens
I make maps and stuff
XR Map Administrator
Super Hero Member
***
Posts: 1972


GIFMEISTER


View Profile
« Reply #3 on: April 02, 2009, 02:34:34 pm »

'WHAT WOULD BE A GOOD WAY TO PLACE TIGGER BOXES SOMEWHERE? HOVER ABOVE -> CHECK AND FILL IN COORDINATES AND CHECK ELEVATION?? OR IS THERE A QUICKER WAY??


SORRY FOR THE CAPS, I DISCOVERD THIS NEW KEYBOARD HAD IT ON HALF WAY TROUGH,IM TOO LAZY TO CORRECT Smiley
Logged

Mohican
Order of the Stick
Former XR Dev
Legendary Member
*****
Posts: 2647



View Profile
« Reply #4 on: April 02, 2009, 03:51:40 pm »

In upcoming Patch, there is a mouse drag function for trigger boxes and spheres.
Logged

Tjens
I make maps and stuff
XR Map Administrator
Super Hero Member
***
Posts: 1972


GIFMEISTER


View Profile
« Reply #5 on: April 02, 2009, 05:24:22 pm »

wow mohicen thx  Smiley
Logged

Aneurysm
XR Map Administrator
Super Hero Member
***
Posts: 1204



View Profile
« Reply #6 on: April 06, 2009, 02:36:11 pm »

In upcoming Patch, there is a mouse drag function for trigger boxes and spheres.


This is good news,

Along the same vein, what about rotation ability? As it stands...triggers are only forced into specific angles that do not always align properly with the terrain/objects you wish to involve in your trigger. eg. A trigger upon spawning would be much easier to use if you could rotate your trigger to the same angle as the stronghold.
Logged

Ulquiorra
Newerth Donator
Sr. Member
****
Posts: 463



View Profile WWW
« Reply #7 on: April 06, 2009, 09:13:13 pm »

mohican u sir do rock  Grin

Can not wait to be able to quicly place these and crate a hiden buff pull hidden somewhere only i knows about so it takes a bit tongerforme to get pwnd =D
Logged

MiraculiX
Full Member
***
Posts: 193


xr_newerth


View Profile
« Reply #8 on: October 11, 2011, 09:07:42 pm »

Well, working with Mohican brought awesome results in scripting for maps, not only did he help me to realise very complex triggers, but in the meanwhile he fixed a bunch of evil editor bugs!
I had a lot of headache with these in the last weeks, hopefully this will save you people from the same.

So I am sharing the great results, which are absolutely amazing, and
Fix all exploits
that come from a maps constitution!

Ill start with the easier ones, so people trying to copy/use this will get a feeling for triggering/scripting.


The kill trigger:

No longer do you have to barricade a section of your map, if you want it to be unreachable.
Trigger flags: objClient, onEnter
Script:
Code:
@activate
!die target

The exploit sensor killer:

No more exploit sensors. Anywhere you think a sensor is not suited (like in a kill triggered river, where it cannot be meleed, or shot because of the water), use this.
Trigger flags: objItem, onInside
Trigger restriction: human_motion_sensor
script:
Code:
@activate
!die target

If you are nice, and want to give it back to the owner (you shouldnt be nice with exploiters) use this sctipt:
Code:
@activate
!die target
!exec target "cvarcopy gs_object_name _temp"
!give owner #_temp#

Teleport trigger:

Trigger flags: objClient, onEnter
script:
Code:
@activate
!teleport target coords X Y Z
TRICK: If you do not know the cords of your destination, create a trigger, drag it there, read the coords and delete it!

Noob mine killer:

As soon as noobs find out where a teleporter teleports you, you can be sure they will spam the area with landmines/firewards. Now we wouldnt like to have this. Lets remove these mines, but we are nice, and give them back, with a message saying that its not the appropiate place.
Trigger flags: objItem, onInside
Trigger restriction: human_landmine,beast_fire_trap
(no space)
script:
Code:
@activate
!notify owner player "A strange force doesn't let you place this!"
!teleport target coords 0 0
!die target
!exec target "cvarcopy gs_object_name _temp"
!give owner #_temp#

And now the legendary anti exploit triggers:

Catapult/mortar/launcher trigger:

Trigger flags: objProjectile, onInside
script:
Code:
@activate
!die target

Its quite simple, thanks Mohican for implementing this idea!

Delayed kill trigger:

This trigger is just epic, the amount of headache one gets trying to figure it out is too^^.
This one kills everyone who wants to climb mountains, but what makes it different from a simple kill trigger, is that it doesnt kill people accidentally beheflying too high, but those tricky ones who plan to walk to the enemy base on the mountains, unless a ref in spec or opposite team kills them, are simply slain.
Its quite long, and actually consits of 3 triggers and 3 scripts. Call these triggers and scripts exploitkill1, 2 and 3 respectively. The triggers have to overlap perfectly.

exploitkill1 trigger:
flags: objClient, onEnter

exploitkill1 script:
Code:
@activate
!exec target "cvarcopy gs_game_time _timer#gs_object_id#"
!notify target player "EXPLOITING - Stop, or you will die!"

exploitkill2 trigger:
flags: objClient, onInside

exploitkill2 script:
Code:
@activate
!exec target "cvarcopy _timer#gs_object_id# _temp"
!if null [gs_game_time-_temp>2500] @then0
@then0
!die target


exploitkill3 trigger:
flags: objClient, onLeave

exploitkill3 script:
Code:
@activate
!exec target "set _timer#gs_object_id# 999999999"


Copy pasting the above anti exploit solutions is a one time work, but makes your map bulletproof, and saves players a lot of fustration!

Here are some more triggers, that could be considered on new maps:

Late game redstone source:

When all mines depleted, and there is no more redstone left, here is the help to continue pushing!
Interval trigger
Trigger flags: min 1000, event

script:
Code:
@activate
!if null [gs_game_time>1800000] @then0
@then0
!exec null "giveresource stone 4"

1800000 is 1,800,000 miliseconds, a half hour in this case, 4 means the income is 4redstone/second. This should be enough for an outpost every 5 minutes. Setting this value much higher may result in a serious towerspam.

There should be a notification about this event.
Interval trigger
Trigger flags: min 1800000, event, once

script:
Code:
@activate
!notify null all "4redstone/second"

Reduced fricton:

For smoother movement! Wonderful leaping, bouncing and melee moves!
Trigger should cover all the walkable areas.

Trigger flags: objClient, onInside
script:
Code:
@avtivate
!physic target groundfriction 0.6

Do not go below 0.6, or players will have melee and rage issues. All values between 1 and 0.6 are ok, unless you want to create an "icy" area on your map.


Thanks for reading this!
Help with crashing all the spectators client with a script would be appreciated.
MiraculiX


Logged

Contact me if you want your map to be checked!
Aneurysm
XR Map Administrator
Super Hero Member
***
Posts: 1204



View Profile
« Reply #9 on: October 12, 2011, 02:55:42 am »

Great work guys, and thanks for posting this to share with us all.
Logged

Mohican
Order of the Stick
Former XR Dev
Legendary Member
*****
Posts: 2647



View Profile
« Reply #10 on: October 12, 2011, 02:56:12 am »

Thanks a lot for writting this summary MiraculiX.
I might add one or two of those scripts in the templates.
I also plan to add a "help" section, and will use this info.
Logged

Mohican
Order of the Stick
Former XR Dev
Legendary Member
*****
Posts: 2647



View Profile
« Reply #11 on: October 31, 2011, 12:41:38 am »

For a complete example of Map Mod, please check out xr_mini
The XR 1.0 editor is required, to see all the config files, assets, and triggers (you can ask me for access to it).

The map works like "Battlefield", you need to capture the 2 flags to reduce the enemy's tickets to 0.
The are loads of nice features like a teleporting cave, healing fountain, and some physics props.
Logged

Faun
carn =/= hax
XR Contributor
Hero Member
****
Posts: 925


Hear a flute in the forest...


View Profile
« Reply #12 on: October 31, 2011, 01:08:26 am »

wow! Impressive Triggerlist!
Logged

Black Prince FR
Jr. Member
**
Posts: 60



View Profile
« Reply #13 on: February 13, 2012, 09:44:50 pm »

Very interesting ..
I'm going to make a map with that .
I played your map xr_mini Mohican , it made me thinking of maps ideas, and I found one .

It would be very very difficult and would make me an headache at least before 0h00 but I don't lose hope  Afro


EDIT : I will post some screenies here

I'm currently working on Victory Conditions but I've got a problem.

Quote
[_myCvar1>_myCvar2]

What's that ?
« Last Edit: February 13, 2012, 10:24:37 pm by Black Prince FR » Logged
Mohican
Order of the Stick
Former XR Dev
Legendary Member
*****
Posts: 2647



View Profile
« Reply #14 on: February 14, 2012, 03:32:50 am »

Hey Black Prince.
I will try to answer your post and PM here.

(1) [_myCvar1>_myCvar2] ?
This is the kind of logics used in Condition Triggers.
In "xr_mini" there is for example a trigger called "ticket1"

The function of this trigger is to check whether it is necessary to reduce the tickets of team 1. It has 2 conditions:
    [gs_counterT1>199]
    [gs_game_status==3]

[gs_game_status==3] means that the game has started (1 and 2 correspond to game setup and warmup).
[gs_counterT1>199] means that the variable gs_counterT1 has a value higher than 199.

gs_counterT1 is updated by another trigger called "counter1", which has 2 conditions:
    [gs_flag1==2]
    [gs_flag2==2]

These conditions means that both flags are owned by team 2.
The corresponding script "counter1" updates the variable gs_counterT1:
    !exec null "inc gs_counterT1 1"

I hope this makes sense, it is not so complicated.
Final word: you should initialize your variables in Config > Server.

(2) Where do I get the XR 1.0 Editor?
You can download it from savagexr.com

(3) How to copy/paste groups of objects?
Select several objects, then press shift and left-click anywhere on the map.
(you can also tick/untick the follow terrain option)
Logged

Pages: [1] 2 3 4 Go Up Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 19 queries.