Author Topic: show step counter  (Read 2016 times)

Taprus

  • Cherry Eater
  • Posts: 58
  • idkman
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 45.0.2454.93 Chrome 45.0.2454.93
    • View Profile
  • Playstyle: Keyboard
show step counter
« 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?
I'm somewhat decent at video games

Sudnep

  • Global Moderator
  • Spike Dodger
  • Posts: 124
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 45.0.2454.93 Chrome 45.0.2454.93
    • View Profile
  • Playstyle: Keyboard
Re: show step counter
« Reply #1 on: September 21, 2015, 01:48:17 PM »
Create an object > Draw Event

Code: [Select]
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.

Taprus

  • Cherry Eater
  • Posts: 58
  • idkman
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 45.0.2454.93 Chrome 45.0.2454.93
    • View Profile
  • Playstyle: Keyboard
Re: show step counter
« Reply #2 on: September 21, 2015, 01:58:57 PM »

I think i did something wrong...
I'm somewhat decent at video games

Sudnep

  • Global Moderator
  • Spike Dodger
  • Posts: 124
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 45.0.2454.93 Chrome 45.0.2454.93
    • View Profile
  • Playstyle: Keyboard
Re: show step counter
« Reply #3 on: September 21, 2015, 02:19:12 PM »
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?

Taprus

  • Cherry Eater
  • Posts: 58
  • idkman
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 45.0.2454.93 Chrome 45.0.2454.93
    • View Profile
  • Playstyle: Keyboard
Re: show step counter
« Reply #4 on: September 21, 2015, 02:31:29 PM »
I dont understand, what is supposed to be the variable from the boss?
I'm somewhat decent at video games

Sudnep

  • Global Moderator
  • Spike Dodger
  • Posts: 124
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 45.0.2454.93 Chrome 45.0.2454.93
    • View Profile
  • Playstyle: Keyboard
Re: show step counter
« Reply #5 on: September 21, 2015, 02:36:22 PM »
Are you using the built in timeline in gamemaker?


Or are you using something like this
Code: [Select]
STEPCOUNTER += 1
switch(STEPCOUNTER) {
case 1:
 rngCherryAttack();
break;
}
or this
Code: [Select]
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):

Code: [Select]
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
« Last Edit: September 21, 2015, 02:57:36 PM by Sudnep »

Taprus

  • Cherry Eater
  • Posts: 58
  • idkman
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 45.0.2454.93 Chrome 45.0.2454.93
    • View Profile
  • Playstyle: Keyboard
Re: show step counter
« Reply #6 on: September 21, 2015, 03:01:21 PM »
Wow, thank you, it works now!  :atkHappy: I was using the built in timeline function.
Im just bad with GM, so yeah
I'm somewhat decent at video games