• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Background floaters

This problem has been bugging me for a while. I've taken every step I could to debug it. One of my character instead of
being a storm brain it shows up as the text "Verite." In image attached you can see the white "verite" text. Before this
it showed up as "indigo" and I deleted the indigo object. Its just hopping down the resource tree.

I did a search for "indigo" and "verite" and nothing out of the ordinary shows up.

(edit)

I just noticed that when I drop a lightning bat it doesn't do the "cape" like I had posted before. Instead of half a curtain moving across the screen when you
drop the lightning bat, it shows a dead dr. frankenstein. on top of the castle to the left. Unfortunately that doesn't help me with the verite text.

So I'm just looking for some suggestions. Thanks.


TWRaven
 

Attachments

Yal

šŸ§ *penguin noises*
GMC Elder
Try cleaning the cache (broom icon next to the "test play" icons), it could be a cache corruption messing up your texture pages.
 

Nidoking

Member
You probably need to go through all of your code again and make sure that:
When you need a sprite, you're using a sprite resource ID.
When you need a sound, you're using a sound resource ID.
When you need an object, you're using an object resource ID.
When you need a room, you're using a room resource ID.
etc.
 
Sounds ideal but it is actually cumbersome since each of those resource IDs without a strategy to search is exponential
I have sprites, sounds, objects, and rooms in the plentiful. I can't imagine going through this all the sprites, sounds, objects, and rooms without
having strategy.

@Yal Hi Yal. I tried flushing the cache without result.
 
Sounds ideal but it is actually cumbersome since each of those resource IDs without a strategy to search is exponential
The strategy to search is to go down the resource tree and search for each item, and check that each find is doing exactly what it should be for that item, eg: if you are searching for a sprite then it should only be in calls to sprite functions (draw_sprite*, etc).
If you won't go through this process, then I doubt that anyone else will want to do it for you. Alternatively do what I did the last time I went through the code for you, and find where it is doing that piece of code and just check that bit to make sure you are using the correct resource. The last time you were supposed to be calling an object (if I remember correctly) yet you were passing into the function a sprite resource which meant it was using a different id instead of the one you wanted.
 

chamaeleon

Member
Don't limit yourself to what the GMS IDE can do. You have a full operating system at your disposal. If you have strings like verite showing up on the screen and they are in fact strings and not a sprite/image with the text pained on it, odds are using, say, Powershell to find instances of it will tell you something that perhaps the IDE does not. In a Powershell command prompt, cd to your game directory and try something like
Code:
gci -r  | select-string -pattern "verite"
 
The strategy to search is to go down the resource tree and search for each item, and check that each find is doing exactly what it should be for that item, eg: if you are searching for a sprite then it should only be in calls to sprite functions (draw_sprite*, etc).
If you won't go through this process, then I doubt that anyone else will want to do it for you. Alternatively do what I did the last time I went through the code for you, and find where it is doing that piece of code and just check that bit to make sure you are using the correct resource. The last time you were supposed to be calling an object (if I remember correctly) yet you were passing into the function a sprite resource which meant it was using a different id instead of the one you wanted.
I'm not asking anyone to do anything for my game. I may ask for strategy here and there but i've gotten more experience now on GMS 2 that I don't need as much help. When we talked last I'm assuming you went through my code. I 've learned a lot since and I only ask to point me in the right direction when I post to this forum. That I want people to write my code for me is a misconception.
 
That I want people to write my code for me is a misconception.
I never said you wanted people to write code for you.
I'm not asking anyone to do anything for my game.
You asked for someone to tell you what you should do and you received a reply telling you exactly what you needed to do (from Nidoking). Your very next post you were virtually saying that you wouldn't do it:
I can't imagine going through this all the sprites, sounds, objects, and rooms without having strategy.
That basically sounds like you aren't going to do what has been suggested, even though it is exactly what you should be doing, so my response still stands: if you won't do it, then nobody else will either (and nowhere did I say that you were asking for someone to do it for you, just that you had to be aware that if you won't do it you can't expect much help from people when the thing you should be doing has already been suggested).
When we talked last I'm assuming you went through my code.
As I said at the time, and in my previous post, I went straight to the part where it was doing exactly the problem you raised and just looked at that bit of code - exactly what you should be doing initially in this instance too - and by actually looking at things and using the debugger I found the problem where you were using the wrong resource type.
 
