Author Topic: help with traps  (Read 5652 times)

Raganoxer

  • Wannabe
  • Posts: 29
  • i make level and level accessories
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
help with traps
« on: January 03, 2015, 10:39:31 PM »
trying to code traps on yuutu engine to follow a path and cannot get them to work, i created the path to follow and all but it either A. refuses to move OR B. just moved one direction. What is the coding to make a spike follow a path?
~i make your fangames on LBP with hugs and kisses, don't worry they're good quality to LBP standards!

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #1 on: January 04, 2015, 01:12:49 AM »
It depends on which engine you use, but here's a reliable trigger code.
(click to show/hide)
Put this code in your playerKiller object step event (in the parent folder)
(click to show/hide)
In the playerKiller End of Path event, put this.
(click to show/hide)

If you want to make something follow different paths for multiple triggers, you can either learn to create a more complex trigger system or create a single object which has multiple actions for each trigger.
(click to show/hide)

smoke weed everyday

Raganoxer

  • Wannabe
  • Posts: 29
  • i make level and level accessories
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #2 on: January 04, 2015, 03:59:07 PM »
It depends on which engine you use, but here's a reliable trigger code.
(click to show/hide)
Put this code in your playerKiller object step event (in the parent folder)
(click to show/hide)
In the playerKiller End of Path event, put this.
(click to show/hide)

If you want to make something follow different paths for multiple triggers, you can either learn to create a more complex trigger system or create a single object which has multiple actions for each trigger.


I literally had no idea what you just said, only the parent function for player killer. I made a path for the spike to follow and set up the spike sorta like this
trg=7
t = 1
pth = path21
spd = 6
yet it never works, what am i doing wrong? i am using the yuutu engine
heres what i put listening to your instructions -> https://puu.sh/e4AIp/ddc8a95622.png
~i make your fangames on LBP with hugs and kisses, don't worry they're good quality to LBP standards!

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #3 on: January 05, 2015, 06:57:10 AM »
Put a trigger down and in its creation code type

tid=#(whatever number)

In the trap spike, put

tid=same #(so it activates when a tid of that id is true)
t=1(trigger action, which is path)
pth=path index
spd=number
enda and abso can be left empty.
(click to show/hide)

smoke weed everyday

Raganoxer

  • Wannabe
  • Posts: 29
  • i make level and level accessories
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #4 on: January 07, 2015, 01:14:37 AM »
Put a trigger down and in its creation code type

tid=#(whatever number)

In the trap spike, put

tid=same #(so it activates when a tid of that id is true)
t=1(trigger action, which is path)
pth=path index
spd=number
enda and abso can be left empty.

lol.. i think im ready to give up. ive been playing with this for 3 days now and i cannot, under any circumstances, get this to work.
could there be anything else i am possibly missing to have it not be working?
trigger also contains trg and tid with the same numbers as the spike -> https://puu.sh/eblE5/8575d20dc9.png
im just trying to have it move left and stop, but it either continues to move, or just doesnt move at all.
~i make your fangames on LBP with hugs and kisses, don't worry they're good quality to LBP standards!

ethinthenougathorn

  • Spike Dodger
  • Posts: 114
  • jung, brutal, gutaussehend
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 35.0.1916.153 Chrome 35.0.1916.153
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #5 on: January 07, 2015, 11:12:43 AM »
i can recommend decompiling some fangames that use triggers.
thats what i did and my triggers were working perfectly as i wanted them to.
If you wanna hang out youve got to take her out; cocaine.
If you wanna get down, down on the ground;
cocaine.
She don't lie, she don't lie, she don't lie;
cocaine.

Raganoxer

  • Wannabe
  • Posts: 29
  • i make level and level accessories
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #6 on: January 08, 2015, 12:30:06 AM »
i can recommend decompiling some fangames that use triggers.
thats what i did and my triggers were working perfectly as i wanted them to.

lol trust me i have tried that with enjoy the game 1 and 2.. is there any fangame you can name that provides an easy understanding of traps with paths? (if you can ones that are preferably small)
~i make your fangames on LBP with hugs and kisses, don't worry they're good quality to LBP standards!

FlyingTaoster

  • Wannabe
  • Posts: 28
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 34.0 Firefox 34.0
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #7 on: January 08, 2015, 12:41:06 AM »
One thing that really helped me understand how to do triggers was Lemon's Engine. He has code for the triggers and spikes that are rather easy to understand, so i'd suggest looking at that rather than hoping you can find a game to decompile.

Edit: Though it seems Lemon has taken his engine off the forum right now, so i don't know where you'd be able to get it
« Last Edit: January 08, 2015, 09:52:56 AM by FlyingTaoster »

Raganoxer

  • Wannabe
  • Posts: 29
  • i make level and level accessories
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #8 on: January 11, 2015, 03:17:53 PM »
One thing that really helped me understand how to do triggers was Lemon's Engine. He has code for the triggers and spikes that are rather easy to understand, so i'd suggest looking at that rather than hoping you can find a game to decompile.

