MFGG Forums
  • Home
  • Members
  • Help
  • Search
MFGG Main Site MFGG Forums MFGG Developer Discussion v
« Previous 1 … 3 4 5 6 7 … 16 Next »
Error occured
MFGG Forums MFGG Developer Discussion v
« Previous 1 … 3 4 5 6 7 … 16 Next »
Error occured
MFGG Forums MFGG Developer Discussion v
« Previous 1 … 3 4 5 6 7 … 16 Next »
Error occured
Mark All Posts Read Today's Posts

Pages (2): 1 2 Next »
Error occured
goh
Koopa
Members
#1
12-17-2020, 01:14 PM
I was creating a solid bubble item (You know, from Mario Advance). But the error has occured!
Check here:
Code:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_solidbubble:


Variable obj_solidbubble.item(100225, -2147483648) not set before reading it.
at gml_Object_obj_solidbubble_DrawEvent_1 (line 1) - if item = 3  ############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_solidbubble_DrawEvent_1 (line 1)
Can anyone help me on this please?

  ↳
Turkey Mors
hey guys
Site Developer
Forum Moderator Main Site Moderator Discord Admin Site Developer/Webmasters Social Media Manager Submitter Super Reviewer Iso Collab Contributor Sprite Comp Runner-Up (2) Sprite Comp Top 5 Minigame Comp Runner-Up (2) Minigame Comp Top 5 (5) Music Comp Top 5 (2) Egg Hunter Skull Badge (2) E3 Bingo Event Winner Game of the Month Winner NCFC Contributor Secret Santa Holiday Tree MFGG 17th Anniversary MFGG 18th Anniversary MFGG 19th Anniversary MFGG Awards 2014 Winner MFGG Awards 2015 Winner MFGG Awards 2016 Winner MFGG Awards 2017 Winner (2) MFGG Awards 2018 Winner MFGG Awards 2019 Winner MFGG Awards 2020 Winner
#2
12-17-2020, 01:29 PM
Please post your development-related questions to Developer Discussion, and not Suggestions. I moved both of your threads for now though.

As for your question, the error says that you did not set a variable called "item". Add a line like "item = 0;" to the create event of your object.
3DS: 4313-6691-8820
Switch: SW-7679-1093-9792

play my fangame pls

  ↳
LGBTQ+ Pride Pedigree
Resident Furry Degenerate
Members
Big Help Submitter Super Submitter Super Reviewer Iso Collab Contributor (3) Sprite Comp Winner Sprite Comp Top 5 Minigame Comp Winner (2) Drawing Comp Runner-Up Drawing Comp Top 5 Skull Badge (2) Secret Santa (2) Holiday Tree Good Citizen MFGG 17th Anniversary MFGG 18th Anniversary MFGG 19th Anniversary Ye Olde MFGGe Retro Game Jam Participant MFGG Awards 2017 Winner
#3
12-17-2020, 01:30 PM (This post was last modified: 12-17-2020, 01:36 PM by Pedigree.)
(12-17-2020, 01:14 PM)goh Wrote: I was creating a solid bubble item (You know, from Mario Advance). But the error has occured!
Check here:
Code:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_solidbubble:


Variable obj_solidbubble.item(100225, -2147483648) not set before reading it.
at gml_Object_obj_solidbubble_DrawEvent_1 (line 1) - if item = 3  ############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_solidbubble_DrawEvent_1 (line 1)
Can anyone help me on this please?
You are calling for .item variable before it has been set. Remove reference to the variable in the draw event and it should work fine. You cannot reference the object's variable when you are drawing it because the draw event happens before any other event on an object in Game Maker.

(12-17-2020, 01:29 PM)Mors Wrote: As for your question, the error says that you did not set a variable called "item". Add a line like "item = 0;" to the create event of your object.

Draw event happens before create event in Game Maker so that will not work as far as I know, it will still throw this error.
 

  ↳