I never said you wanted people to write code for you.

You asked for someone to tell you what you should do and you received a reply telling you exactly what you needed to do (from Nidoking). Your very next post you were virtually saying that you wouldn't do it:

That basically sounds like you aren't going to do what has been suggested, even though it is exactly what you should be doing, so my response still stands: if you won't do it, then nobody else will either (and nowhere did I say that you were asking for someone to do it for you, just that you had to be aware that if you won't do it you can't expect much help from people when the thing you should be doing has already been suggested).

As I said at the time, and in my previous post, I went straight to the part where it was doing exactly the problem you raised and just looked at that bit of code - exactly what you should be doing initially in this instance too - and by actually looking at things and using the debugger I found the problem where you were using the wrong resource type.
You probably need to go through all of your code again and make sure that:
When you need a sprite, you're using a sprite resource ID.
When you need a sound, you're using a sound resource ID.
When you need an object, you're using an object resource ID.
When you need a room, you're using a room resource ID.
etc.
Above. The reason I didn't go with what @Nidoking suggested is because 1. I don't understand what he is saying. 2. It appears to me that it would take a insane amount of time. So I assumed that I didn't understand @Nidoking

This whole thing is about coding and strategy. I'd don't have a strategy I understand. My current strategy is obviously wrong. But I'm sorry I don't understand @Nidoking's solution. You have to understand part of my problems is I'm simply not understanding the massive amount of experience you have than I do. I'm being seriously. Some of you have been using Game Maker since the first "edititon" of it. (1.4?).

The strategy to search is to go down the resource tree and search for each item, and check that each find is doing exactly what it should be for that item, eg: if you are searching for a sprite then it should only be in calls to sprite functions (draw_sprite*, etc).
If you won't go through this process, then I doubt that anyone else will want to do it for you. Alternatively do what I did the last time I went through the code for you, and find where it is doing that piece of code and just check that bit to make sure you are using the correct resource. The last time you were supposed to be calling an object (if I remember correctly) yet you were passing into the function a sprite resource which meant it was using a different id instead of the one you wanted.
I do not understand a bit of this. (above)

@BaBiA Game Studio
I never said you wanted people to write code for you.
Master Cabalist said:
I'm not asking anyone to do anything for my game.
You asked for someone to tell you what you should do and you received a reply telling you exactly what you needed to do (from Nidoking). Your very next post you were virtually saying that you wouldn't do it:
Master Cabalist said:
I can't imagine going through this all the sprites, sounds, objects, and rooms without having strategy.
That basically sounds like you aren't going to do what has been suggested, even though it is exactly what you should be doing, so my response still stands: if you won't do it, then nobody else will either (and nowhere did I say that you were asking for someone to do it for you, just that you had to be aware that if you won't do it you can't expect much help from people when the thing you should be doing has already been suggested).
Master Cabalist said:
When we talked last I'm assuming you went through my code.
As I said at the time, and in my previous post, I went straight to the part where it was doing exactly the problem you raised and just looked at that bit of code - exactly what you should be doing initially in this instance too - and by actually looking at things and using the debugger I found the problem where you were using the wrong resource type.
I boils down to this I am a novice in regards to game maker studio and when I ask for some help, I get scolded by the senior members of this forum.
I went down the resource tree already. This thing we are discussing has been already performed. In fact scanned down the resource tree and ran through the debugger. I know what objects are in play. I need to know *how* they are in play.

In Short:

There are multiple object on my resource tree that are under the group Achievements. The first achievement "Indigo" showed up. So I deleted indigo from the resource tree. I ran the game again and now then next one down is "Agapite" Now instead of "indigo" there is "agapite". And it moves down the resource tree. I've all but deleted all of the achievements.
 

Nidoking

Member
If you don't understand the difference between a sprite, a sound, a room, and an object, I don't think the problem is your level of experience with Game Maker. You may just have difficulty with concepts as a whole. You don't need a strategy to tell you that attempting to draw a sound to the screen is wrong. You don't need a strategy to tell you that you can't change rooms to "SentryBatParent". You just need the most basic understanding of what a discrete thing is. That's not something the forum can help you with. I'm not sure anyone can help you with that.

My original suggestion was that you would most quickly get to your destination by deleting everything in your game, then making the game you want to make. I am no longer convinced that the second half of my suggestion is going to get you closer to where you want to be. Perhaps the Collaboration forum would suit your skill set better.
 
