• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Discussion Instance specific sprites appear in the room editor

D

Docteur Raton

Guest
Hi, I was thinking of an idea to make it easier to work with the room editor: the ability to make instances of the same object show different sprites in the room editor. I think this would be useful if you have, for example, a prop object that doesn't have a sprite. Right now, if you place an instance of prop in a room and change it's sprite through its creation code or in the 'variable definition' panel (by changing 'sprite_index'), the it still shows the default sprite in the room editor (a question mark). Here are two ideas I could suggest to fix this issue:

1) By adding a button to change directly the sprite of an instance in the room editor (it would act the same as changing the sprite in the instance creation code), and making that sprite show up in the editor

2) By automatically showing in the room the sprite that is specified as 'sprite_index' in the 'variable definition' panel
 

curato

Member
I am not sure if it is exactly what you are looking for but sometimes if an object doesn't have a sprite to draw but I need to find it later I just assign it something simple like a red box so I can find it in the level editor, but then override the draw event so that it isn't draw in game.
 

woods

Member
my temp spr_control is usually a 32x32 brite pink box..
either change the sprite to nothing when im done, or adjust the alpha, or simply dont draw_self later

it would be nice to be able to pick a frame for each instance in the room editor, would be handy for those things that have a tiny/clear frame0, for sure
 

rIKmAN

Member
it would be nice to be able to pick a frame for each instance in the room editor, would be handy for those things that have a tiny/clear frame0, for sure
You can already do this.
Double click an instance in the room editor and change the "frame" value to whatever frame you want the instance to show.
 

woods

Member
You can already do this.
Double click an instance in the room editor and change the "frame" value to whatever frame you want the instance to show.
gah! awesome TY for the tip
 

rIKmAN

Member
gah! awesome TY for the tip
Just to note - this actually changes the image_index the object will start with when the game is run.
If this isn't what you want and it's just for room editor visualisation, remember to change the image_index back to what it should be in game in the Create Event.
 
D

Docteur Raton

Guest
I am not sure if it is exactly what you are looking for but sometimes if an object doesn't have a sprite to draw but I need to find it later I just assign it something simple like a red box so I can find it in the level editor, but then override the draw event so that it isn't draw in game.
That's not really what I meant, I'll try to explain with an example. In my game I have obj_prop which collides with the player and has a depth system. However, I want to have props with different sprites (spr_lamp, spr_bed, etc.). So right now, I'm creating a new child of obj_prop every time I want a prop with a new sprite, and then place an instance of that child in the room. I could alternatively just place an instance of obj_prop and change the sprite of that instance (in its creation code or the variable definition panel), instead of creating a new child object every time I want a prop with a new sprite. However, the main issue with that second method is that the sprite of the instance doesn't show up in the room editor, since it only shows the sprite of the object, and not the sprite of that specific instance. Making a placeholder sprite for obj_prop, as you said, can be useful, but this is a bit cumbersome, since you can't see directly which prop it's supposed to be.
 

curato

Member
I think rIKmAN has your answer above. Drop it in the room editor and change the frame to the picuture of the item you want. Just set the image_speed to zero then it will just be that frame when you load the game.
 
D

Docteur Raton

Guest
Sounds like a good idea. The main limitation I see is that you need to have every image in the same sprite. For instance, I'm not sure you can import a specific sprite image from a file, and you would have to remember the image_index of each prop, since it seems like you can't use enumerators in the "instance editor", or anything that's not a number literal
 
Top