Edit: Though it seems Lemon has taken his engine off the forum right now, so i don't know where you'd be able to get it

ohohoh trust me, i TRIED using that engine and they never work, could you explain? like whats the 31y negative thing? just list like basic coding to the traps and how to follow a path. whatever engine is easier ill go to it.
~i make your fangames on LBP with hugs and kisses, don't worry they're good quality to LBP standards!

Stinkycheeseone890

  • K i n g s t o n k y
  • Global Moderator
  • Wannabe
  • Posts: 26
  • Welcome to die!
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
    • My livestream!
  • Playstyle: Keyboard
Re: help with traps
« Reply #9 on: January 11, 2015, 08:57:36 PM »
Here's how I do it.
collision with player event:
(click to show/hide)

...that's it! This way, all of the triggers you might have are the same object. You just have to assign them idd's, along with the spikes you want to move. Like this:
(click to show/hide)
Now I'll explain what I did there. I gave that trigger an idd of 1, via the creation code method shown in the picture above.
I ALSO gave the spikes above an idd of 1, but it DOESN'T have to be the same number as the trigger that makes them move!
The code above states, if the TRIGGERS idd is 1, then the "playerKillers" (spikes) with an idd of 1 will have a vspeed of 4 when the trigger its touched by the kid. Here it is in action: https://gyazo.com/bc3706b5ac9f7bdee01a039c02bc8be4
You see, I gave all 4 of those spikes the idd of 1, and when I hit the trigger with the idd of 1, they went down! Now, I did the same thing with the next bit of code there, except it's a TINY bit more complicated, but not really. It triggers two spikes in two different ways! It gives them two different speeds. I gave one an hspeed of -1, and the other an hspeed of -3, with the same trigger. They have different idds, but the trigger still activates both of them. It makes the spike with an idd of 2 (the top spike) move at a slower speed than the spike with an idd of 3 (the bottom spike.) Oh, and the next trigger has the idd of 2, so it can actually activate them! Here's how it looks: https://gyazo.com/2e539e00b36d4770c6a93ea087d5819c

Oh, and I destroy the instance so it can't do the actions more than once.
You can add anything you'd like to it, this is how I do it. Provides a lot of leniency!

...now that may seem complicated, but it really isn't, most of that was just me explaining how it worked, haha!

(click to show/hide)

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #10 on: January 13, 2015, 02:46:54 PM »
gg, best triggers so far
(click to show/hide)

smoke weed everyday

Raganoxer

  • Wannabe
  • Posts: 29
  • i make level and level accessories
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.99 Chrome 39.0.2171.99
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #11 on: January 17, 2015, 11:07:41 PM »


 :atkHappy: progress so far, still confused with traps but with the help of you guys ill try to figure it out
~i make your fangames on LBP with hugs and kisses, don't worry they're good quality to LBP standards!

patrickgh3

  • Spike Dodger
  • Posts: 169
  • stay optimistic! :D
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
    • Github
  • Playstyle: Keyboard
Re: help with traps
« Reply #12 on: January 18, 2015, 04:14:38 AM »
I made a simple example in Game Maker with how I like to do triggers, and a few example triggered effects. It's attached to this post. Having a working example should help. The code should be easy to understand; go line by line and figure out why it works, and read the comments. I prefer to keep the logic of the triggered effects in their own objects, as opposed to Stinky's way of keeping the effect logic in multiple trigger objects, but both ways work fine.

Also, your screenshot looks pretty neat. :o

Raganoxer

  • Wannabe
  • Posts: 29
  • i make level and level accessories
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.99 Chrome 39.0.2171.99
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #13 on: January 19, 2015, 06:43:53 AM »
I made a simple example in Game Maker with how I like to do triggers, and a few example triggered effects. It's attached to this post. Having a working example should help. The code should be easy to understand; go line by line and figure out why it works, and read the comments. I prefer to keep the logic of the triggered effects in their own objects, as opposed to Stinky's way of keeping the effect logic in multiple trigger objects, but both ways work fine.

Also, your screenshot looks pretty neat. :o

Well.. i dont have game maker 8.1, i only have 8. and also i have been trying to figure it out for almost 7 hours of total time. I am a complete lost cause on this. from what i have gathered i make a path in paths, i name it, for the spike i have pth = whatever path it is, and trg = number. it doesnt work and i have made no progress, however i learned how to make snow

~i make your fangames on LBP with hugs and kisses, don't worry they're good quality to LBP standards!

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 39.0.2171.99 Chrome 39.0.2171.99
    • View Profile
  • Playstyle: Keyboard
Re: help with traps
« Reply #14 on: January 19, 2015, 01:14:17 PM »
Nice progress on your game! That aside, you don't have to use lemon triggers. You could also use stinkycheeseone890's triggers, those also look pretty cool. You'll have to do some of your own code, but if you can manage snow then I'm sure it'll be all good. I used his method and it's definitely really cool!

(click to show/hide)

smoke weed everyday