If you don't understand the difference between a sprite, a sound, a room, and an object, I don't think the problem is your level of experience with Game Maker. You may just have difficulty with concepts as a whole. You don't need a strategy to tell you that attempting to draw a sound to the screen is wrong. You don't need a strategy to tell you that you can't change rooms to "SentryBatParent". You just need the most basic understanding of what a discrete thing is. That's not something the forum can help you with. I'm not sure anyone can help you with that.
I know what a different between a sprite a sound a room and an object. I think it is the level of experience with Game Maker. I have a Masters degree in Computer Science. I"ve been coding for over 20 years. I'm insulted by your:
GML:
If you don't understand the difference between a sprite, a sound, a room, and an object, I don't think the problem is your level of experience with Game Maker
Maybe you should look at yourself and how you explain things to people.

Coding isn't my problem. That's all I have to say to you again about this.
 
So anybody else have any other ideas?
Let me sum this up again.. For some reason draw text draws far away in the background floating around
 

pipebkOT

Member
about the original post, maybe you have a draw event with a draw_text code in it, but you forgot to put the draw_self(), so it only draws the text.

when a draw event is present in a object, it doesn't draw the sprite if draw_self() is not present.
 
In Short:

There are multiple object on my resource tree that are under the group Achievements. The first achievement "Indigo" showed up. So I deleted indigo from the resource tree. I ran the game again and now then next one down is "Agapite" Now instead of "indigo" there is "agapite". And it moves down the resource tree. I've all but deleted all of the achievements.
I suspect that you are most likely doing the same mistake that you did when I last checked your code. You are probably calling something like instance_create_* and instead of giving an object resource into the function, you are probably passing in a sprite resource (or vice-versa with draw_sprite* and an object resource).

That would explain why it is that the first achievement object is always the one being shown because the id of the resource you are incorrectly passing to the function matches the id of the first achievement object resource.

You probably need to go through all of your code again and make sure that:
When you need a sprite, you're using a sprite resource ID.
When you need a sound, you're using a sound resource ID.
When you need an object, you're using an object resource ID.
When you need a room, you're using a room resource ID.
etc.
Above. The reason I didn't go with what @Nidoking suggested is because 1. I don't understand what he is saying. 2. It appears to me that it would take a insane amount of time.
1. You would look at each of the resources you have of each type and search for each one in your code and wherever it is found you would confirm that it is being used only in a function relevant to that type of resource.
eg:
Resources
-Sprites
--Lightning
-Objects
--Bat

You would do a full search for Lightning, and wherever it is found you would check that you are only using it in a function that is relevant to sprites (eg: draw_sprite*, sprite_index, etc)
You would do a full search for Bat, and wherever it is found you would check that you are only using it in a function that is relevant to objects (eg: instance_create_*, etc)

If you find any resource that is not used in the correct function, eg: a sprite is being used in a call to instance_create_*, or an object being used in draw_sprite*, then you would need to fix that line of code so the correct resource is being used.

2. Yes, it is a lot of work. Welcome to game development. It can be a lot of work to debug and fix issues.
 
Last edited:
I suspect that you are most likely doing the same mistake that you did when I last checked your code. You are probably calling something like instance_create_* and instead of giving an object resource into the function, you are probably passing in a sprite resource (or vice-versa with draw_sprite* and an object resource).

That would explain why it is that the first achievement object is always the one being shown because the id of the resource you are incorrectly passing to the function matches the id of the first achievement object resource.


1. You would look at each of the resources you have of each type and search for each one in your code and wherever it is found you would confirm that it is being used only in a function relevant to that type of resource.
eg:
Resources
-Sprites
-Lightning
-Objects
-Bat

You would do a full search for Lightning, and wherever it is found you would check that you are only using it in a function that is relevant to sprites (eg: draw_sprite*, sprite_index, etc)
You would do a full search for Bat, and wherever it is found you would check that you are only using it in a function that is relevant to objects (eg: instance_create_*, etc)

If you find any resource that is not used in the correct function, eg: a sprite is being used in a call to instance_create_*, or an object being used in draw_sprite*, then you would need to fix that line of code so the correct resource is being used.

