For discussion of non-Wonderland topics - please read rules!
Moderators: ~xpr'd~, tyteen4a03, Stinky, Emerald141, Qloof234, jdl
-
md
- Rainbow Master
- Posts: 748
- Joined: Wed Oct 17, 2007 9:26 am
Post
by md » Mon May 16, 2011 7:59 am
I'm making a game, and for some reason, the boss is invisible?
I've done all it's events and it still shoots out it's bullets and moves how it's supposed to, but it's invisible.
- -Visible is ticked.
-When I put it in a different room (even the main menu), it's invisible.
-All it's "Step" event has is a code saying if it looses all it's health, it gets destroyed. Here's my code:
Code: Select all
{
if (obj_boss1.HP<1)
{
instance_destroy()
};
}
Does anyone know why?
Thanks!!!

If you bothered to copy and paste this signature, or zoom in, to make it possible to read, then I wasted 5-10 seconds of your life.
-
MyNameIsKooky
- Rainbow Spirit Master
- Posts: 9712
- Joined: Mon Dec 01, 2008 10:18 pm
Post
by MyNameIsKooky » Mon May 16, 2011 10:45 am
Do you have a draw event? Draw events always elimate the default sprite for the object and replace it with whatever is drawn.
Aside from that, I can't really see the source of your problem unless you give all of the object properties for the boss.
-
boywhoflies
- Rainbow Spirit Chaser
- Posts: 5510
- Joined: Thu Jun 26, 2008 3:16 pm
Post
by boywhoflies » Mon May 16, 2011 8:55 pm
If it's not the draw like Kooky said, Game Maker is a noob again. Cut all your code and paste it in the same place, I guess. That somethimes works for me.
Or you put in a diffrent object with the same sprite by mistake?
-
md
- Rainbow Master
- Posts: 748
- Joined: Wed Oct 17, 2007 9:26 am
Post
by md » Tue May 17, 2011 5:53 am
MyNameIsKooky wrote:Do you have a draw event? Draw events always elimate the default sprite for the object and replace it with whatever is drawn.
Aside from that, I can't really see the source of your problem unless you give all of the object properties for the boss.
I do have a draw event, all it has is a code that draws the enemies health bar.
Code: Select all
//Draw the enemy's health bar.
{
draw_healthbar
(
220,
view_yview+35,
420,
view_yview+55,
HP,
noone,
c_fuchsia,
c_fuchsia,
0,
0,
1
);
}
Do you see any errors. Thanks!

If you bothered to copy and paste this signature, or zoom in, to make it possible to read, then I wasted 5-10 seconds of your life.
-
md
- Rainbow Master
- Posts: 748
- Joined: Wed Oct 17, 2007 9:26 am
Post
by md » Tue May 17, 2011 5:58 am
md wrote:MyNameIsKooky wrote:Do you have a draw event? Draw events always elimate the default sprite for the object and replace it with whatever is drawn.
Aside from that, I can't really see the source of your problem unless you give all of the object properties for the boss.
I do have a draw event, all it has is a code that draws the enemies health bar.
Code: Select all
//Draw the enemy's health bar.
{
draw_healthbar
(
220,
view_yview+35,
420,
view_yview+55,
HP,
noone,
c_fuchsia,
c_fuchsia,
0,
0,
1
);
}
Do you see any errors. Thanks!

Oops, there's a little more in my "Draw" event. These are my actions:
- "Set the Colour"
"Set the Font"
"Draw a Rectangle"
"Draw a Text"
That's all I have in my draw event.
If you bothered to copy and paste this signature, or zoom in, to make it possible to read, then I wasted 5-10 seconds of your life.
-
md
- Rainbow Master
- Posts: 748
- Joined: Wed Oct 17, 2007 9:26 am
Post
by md » Tue May 17, 2011 10:11 am
MyNameIsKooky wrote:Do you have a draw event? Draw events always elimate the default sprite for the object and replace it with whatever is drawn.
Aside from that, I can't really see the source of your problem unless you give all of the object properties for the boss.
You were right. It was the draw event. I tried putting it with a different object and it works!
Thanks!!!

If you bothered to copy and paste this signature, or zoom in, to make it possible to read, then I wasted 5-10 seconds of your life.
-
boywhoflies
- Rainbow Spirit Chaser
- Posts: 5510
- Joined: Thu Jun 26, 2008 3:16 pm
Post
by boywhoflies » Tue May 17, 2011 8:34 pm
I see what happened.
You drew the healthbar, which disabled the sprite. In those cases, I use this code:
Code: Select all
draw_sprite(sprite_index,image_index,x,y)
. That draws the sprite normaly(same possion and all that. Don't change any of it...). The only problem is that image_angle dosen't work with it.
I'm just putting this down for other times, I know you solved it.

-
Blast!10
- Rainbow Star
- Posts: 1739
- Joined: Thu Nov 02, 2006 7:26 pm
- Location: New Hampshire
Post
by Blast!10 » Wed May 18, 2011 12:36 pm
boywhoflies wrote:The only problem is that image_angle dosen't work with it
Easy to solve if you have the Standard/Pro edition:
Code: Select all
draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha);
-
boywhoflies
- Rainbow Spirit Chaser
- Posts: 5510
- Joined: Thu Jun 26, 2008 3:16 pm
Post
by boywhoflies » Wed May 18, 2011 10:43 pm
I have pro. That works out well.
Thanks!

-
md
- Rainbow Master
- Posts: 748
- Joined: Wed Oct 17, 2007 9:26 am
Post
by md » Tue Jul 05, 2011 3:12 am
Ok, I've got another question.
For some reason, when I put a "+" sign between a text to separate it, it comes up with this error:
Code: Select all
___________________________________________
ERROR in
action number 23
of Draw Event
for object obj_controller:
Error in code at line 7:
"BONUS: " + global.bonus
^
at position 23: Wrong type of arguments to +.
But it doesn't do this to my other game when I use usernames!
Can someone please help me?
Thanks!
Code:
Code: Select all
{
draw_set_halign (fa_middle)
draw_text
(
view_xview+432,
view_yview+180,
"BONUS: " + global.bonus
);
}
I thought it might be because I was using a variable in my other game that was a word, so I might have something to do with numbers and word errors.
But still, it's confusing.
If you bothered to copy and paste this signature, or zoom in, to make it possible to read, then I wasted 5-10 seconds of your life.
-
Blast!10
- Rainbow Star
- Posts: 1739
- Joined: Thu Nov 02, 2006 7:26 pm
- Location: New Hampshire
Post
by Blast!10 » Tue Jul 05, 2011 5:46 am
"BONUS: " is a string. global.bonus is a real value. It's called a type mismatch - you have to concatenate both values as strings, in this manner:
Code: Select all
"BONUS: " + string(global.bonus)
-
md
- Rainbow Master
- Posts: 748
- Joined: Wed Oct 17, 2007 9:26 am
Post
by md » Tue Jul 05, 2011 6:29 am
Blast!10 wrote:"BONUS: " is a string. global.bonus is a real value. It's called a type mismatch - you have to concatenate both values as strings, in this manner:
Code: Select all
"BONUS: " + string(global.bonus)
Thanks, I'll test it now!
If you bothered to copy and paste this signature, or zoom in, to make it possible to read, then I wasted 5-10 seconds of your life.
-
md
- Rainbow Master
- Posts: 748
- Joined: Wed Oct 17, 2007 9:26 am
Post
by md » Tue Jul 05, 2011 6:40 am
It worked!
Thanks Blast!10!

If you bothered to copy and paste this signature, or zoom in, to make it possible to read, then I wasted 5-10 seconds of your life.