Author Topic: The simplest of Triggers  (Read 1716 times)

RedSalamando

  • Wannabe
  • Posts: 5
  • I make games as good as I play them. Mediocrely.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 35.0.1916.153 Chrome 35.0.1916.153
    • View Profile
  • Playstyle: Keyboard
The simplest of Triggers
« on: July 13, 2014, 11:31:04 AM »
I just got into fan-game making yesterday, using Klazens well made guide on how to start, Ive gotton the hang of things, but theres just one thing I'm not understanding. And its probably the most vital of a fan-game.

I'd like to know how to make a trigger that destroys itself (you know, so the action cant happen again), and makes an object move in from somewhere, or say move a spike upwards until a certain position is reached (like hitting another invisible trigger to stop it from continuing).

I've read the guide a couple of times attempting to figure it out, but its all gibberish to me.

YoSniper

  • Awexome
  • Global Moderator
  • Spike Dodger
  • Posts: 142
  • People regard me as a programming overlord.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 35.0.1916.153 Chrome 35.0.1916.153
    • View Profile
    • My YouTube
  • Playstyle: Keyboard
Re: The simplest of Triggers
« Reply #1 on: July 13, 2014, 02:25:02 PM »
Upon collision with the trigger, you can tell the trigger instance to destroy itself. As in:

Code: [Select]
with(other) {instance_destroy();}
Just put that at the very end of the collision code. That should do the trick.
I don't traverse the forums as much anymore. Follow me on Twitter if you want to keep tabs on me!

Twitter: @YoSniperGames
Twitch: yosniper

Streams happen whenever I feel like it.

RedSalamando

  • Wannabe
  • Posts: 5
  • I make games as good as I play them. Mediocrely.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 35.0.1916.153 Chrome 35.0.1916.153
    • View Profile
  • Playstyle: Keyboard
Re: The simplest of Triggers
« Reply #2 on: July 13, 2014, 03:55:06 PM »
Thanks! I've got it down now!