China Hyper
Ambitious but too burnt out
Members
assholw adminy Big Help Submitter Super Reviewer Wiki Contributor Iso Collab Contributor Sprite Comp Winner (3) Sprite Comp Runner-Up (4) Sprite Comp Top 5 (2) Minigame Comp Winner (4) Minigame Comp Runner-Up (2) Music Comp Winner Music Comp Runner-Up Music Comp Top 5 Drawing Comp Winner (3) Drawing Comp Runner-Up Drawing Comp Top 5 (5) Special Comp Winner Egg Hunter (3) Skull Badge (2) E3 Bingo Game of the Month Winner (5) NCFC Contributor (4) Secret Santa (5) Holiday Tree NPGA Distinguished Service MFGG 17th Anniversary MFGG 18th Anniversary MFGG 19th Anniversary Ye Olde MFGGe Retro Game Jam Participant MFGG Awards 2010 Winner MFGG Awards 2012 Winner MFGG Awards 2013 Winner MFGG Awards 2014 Winner MFGG Awards 2015 Winner MFGG Awards 2018 Winner MFGG Awards 2019 Winner MFGG Awards 2020 Winner
#4
12-17-2020, 01:47 PM
If you're using Game Maker 8/8.1, be sure to check "treat uninitialized variables as 0". If you're using Game Maker Studio, good luck on porting it.
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
goh
Koopa
Members
#5
12-17-2020, 02:52 PM
(12-17-2020, 01:30 PM)Pedigree Wrote:
(12-17-2020, 01:14 PM)goh Wrote: I was creating a solid bubble item (You know, from Mario Advance). But the error has occured!
Check here:
Code:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_solidbubble:


Variable obj_solidbubble.item(100225, -2147483648) not set before reading it.
at gml_Object_obj_solidbubble_DrawEvent_1 (line 1) - if item = 3  ############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_solidbubble_DrawEvent_1 (line 1)
Can anyone help me on this please?
You are calling for .item variable before it has been set. Remove reference to the variable in the draw event and it should work fine. You cannot reference the object's variable when you are drawing it because the draw event happens before any other event on an object in Game Maker.

(12-17-2020, 01:29 PM)Mors Wrote: As for your question, the error says that you did not set a variable called "item". Add a line like "item = 0;" to the create event of your object.

Draw event happens before create event in Game Maker so that will not work as far as I know, it will still throw this error.

I know. I'm using Game Maker Studio. Also another error occured too. Look here:
Code:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_solidbubble:


Variable obj_solidbubble.item(100225, -2147483648) not set before reading it.
at gml_Object_obj_solidbubble_DrawEvent_1 (line 1) - if item = 3  ############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_solidbubble_DrawEvent_1 (line 1)

  ↳
United States CGWorks
Hammer Bro
Members
#6
12-17-2020, 03:00 PM
it appears to be the same type of error you showed previously.

In this case the variable name "item" has not been initialized by the time the draw event is reached. In the create event, put:

item = 0

this should solve the problem

  ↳
goh
Koopa
Members
#7
12-17-2020, 03:16 PM
(12-17-2020, 03:00 PM)smbmaster99 Wrote: it appears to be the same type of error you showed previously.

In this case the variable name "item" has not been initialized by the time the draw event is reached. In the create event, put:

item = 0

this should solve the problem

I did. And I'm focusing on this error now here:
Code:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_solidbubble:


Variable obj_solidbubble.item(100225, -2147483648) not set before reading it.
at gml_Object_obj_solidbubble_DrawEvent_1 (line 1) - if item = 3  ############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_solidbubble_DrawEvent_1 (line 1)

  ↳
LGBTQ+ Pride Pedigree
Resident Furry Degenerate
Members
#8
12-17-2020, 03:56 PM (This post was last modified: 12-17-2020, 04:03 PM by Pedigree.)
That is the same exact error you've already shown.

The draw event occurs before the create event which means the variable won't be defined when you are calling for it, so you can't refer to the variable in that draw event. Remove all references to the "item" variable in the draw event and this error will no longer trouble you.

What even are you trying to do with a variable in the draw event? Post the whole code of your draw event here.
 

  ↳
goh
Koopa
Members
#9
12-17-2020, 04:28 PM
(12-17-2020, 03:56 PM)Pedigree Wrote: That is the same exact error you've already shown.

The draw event occurs before the create event which means the variable won't be defined when you are calling for it, so you can't refer to the variable in that draw event. Remove all references to the "item" variable in the draw event and this error will no longer trouble you.

What even are you trying to do with a variable in the draw event? Post the whole code of your draw event here.

Okay, if you say so.
Code:
if item = 3
    draw_sprite_ext(sprite_index,item,x,y,zoom,zoom,0,c_white,1)
else
    draw_sprite(sprite_index,item,x,y)
draw_sprite_ext(sprite_index,0,x,y,zoom,zoom,0,c_white,1)

  ↳
LGBTQ+ Pride Pedigree
Resident Furry Degenerate
Members
#10
12-17-2020, 05:40 PM
Ok I have no clue what you're trying to accomplish with that.

Please provide some context to what this code is intended to do.


