B
Bhreno
Guest
Is it possible to leave a worthless variable until a certain point in the game, even if its value grants a sprite_index a room-specific object? Or at least leave it with a default value that can later be changed by other values still in room_start?
Well, whenever I start the game, I leave this var with a empty value and the game crashes because it doesn't recognize any value assigned to a variable.
The following is:
My obj_circle in question have a var sprite_color that can grant 5 different sprites right away in create event. Follow values and results for var sprite_color:
If sprite_color == 1 {sprite_index = spr_circle}; (default value).
If sprite_color == 2 {sprite_index = spr_circle_green};
If sprite_color == 3 {sprite_index = spr_circle_blue};
If sprite_color == 4 {sprite_index = spr_circle_yellow};
If sprite_color == 5 {sprite_index = spr_circle_orange};
If either obj_circle does not exit with a set value, it would be considered as sprite_color = 1 (spr_circle), or the default value. If you set this default value in room_start, game_start, or create event of the obj_circle, i will not be able to change the code or sprite_index later, the values of the sprite_color lost the effect because a value has already been used before.
My goal is to place multiple obj_circle in the room with different colors, without having to create an object for each color. Some created by an obj_circle_creator randomly by the map, others I manually set to specific positions and have already set a default value for a sprite color.
Example: If I manually add 3 obj_circle to the room and give them these values:
First obj_circle: sprite_color = 3;
Second obj_circle: sprite_color = 1;
Third obj_circle: sprite_color = 4;
When you choose all cores with different cores, following the values of var sprite_color, they all end up with the default value (sprite_color = 1) set in obj_circle events. So I was wondering if you can create a variable and leave it with no value to play the value after the game starts, or some other way to change the value of sprite_color even though var sprite_color has a default value in room_start.
Well, whenever I start the game, I leave this var with a empty value and the game crashes because it doesn't recognize any value assigned to a variable.
The following is:
My obj_circle in question have a var sprite_color that can grant 5 different sprites right away in create event. Follow values and results for var sprite_color:
If sprite_color == 1 {sprite_index = spr_circle}; (default value).
If sprite_color == 2 {sprite_index = spr_circle_green};
If sprite_color == 3 {sprite_index = spr_circle_blue};
If sprite_color == 4 {sprite_index = spr_circle_yellow};
If sprite_color == 5 {sprite_index = spr_circle_orange};
If either obj_circle does not exit with a set value, it would be considered as sprite_color = 1 (spr_circle), or the default value. If you set this default value in room_start, game_start, or create event of the obj_circle, i will not be able to change the code or sprite_index later, the values of the sprite_color lost the effect because a value has already been used before.
My goal is to place multiple obj_circle in the room with different colors, without having to create an object for each color. Some created by an obj_circle_creator randomly by the map, others I manually set to specific positions and have already set a default value for a sprite color.
Example: If I manually add 3 obj_circle to the room and give them these values:
First obj_circle: sprite_color = 3;
Second obj_circle: sprite_color = 1;
Third obj_circle: sprite_color = 4;
When you choose all cores with different cores, following the values of var sprite_color, they all end up with the default value (sprite_color = 1) set in obj_circle events. So I was wondering if you can create a variable and leave it with no value to play the value after the game starts, or some other way to change the value of sprite_color even though var sprite_color has a default value in room_start.