Mako's guide to triggers
Moderators: th15, Moderators
Mako's guide to triggers
Read the Documentation first.
*cheers th15 for the sticky
Since i've had a few messages on how to use triggers, and have seen very few examples on how triggers work and operate on the forums i've decided to write a pictorial on specific examples of how to use triggers, and how to test them.
Tutorial 1. Weapon recoil
For this example we'll be making a gun that recoils whenever the weapon it's set to is fired
Step 1.
On a new ship create a 'base' section (yellow here) and place a blaster on top of it. This yellow section is static and won't do anything other than hold up the gun.
Step 2.
On the yellow section create a top section. This will be the part of the gun that recoils.
Step 3.
On the left hand panel click edit and you should see a triggers section down the bottom. Change trigger on action 1 to 'weapon fire and trigger off action 1 to Mov.Reach origin (s), leave mode as move.
What does this mean?, the part will enter move mode when the triggered weapon fires, and it will stop moving once it returns to it's starting point.
Step 3.5
On the left hand panel click ED2.
Change target distance to 10 and direction to 180. This results in the part going backward 10 units, then coming back to it's origin.
Set advance frames to 5 and Return frames to 10. This achieves a quick recoil of the top section with a slower return to the origin.
Step 4.
With the top section selected, right click on the blaster and from the context menu press 'Set on trigger 1'
Step 5.
Click on the blaster to select it, then press 'w'. This should place it on the base section and hide it behind the top section.
Testing it.
Press F11 to go into preview mode and keep mashing 'q' to testfire till you get bored
*cheers th15 for the sticky
Since i've had a few messages on how to use triggers, and have seen very few examples on how triggers work and operate on the forums i've decided to write a pictorial on specific examples of how to use triggers, and how to test them.
Tutorial 1. Weapon recoil
For this example we'll be making a gun that recoils whenever the weapon it's set to is fired
Step 1.
On a new ship create a 'base' section (yellow here) and place a blaster on top of it. This yellow section is static and won't do anything other than hold up the gun.
Step 2.
On the yellow section create a top section. This will be the part of the gun that recoils.
Step 3.
On the left hand panel click edit and you should see a triggers section down the bottom. Change trigger on action 1 to 'weapon fire and trigger off action 1 to Mov.Reach origin (s), leave mode as move.
What does this mean?, the part will enter move mode when the triggered weapon fires, and it will stop moving once it returns to it's starting point.
Step 3.5
On the left hand panel click ED2.
Change target distance to 10 and direction to 180. This results in the part going backward 10 units, then coming back to it's origin.
Set advance frames to 5 and Return frames to 10. This achieves a quick recoil of the top section with a slower return to the origin.
Step 4.
With the top section selected, right click on the blaster and from the context menu press 'Set on trigger 1'
Step 5.
Click on the blaster to select it, then press 'w'. This should place it on the base section and hide it behind the top section.
Testing it.
Press F11 to go into preview mode and keep mashing 'q' to testfire till you get bored
Last edited by Mak0 on Thu Feb 19, 2009 7:34 am, edited 4 times in total.
Tutorial 2. Making a bow
This example will be a bow shaped..thing that contracts every time a shot is fired from the triggered weapon. As the weapon reloads for the next shot the bow arms slowly raises to help you know when the next shot is ready.
Step 1.
Onto the main body attach a weapon and a section to be used as a pivot (the red one below), then onto that section attach an arm.
Step 2.
Select the pivot point and change it's settings in edit to as follows:
In the ED2 menu of the pivot in the rotating section, set borders to enabled, CW border to 0 and CCW border to 90.
Now with pivot selected right click on the weapon and press 'set on trigger 1'
If you go into preview mode (F11) and test fire (q) you'll see that for a weapon like a railgun, that our bow arm doesn't give properly reflect the charge up time and fire time.
Step 3.
To time the actions of our arm to the weapon speed click the weapon and go into edit. For a railgun the reload time is 120 frames.
Go back to the pivots' ED2 menu and set CCW Rot frames to 5, and CW Rot frames to 95.
When the weapon is fired, this results in the bow arm quickly drawing back, then slowly returning to the original position before standing still for 20 frames till the next shot.
Step 4.
When you press 'm' to mirror the ship components, the components will have no triggers attatched to them but will retain and inverse their trigger settings (e.g. CW is changed to CCW). All you need to do is click the pivot and set it to trigger 1 on the weapon.
This example will be a bow shaped..thing that contracts every time a shot is fired from the triggered weapon. As the weapon reloads for the next shot the bow arms slowly raises to help you know when the next shot is ready.
Step 1.
Onto the main body attach a weapon and a section to be used as a pivot (the red one below), then onto that section attach an arm.
Step 2.
Select the pivot point and change it's settings in edit to as follows:
In the ED2 menu of the pivot in the rotating section, set borders to enabled, CW border to 0 and CCW border to 90.
Now with pivot selected right click on the weapon and press 'set on trigger 1'
If you go into preview mode (F11) and test fire (q) you'll see that for a weapon like a railgun, that our bow arm doesn't give properly reflect the charge up time and fire time.
Step 3.
To time the actions of our arm to the weapon speed click the weapon and go into edit. For a railgun the reload time is 120 frames.
Go back to the pivots' ED2 menu and set CCW Rot frames to 5, and CW Rot frames to 95.
When the weapon is fired, this results in the bow arm quickly drawing back, then slowly returning to the original position before standing still for 20 frames till the next shot.
Step 4.
When you press 'm' to mirror the ship components, the components will have no triggers attatched to them but will retain and inverse their trigger settings (e.g. CW is changed to CCW). All you need to do is click the pivot and set it to trigger 1 on the weapon.
Last edited by Mak0 on Tue Feb 17, 2009 3:48 pm, edited 1 time in total.
-
- Commander
- Posts: 174
- Joined: Fri Jun 13, 2008 4:37 pm
- Location: Frontlines againest a piggy invasion
Gah! I've been beaten to it!
Ah well, that just means less work for me to do then. Its not a bad guide though although you should warn them about some of the known bugs like weapon trigger not cloning/mirroring properly.
Don't worry though, if you can handle the basics then that's one less thing I have to cover when I finish my guides.
BTW, may I have permission to link to your guide? Its good enough to teach people the basics with it.
Ah well, that just means less work for me to do then. Its not a bad guide though although you should warn them about some of the known bugs like weapon trigger not cloning/mirroring properly.
Don't worry though, if you can handle the basics then that's one less thing I have to cover when I finish my guides.
BTW, may I have permission to link to your guide? Its good enough to teach people the basics with it.
Avatarless and proud of it! And being really crazy and screwing everything conventional!
Currently working on:
The largest transforming mecha EVAR!
Currently working on:
The largest transforming mecha EVAR!
Re: Mako's guide to triggers
How about the documentation?Mak0 wrote:... and have seen very little information on how triggers work and operate on the forums ...
Yes, i know, im pushing it, but i don't want people to get the impression that they can just skip it and feed with guides, or that there should be guides for everything. Thats kind of the vibe your guide gives off. It should be more like read documentation first, then guides.
-
- Vice Admiral
- Posts: 1435
- Joined: Tue Dec 04, 2007 7:31 am
-
- Commander
- Posts: 145
- Joined: Mon Feb 16, 2009 10:24 pm
- Location: In America!
- Contact:
Nice tutorial and all - I'd probably use it if I didn't already know how to do that stuff - but you do realize that real bows work the other way?
As in, they contract when being drawn, i.e. reloading, and then spring forward when fired. I'm not trying to insult you, but you may or may not want to change that.
As in, they contract when being drawn, i.e. reloading, and then spring forward when fired. I'm not trying to insult you, but you may or may not want to change that.
@Blue: Done! thx for the advice
@Paramecium: Yes, i know real bows work the other way hence my stating
But for a tute on rotation triggers and syncing'em up to weapon reloads (i.e. a cooldown timer), a slow snap back was more suitable.
@Paramecium: Yes, i know real bows work the other way hence my stating
If it were more accurate to a real bow you just need to turn the CW rot frames to something low so the bow draws and snaps back as soon as it fires.bow shaped..thing
But for a tute on rotation triggers and syncing'em up to weapon reloads (i.e. a cooldown timer), a slow snap back was more suitable.
-
- Commodore
- Posts: 721
- Joined: Mon Jun 30, 2008 7:49 am
- Location: "not here" would probably be accurate
-
- One-Ban Limit
- Posts: 73
- Joined: Wed Mar 11, 2009 10:39 am
So yes, it does have to do with the 120 framesFor a railgun the reload time is 120 frames.
Go back to the pivots' ED2 menu and set CCW Rot frames to 5, and CW Rot frames to 95.
When the weapon is fired, this results in the bow arm quickly drawing back, then slowly returning to the original position before standing still for 20 frames till the next shot.