If "item" is a variable for what item Mario is currently using (and thus would be defined on Mario), then you're not referencing Mario's item variable directly: For example: obj_mario.item would be how you'd reference that. Currently Game Maker thinks you're referencing obj_solidbubble's own item variable and it can't call on a variable before you have defined it.
 

  ↳
goh
Koopa
Members
#11
12-17-2020, 06:38 PM
(12-17-2020, 05:40 PM)Pedigree Wrote: Ok I have no clue what you're trying to accomplish with that.

Please provide some context to what this code is intended to do.


If "item" is a variable for what item Mario is currently using (and thus would be defined on Mario), then you're not referencing Mario's item variable directly: For example: obj_mario.item would be how you'd reference that. Currently Game Maker thinks you're referencing obj_solidbubble's own item variable and it can't call on a variable before you have defined it.
I'm trying to have that Mario Advance Solid Bubble to the game. I'm serious.

  ↳
LGBTQ+ Pride Pedigree
Resident Furry Degenerate
Members
#12
12-17-2020, 07:50 PM (This post was last modified: 12-17-2020, 07:51 PM by Pedigree.)
You're talking about that bubble that holds items?

You don't need to change the sprite in the draw event to change which item it's holding. You can change the sprite index in the step event based on the value of the item variable
 

  ↳
goh
Koopa
Members
#13
12-17-2020, 07:53 PM
(12-17-2020, 07:50 PM)Pedigree Wrote: You're talking about that bubble that holds items?

You don't need to change the sprite in the draw event to change which item it's holding. You can change the sprite index in the step event based on the value of the item variable

How do I do that?

  ↳
LGBTQ+ Pride Pedigree
Resident Furry Degenerate
Members
#14
12-17-2020, 07:55 PM (This post was last modified: 12-17-2020, 07:57 PM by Pedigree.)
In the step event:
Code:
if item = 0 {
sprite_index = bubble_empty;
//any additional code like if you want an empty bubble to float faster since nothing is in it.
}

if item = 1 {
sprite_index = bubble_shroom;
//any additional code.
}

if item = 2 {
sprite_index = bubble_fflower;
//any additional code.
}

and so on. Your sprite names may be different.
 

  ↳
goh
Koopa
Members
#15
12-17-2020, 07:59 PM (This post was last modified: 12-17-2020, 08:05 PM by goh.)
(12-17-2020, 07:55 PM)Pedigree Wrote: In the step event:
Code:
if item = 0 {
sprite_index = bubble_empty;
//any additional code like if you want an empty bubble to float faster since nothing is in it.
}

if item = 1 {
sprite_index = bubble_shroom;
//any additional code.
}

if item = 2 {
sprite_index = bubble_fflower;
//any additional code.
}

and so on. Your sprite names may be different.

I'm using Hello Mario Engine. So you know.

(12-17-2020, 07:59 PM)goh Wrote:
(12-17-2020, 07:55 PM)Pedigree Wrote: In the step event:
Code:
if item = 0 {
sprite_index = bubble_empty;
//any additional code like if you want an empty bubble to float faster since nothing is in it.
}

if item = 1 {
sprite_index = bubble_shroom;
//any additional code.
}

if item = 2 {
sprite_index = bubble_fflower;
//any additional code.
}

and so on. Your sprite names may be different.

I'm using Hello Mario Engine. So you know.
Wait a minute, I'm talking about SMA1 solid bubbles, the ones that are hit by veggies! Not SMW bubbles.

  ↳
LGBTQ+ Pride Pedigree
Resident Furry Degenerate
Members
#16
12-17-2020, 08:32 PM (This post was last modified: 12-17-2020, 08:34 PM by Pedigree.)
(12-17-2020, 07:59 PM)goh Wrote: I'm using Hello Mario Engine. So you know.

Ok, and?
Quote:Wait a minute, I'm talking about SMA1 solid bubbles, the ones that are hit by veggies! Not SMW bubbles.
The bubbles in SMA1 hold 1up mushrooms. Your draw event code seems to be changing the sprite index depending on whether or not it is holding an item or is empty. Either way, the code example I provided will help you.

It really doesn't matter which bubble you're talking about, you don't need to change the sprite in the draw event.
 

  ↳
goh
Koopa
Members
#17
12-17-2020, 09:07 PM
(12-17-2020, 08:32 PM)Pedigree Wrote:
(12-17-2020, 07:59 PM)goh Wrote: I'm using Hello Mario Engine. So you know.

