Mako's guide to triggers

Got questions about Shipmaker? Get answers here. Please read the stickied topics first!

Moderators: th15, Moderators

Mak0
Lieutenant
Lieutenant
Posts: 31
Joined: Tue Feb 17, 2009 6:54 am

Mako's guide to triggers

Post by Mak0 »

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

Image


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.
Image

Step 2.
On the yellow section create a top section. This will be the part of the gun that recoils.
Image

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.
Image
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.
Image

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.
Mak0
Lieutenant
Lieutenant
Posts: 31
Joined: Tue Feb 17, 2009 6:54 am

Post by Mak0 »

Tutorial 2. Making a bow
Image
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.
Image


Step 2.
Select the pivot point and change it's settings in edit to as follows:
Image
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.
Mak0
Lieutenant
Lieutenant
Posts: 31
Joined: Tue Feb 17, 2009 6:54 am

Post by Mak0 »

Reserved for pictorial goodness
D00D!
Commander
Commander
Posts: 174
Joined: Fri Jun 13, 2008 4:37 pm
Location: Frontlines againest a piggy invasion

Post by D00D! »

Gah! I've been beaten to it! :mrgreen:

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. :lol:

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!
Mak0
Lieutenant
Lieutenant
Posts: 31
Joined: Tue Feb 17, 2009 6:54 am

Post by Mak0 »

Lol, nice name, disgaea fan i assume?

Yeah, was planning on covering the more advanced stuff like rotations, timing and mirroring next.

Feel free to link away :roll:
Kaelis
Moderator
Posts: 1590
Joined: Fri Dec 14, 2007 4:46 am

Re: Mako's guide to triggers

Post by Kaelis »

Mak0 wrote:... and have seen very little information on how triggers work and operate on the forums ...
How about the documentation?

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.
Mak0
Lieutenant
Lieutenant
Posts: 31
Joined: Tue Feb 17, 2009 6:54 am

Post by Mak0 »

Hmm....i see what you mean. In that case i'll leave it at those two examples for those starting with triggers. :mrgreen:

Also, my bad, there is alot of information in the documentation and around the forums on triggers, but not many examples or explanations of how to implement them.
TheBlueEcho
Vice Admiral
Vice Admiral
Posts: 1435
Joined: Tue Dec 04, 2007 7:31 am

Post by TheBlueEcho »

Well, How about you Edit the first post with a link to the documentation stating that they should read it first, then give them guides and tuts on how to implement whats there. Some links to good ships that use Triggers and weapon linking would be good as well.
parameciumkid
Commander
Commander
Posts: 145
Joined: Mon Feb 16, 2009 10:24 pm
Location: In America!
Contact:

Post by parameciumkid »

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.
Mak0
Lieutenant
Lieutenant
Posts: 31
Joined: Tue Feb 17, 2009 6:54 am

Post by Mak0 »

@Blue: Done! thx for the advice

@Paramecium: Yes, i know real bows work the other way ;) hence my stating
bow shaped..thing
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.
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.
th15
Administrator
Posts: 947
Joined: Sun May 13, 2007 12:01 am

Post by th15 »

Good, guide, stickying.
Sean 'th15' Chan
[img]http://img63.imageshack.us/img63/6344/bfbanner2vy5.gif[/img]
pokd
Ensign
Ensign
Posts: 1
Joined: Mon Mar 09, 2009 12:05 am

Post by pokd »

what update do i need to use triggers and add in sprites, and where can i find it?
lightstriker
Commodore
Commodore
Posts: 721
Joined: Mon Jun 30, 2008 7:49 am
Location: "not here" would probably be accurate

Post by lightstriker »

www.wyrdysm.com
the download at the top of the page
:wink:
Zoid Crusader
One-Ban Limit
Posts: 73
Joined: Wed Mar 11, 2009 10:39 am

Post by Zoid Crusader »

I have a question why is it set to 5 and 95? does it have a reason? or does it have to do with 120?
Mak0
Lieutenant
Lieutenant
Posts: 31
Joined: Tue Feb 17, 2009 6:54 am

Post by Mak0 »

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.
So yes, it does have to do with the 120 frames :shock:
Locked