I Wanna Community
Fangames => Game Design => Programming Questions => Topic started by: Taprus on September 21, 2015, 01:36:56 PM
-
So im making an avoidance, and to make stuff easier to myself i decided that i should have an object that shows the step counter(or step "blocks" idunno) of the timeline. Thing is, even after trying a lot of stuff, it still hasnt worked. Can anyone help me please?
-
Create an object > Draw Event
draw_set_alpha(1);
draw_set_color(c_black);
draw_text(x,y,boss.STEPCOUNTER);
Will draw the text wherever you place this object. Varies depending on h/v text alignment.
Obviously replace "boss" with whatever object the counter is running in and "STEPCOUNTER" with whatever your counter is called.
-
(https://i.imgur.com/gPgv2yt.png)
I think i did something wrong...
-
The object you created is called stepshower.
The variable you're trying to reference from objAvoidance is called stepshower.
Make the object stepshower unique by changing the name to objStepshower?
-
I dont understand, what is supposed to be the variable from the boss?
-
Are you using the built in timeline in gamemaker?
(https://puu.sh/kjk72/74f0a07fdf.png)
Or are you using something like this
STEPCOUNTER += 1
switch(STEPCOUNTER) {
case 1:
rngCherryAttack();
break;
}
or this
STEPCOUNTER += 1
if STEPCOUNTER = 1 { rngCherryAttack() };
----------------------------
If you're using the built in timeline's provided by gamemaker (im dumb and mis-read what you typed. this is probably what you want):
draw_set_alpha(1);
draw_set_color(c_black); // change color depending on what the background color is
draw_text(x,y,object.timeline_position); // change object to whatever object is running the timeline
-
Wow, thank you, it works now! :atkHappy: I was using the built in timeline function.
Im just bad with GM, so yeah