Working HTML5 project, fatal error with Android
#1
Posted 13 June 2012 - 05:58 PM
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
#2
Posted 13 June 2012 - 06:53 PM
#3
Posted 13 June 2012 - 11:26 PM
No it doesn't work with windows. I get the following error:Does it work in windows?
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.
#4
Posted 14 June 2012 - 10:05 AM
Russell
#5
Posted 14 June 2012 - 11:50 AM
Thanks. I am a bit embarrassed to admit I will have to now figure out how to assign a variable.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
#6
Posted 14 June 2012 - 01:52 PM
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.
#7
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?
#8
Posted 14 June 2012 - 05:57 PM
#9
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.
#10
Posted 16 June 2012 - 04:39 AM
#11
Posted 17 June 2012 - 10:13 AM
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 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











