Author Topic: Spike Trigger Error in KS Engine  (Read 3085 times)

RandomFangamer

  • Cherry Eater
  • Posts: 71
  • Pico Pico Piiiiiii
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Firefox 40.0 Firefox 40.0
    • View Profile
  • Playstyle: Keyboard
Spike Trigger Error in KS Engine
« on: September 07, 2015, 09:46:38 AM »
Hey Guys  :atkHappy:
So I  was using the KS Engine and I was trying to make a spike trigger when I got this strange error:
Code: [Select]
FATAL ERROR in
action number 1
of  Step Event0
for object spikeUp:

Push :: Execution Error - Variable Get 100109.trg(100061, -2147483648)
 at gml_Object_spikeUp_StepNormalEvent_1 (line 2) - if (trg!=0) {
The step event in said spike:
(click to show/hide)
For some reason gamemaker is having trouble with
if (trg! = 0)

Spikes Creation Code:
Code: [Select]
trg = 2
vs = -5
hs = 0
Does anyone know what the problem here is?




:ItsBoshyTime: o o o o o :denProgress: o o o o o :paraKid:

klazen108

  • Administrator
  • The Kid
  • Posts: 286
  • your a kid now your a squid now
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 44.0.2403.155 Chrome 44.0.2403.155
    • View Profile
    • Delicious-Fruit
  • Playstyle: Keyboard
Re: Spike Trigger Error in KS Engine
« Reply #1 on: September 07, 2015, 10:58:46 AM »
You mention you set the trigger value in "Creation Code" - is this Instance Creation Code or in the Create Event? It shouldn't matter, but it would be good to confirm.

I just checked the engine myself, and it seems to work fine; can you confirm your code looks like the following?

Spike Instance Creation Code
(click to show/hide)

Trigger Instance Creation Code
(click to show/hide)

spikeUp Create Event & spikeUp Step Event
(click to show/hide)

Your step event looks correct, so we just need to find where the problem is. Which kind of spike are you using for this trigger? is it a spikeUp, or a different kind of spike? Is it a custom spike object? If so, show me the Create Event for it, I want to make sure trg is being initialized.

RandomFangamer

  • Cherry Eater
  • Posts: 71
  • Pico Pico Piiiiiii
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Firefox 40.0 Firefox 40.0
    • View Profile
  • Playstyle: Keyboard
Re: Spike Trigger Error in KS Engine
« Reply #2 on: September 07, 2015, 11:31:13 AM »
For some reason my create  event looks like this: (Don't know why I did that :atkWut:)
After correcting it, I get this error:
(click to show/hide)

Spike Creation Code:

Trigger:
(click to show/hide)
Also, I am using the creation code when you right click an object
Also Also, I am using the SpikeUp object, but plan on using custom spikes in the future
« Last Edit: September 07, 2015, 11:38:23 AM by RandomFangamer »




:ItsBoshyTime: o o o o o :denProgress: o o o o o :paraKid:

Anon70000

  • Cherry Eater
  • Posts: 50
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 39.0 Firefox 39.0
    • View Profile
  • Playstyle: Keyboard
Re: Spike Trigger Error in KS Engine
« Reply #3 on: September 07, 2015, 11:57:33 AM »
FATAL ERROR in
action number 1
of Other Event: Room Start
for object objTrigger:
Push :: Execution Error - Variable Get 100449.trg(100061, -2147483648)
 at gml_Object_objTrigger_StartRoomEvent_1 (line 1) - if (!persist) global.trigger[trg]=0;
Simplified: you need to initialize variables before using it, old GM had "treat uninitialized variables as 0", GM:S doesn't have that.
Problem is in objTrigger, check create event (not creation code) and type "trg=0;", it'll probably work

RandomFangamer

  • Cherry Eater
  • Posts: 71
  • Pico Pico Piiiiiii
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Firefox 40.0 Firefox 40.0
    • View Profile
  • Playstyle: Keyboard
Re: Spike Trigger Error in KS Engine
« Reply #4 on: September 07, 2015, 01:28:01 PM »
Old Message
(click to show/hide)


EDIT:
Alright, so I used a fresh version of the 0.8 KS Engine  and copied the spikeUp and Trigger object code into the old version, and now its giving me this error:

Code: [Select]
FATAL ERROR in
action number 1
of Other Event: Room Start
for object objTrigger:

Push :: Execution Error - Variable Get 100448.trg(100061, -2147483648)
 at gml_Object_objTrigger_StartRoomEvent_1 (line 1) - if (!persist) global.trigger[trg]=0;

EDIT EDIT:
YES, IT WORKS  :atkHappy:  :IceFairy: :paraKid: :tenKapple: :denMiku_v2:
Adding trg = 0 to Trigger + Copying the triggers + SpikeUp some how fixed it
To help anyone else tat is having this issue, ill describe it
(click to show/hide)
« Last Edit: September 07, 2015, 03:20:37 PM by RandomFangamer »




:ItsBoshyTime: o o o o o :denProgress: o o o o o :paraKid:

klazen108

  • Administrator
  • The Kid
  • Posts: 286
  • your a kid now your a squid now
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 45.0.2454.85 Chrome 45.0.2454.85
    • View Profile
    • Delicious-Fruit
  • Playstyle: Keyboard
Re: Spike Trigger Error in KS Engine
« Reply #5 on: September 10, 2015, 01:16:27 AM »
I had custom spikes, parented to SpikeUp

If you overwrite the events, make sure you do
Code: [Select]
event_inherited in the child events. Otherwise, the parent events don't get called. That might have had something to do with it.

RandomFangamer

  • Cherry Eater
  • Posts: 71
  • Pico Pico Piiiiiii
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 45.0.2454.85 Chrome 45.0.2454.85
    • View Profile
  • Playstyle: Keyboard
Re: Spike Trigger Error in KS Engine
« Reply #6 on: September 11, 2015, 09:05:56 PM »
Yeah, I believe it did
On the other hand, it all works and I'm able to start and stop spikes now




:ItsBoshyTime: o o o o o :denProgress: o o o o o :paraKid: