Jump to content


Photo

Working HTML5 project, fatal error with Android


  • Please log in to reply
10 replies to this topic

#1 peter879

peter879

    GMC Member

  • GMC Member
  • 67 posts
  • Version:GM:Studio

Posted 13 June 2012 - 05:58 PM

Hello

I have this code using DnD for F1 key, obj_main_player:

sprite_index=spri_pos_1

if there is a collision at a position for all obj_zillion...

start of block
for all obj_zillion change instance into object_player2, yes perfoming events
end of block

The game works fine with html5, but when i create android app, i get the following error:

fatal error in action number 1 of keyboard event for F1 key for obj_main_player

What could be the problem?

Thanks
  • 0

#2 Mike.Dailly

Mike.Dailly

    Evil YoYo Games Employee

  • Administrators
  • 1482 posts
  • Version:GM:Studio

Posted 13 June 2012 - 06:53 PM

Does it work in windows?
  • 0

#3 peter879

peter879

    GMC Member

  • GMC Member
  • 67 posts
  • Version:GM:Studio

Posted 13 June 2012 - 11:26 PM

Does it work in windows?

No it doesn't work with windows. I get the following error:


FATAL ERROR in
action number 1
of Keyboard Event for F5 Key
for object obj_main_player:

#####
VMError!! Occurred - Push :: Execution Error - Variable Get __b__
at gml_obj_main_player_Keyboard_116 (line 10) - if __b__

NB: this time i hit F5 key. same situation with F1 ie all collisions are producing this kind of error.
  • 0

#4 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 1407 posts
  • Version:Unknown

Posted 14 June 2012 - 10:05 AM

you have a variable you are using called __b__ that is unassigned (GM:Studio does not support treat uninitialised variables as 0) you need to ensure it is assigned.

Russell
  • 0

#5 peter879

peter879

    GMC Member

  • GMC Member
  • 67 posts
  • Version:GM:Studio

Posted 14 June 2012 - 11:50 AM

you have a variable you are using called __b__ that is unassigned (GM:Studio does not support treat uninitialised variables as 0) you need to ensure it is assigned.

Russell

Thanks. I am a bit embarrassed to admit I will have to now figure out how to assign a variable.
  • 0

#6 origamihero

origamihero

    GMC Member

  • GMC Member
  • 26 posts
  • Version:Unknown

Posted 14 June 2012 - 01:52 PM

You could make a script that runs at Game Start to initialize your variable.

Like this:

bobo=0;

You've now assigned a variable called bobo. You can set and retrieve it at any time now. (Do this with your __b__ variable.)

You can set/get it with object.bobo from other scripts.
  • 0

#7 peter879

peter879

    GMC Member

  • GMC Member
  • 67 posts
  • Version:GM:Studio

Posted 14 June 2012 - 03:00 PM

You could make a script that runs at Game Start to initialize your variable.

Like this:

bobo=0;

You've now assigned a variable called bobo. You can set and retrieve it at any time now. (Do this with your __b__ variable.)

You can set/get it with object.bobo from other scripts.


Problem is that I have this code (like above):

if there is a collision at a position for all obj_zillion...

start of block
for all obj_zillion change instance into object_player2, yes perfoming events
end of block

so the __b__ variable is actually an object (obj_zillion).

Is it a situation of an object being misread as a variable?

Because the variable, if I can call it that, is the position of the object ( obj_zillion is in motion).

Another problem could be, the obj_zillion is created after another collision.

Ie, I have an object, call it A, collides with

obj_main_player:

sprite_index=spri_pos_1

to change into B ( obj_zillion).

Now, B moves a bit and then later collides with same
obj_main_player:

sprite_index=spri_pos_1

to create object C.

Now, how do I go about assigning/initialising variables here?
  • 0

#8 origamihero

origamihero

    GMC Member

  • GMC Member
  • 26 posts
  • Version:Unknown

Posted 14 June 2012 - 05:57 PM

I thought variable __b__ was something you used in your code somewhere. If that's not the case the problem must be something else... :/
  • 0

#9 peter879

peter879

    GMC Member

  • GMC Member
  • 67 posts
  • Version:GM:Studio

Posted 15 June 2012 - 11:16 AM

I thought variable __b__ was something you used in your code somewhere. If that's not the case the problem must be something else... :/


No i got no such variable __b__.


I think I may want to initialise all instances just to be sure because its 2 days now and the problem is not yet solved. How do I initialise all instances/objects at once? Because I figure initialising one by one is a bit tedious unless there's no way to do it at once.

I have tried so many methods I have found here but none works so far, and I still get:

FATAL ERROR in
action number 1
of Keyboard Event for F1 Key...

VMError!! Occurred - Push :: Execution Error - Variable Get __b__ ...


yet i have no such variable called __b__


NOTE: The game works fine with html5 but not with WINDOWS or Android

Any help appreciated.
  • 0

#10 origamihero

origamihero

    GMC Member

  • GMC Member
  • 26 posts
  • Version:Unknown

Posted 16 June 2012 - 04:39 AM

Can you upload a small example game that demonstrates the error?
  • 0

#11 peter879

peter879

    GMC Member

  • GMC Member
  • 67 posts
  • Version:GM:Studio

Posted 17 June 2012 - 10:13 AM

Apparently every object in windows is referred to as _b_, at least in my game.
I tried all ways of initialising instances but it didn't work.

I have decided to change way collisions are defined in the game, and now it works. Can't tell where exactly the problem was, I suppose there were multiple problems.

Solved.

Edited by peter879, 17 June 2012 - 08:16 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users