Ok, and?
Quote:Wait a minute, I'm talking about SMA1 solid bubbles, the ones that are hit by veggies! Not SMW bubbles.
The bubbles in SMA1 hold 1up mushrooms. Your draw event code seems to be changing the sprite index depending on whether or not it is holding an item or is empty. Either way, the code example I provided will help you.

It really doesn't matter which bubble you're talking about, you don't need to change the sprite in the draw event.

How do I really do that? I use Hello Mario Engine whatsoever.

  ↳
China Hyper
Ambitious but too burnt out
Members
#18
12-18-2020, 01:54 AM
Based on your error. You should definitely put item = 0; at the creation event as it always goes before any other event. You can assign custom items using instance creation codes in the room editor. The instance creation codes will run after the creation event.

We're trying to help but the discussion keeps dragging on and going off a bit tangent.

Regardless, as someone who's very experienced with Game Maker Studio 1.4. I would highly advise against porting a GMK (Game Maker 8.0) into a GMX. Especially Hello Engines and frameworks based on Hello Mario Engine. I've done it before with Gatete's SMB1 Engine (has similar logics compared to Hello Mario Engine). It's very tedious and difficult even for an experienced developer. If you can, I would advise to get a copy of the Game Maker 8.0 Pro. I'm sorry but you have to Google it for legal reasons.
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
Turkey Mors
hey guys
Site Developer
#19
12-18-2020, 01:41 PM
This thread is giving me a headache.
(12-17-2020, 01:47 PM)Hypernova Wrote: If you're using Game Maker 8/8.1, be sure to check "treat uninitialized variables as 0".
This is a terrible advice to give anyone as that option only allowed people to get away with terrible code and hid errors that would otherwise show up. Thank god they removed it in GMS...
(12-17-2020, 07:50 PM)Pedigree Wrote: You're talking about that bubble that holds items?

You don't need to change the sprite in the draw event to change which item it's holding. You can change the sprite index in the step event based on the value of the item variable
He isn't changing the sprite in the draw event, how did you come up to that conclusion? What his code does is that if the item number is 3 it draws the item with scaling.
(12-18-2020, 01:54 AM)Hypernova Wrote: Regardless, as someone who's very experienced with Game Maker Studio 1.4. I would highly advise against porting a GMK (Game Maker 8.0) into a GMX. Especially Hello Engines and frameworks based on Hello Mario Engine. I've done it before with Gatete's SMB1 Engine (has similar logics compared to Hello Mario Engine). It's very tedious and difficult even for an experienced developer. If you can, I would advise to get a copy of the Game Maker 8.0 Pro. I'm sorry but you have to Google it for legal reasons.

???

Am I missing something here? He never even mentioned porting a GM8 game to GMS. Even then, it's tedious but often worth the effort considering how outdated GM8 is at this point.

And goh, 3 different people gave you the answer, just add "item = 0" to the create event. That's all you gotta do to fix it.
3DS: 4313-6691-8820
Switch: SW-7679-1093-9792

play my fangame pls

  ↳
China Hyper
Ambitious but too burnt out
Members
#20
12-18-2020, 02:22 PM (This post was last modified: 12-18-2020, 02:22 PM by Hyper.)
mors Wrote:
(12-18-2020, 01:54 AM)Hypernova Wrote: Regardless, as someone who's very experienced with Game Maker Studio 1.4. I would highly advise against porting a GMK (Game Maker 8.0) into a GMX. Especially Hello Engines and frameworks based on Hello Mario Engine. I've done it before with Gatete's SMB1 Engine (has similar logics compared to Hello Mario Engine). It's very tedious and difficult even for an experienced developer. If you can, I would advise to get a copy of the Game Maker 8.0 Pro. I'm sorry but you have to Google it for legal reasons.

???

Am I missing something here? He never even mentioned porting a GM8 game to GMS. Even then, it's tedious but often worth the effort considering how outdated GM8 is at this point.

And goh, 3 different people gave you the answer, just add "item = 0" to the create event. That's all you gotta do to fix it.

He didn't mention that he's porting it but he did asked for the source of SAB's Hello Engine 6 Fan Made on a different topic. I linked to the topic where Langton uploaded the source and it's in GMK format. They said they're using Game Maker Studio.

As for the GM8 treating uninitialized variables, yeah it's the lazy way to resolve the issue and not helpful in the long run.
[Image: Hyper86-Camry.png]

Main Site | YouTube | Bluesky | My OC


  ↳
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (2): 1 2 Next »


  • View a Printable Version
Forum Jump:

Mario Fan Games Galaxy - Powered by MyBB | MFGG Staff | Contact Us

Linear Mode
Threaded Mode