2. Yes, it is a lot of work. Welcome to game development. It can be a lot of work to debug and fix issues.
Hi @BaBiA Game Studio
I acknowledge that it is moving down the resource tree. Right now its at "Veritte" next was "Agapite" which it is now. I did a search for Verite and now i did a search for Agapite. I'm not sure. I have to go afk. i'll be back in a little bit. I don''t want to keep you waiting....
 

Nidoking

Member
The problem, as has been stated, is that "Veritte" and "Agapite" are not the text you're using. If they were the correct text, you would not be seeing this problem. What you're using is some other resource that happens to share the number of whichever one is drawing. If you can work out which resource that is, you'll know what to search for.
 
Ok @Nidoking . The way it looks to me is somehow instead of the achievements is being output in the background or a far depth.
The problem, as has been stated, is that "Veritte" and "Agapite" are not the text you're using.
I don't understand how it continually moves down the resource tree. I delete on item on the tree and the bad code moves down thte
tree to the next element.

In the items from the resource tree there are for each resource element on the tree it specifically text that prints the achievement. (Verite, Agapite, Indigo)
on the screen.
 

chamaeleon

Member
I don't understand how it continually moves down the resource tree. I delete on item on the tree and the bad code moves down thte
tree to the next element.
Every resource in your resource tree has a number starting at zero for each type of resource (sprites start at zero, fonts start at zero, objects start at zero, etc. Instances are not part of the resource tree, and start at 100,000), and have an incrementing value as you go down the tree of resources of the given type. If you were to remove one resource, say an object, every entry that was listed under it will have an resource id number that is one less.

So for example
Code:
sprite_one = 0
sprite_two = 1
sprite_three = 2
sprite_four = 3
Code:
obj_one = 0
obj_two = 1
obj_three = 2
obj_four = 3
Now attempt to create an instance
GML:
instance_create_layer(0, 0, "Instances", sprite_three); // oops, used a sprite resource (with id 2) instead of an object!
We got an instance of obj_three because sprite_three and obj_three has the same numerical id value

Now delete obj_two
Code:
obj_one = 0
obj_three = 1
obj_four = 2
Same incorrect code
GML:
instance_create_layer(0, 0, "Instances", sprite_three); // oops, used a sprite resource (with id 2) instead of an object!
We got an instance of obj_four because now sprite_three and obj_four has the same numerical id value.

So if obj_three and obj_four does different things (and why wouldn't they, there's a reason you'd have them...), you can in a case where you use the wrong kind of resource in the call end up with totally different behavior.

The various functions that create something given a resource id cares not one bit what name you used in the function call, they only care about the numerical value, and changing the resource tree by adding or removing resources will quite possibly change the resource id value for some of the resources.
 
I did a search for Verite and now i did a search for Agapite
And that is the problem. You are searching for the thing that is being created, but that is not what you should be searching for. This is why you have to do the search uses all the other resources because, as chamaeleon has just stated, the resource id that you are using just happens to correspond to an object - because as I said in my post you are using the wrong type of resource with the wrong function (eg: you are using an object/instance function but are giving it a sprite, etc.).
 

chamaeleon

Member
And to expand on what @BaBiA Game Studio says, if you know you're getting the wrong object created, and you suspect that you are using a sprite resource incorrectly (or some other resource), if you know what object type is being created, you could do a reverse lookup so to speak.

In some Create event (only need to see the output once)
GML:
show_debug_message("Object 'obj_four' has the same id as Sprite '" + sprite_get_name(obj_four) + "' (" + string(obj_four) + ")");
Given the output of this (assuming you replace obj_four with an object name relevant for your project), you can search for the name of the sprite with the same id as the object in your code to see if it by any chance is used in an instance create call. If not a sprite, perhaps it's some other resource, but in the past it has typically been a confusion of sprite and object names.
 
  • Like
Reactions: Yal
Hi everyone. I'm clear now on the how the resource ids. I don't however, know how to find them. Let's say I have a Meteor Object for kicks. And Meteor Sprite too.
Suppose:

sprite 1
sprite 2
Sprite 3
Meteor Object (Sprite 4)
Sprite 5

Then I also have

object 1
Meteor Object (object 2)
object 3
object 4
object 5

It's possible so, I try to use the MeteorObject (object 2) but use the Sprite 4 whatever is sitting in object 4.

Does that make sense?
 

Nidoking

Member
That's what's probably happening. You'll just need to find where you use the Meteor Sprite, whatever its name is, when you should be using the Meteor Object. Or vice versa.
 
Top