I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: RandomFangamer on September 07, 2015, 09:46:38 AM

Title: Spike Trigger Error in KS Engine
Post by: RandomFangamer 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?
Title: Re: Spike Trigger Error in KS Engine
Post by: klazen108 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.
Title: Re: Spike Trigger Error in KS Engine
Post by: RandomFangamer on September 07, 2015, 11:31:13 AM
For some reason my create  event looks like this: (https://imgur.com/YdZz7I1.png) (Don't know why I did that :atkWut:)
After correcting it, I get this error:
(click to show/hide)

Spike Creation Code: (https://i.imgur.com/brvaugF.png)

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
Title: Re: Spike Trigger Error in KS Engine
Post by: Anon70000 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
Title: Re: Spike Trigger Error in KS Engine
Post by: RandomFangamer 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)
Title: Re: Spike Trigger Error in KS Engine
Post by: klazen108 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.
Title: Re: Spike Trigger Error in KS Engine
Post by: RandomFangamer 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