Jump to content


Photo

Health/exp/mana bar trouble


  • This topic is locked This topic is locked
11 replies to this topic

#1 xxgamenoobxx

xxgamenoobxx

    GMC Member

  • New Member
  • 35 posts
  • Version:GM8

Posted 03 March 2012 - 11:56 PM

i'm making a RPG and right now my health bar controller is giving me trouble. am i doing something wrong or is this some glitch?
___________________________________________
FATAL ERROR in
action number 1
of Draw Event
for object obj_controller:

COMPILATION ERROR in code action
Error in code at line 6:
draw_text(view_xview[0]+8,view_yview[0]8,'Level:'+string(global.level))
^
at position 41: Symbol , or ) expected.
i don't add something that's not necessary. each time i add one it says to add another
  • 0

#2 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1853 posts
  • Version:GM:Studio

Posted 04 March 2012 - 12:02 AM

Whats the full code you're using?
  • 0

#3 xxgamenoobxx

xxgamenoobxx

    GMC Member

  • New Member
  • 35 posts
  • Version:GM8

Posted 04 March 2012 - 12:34 AM

this is what i'm using

draw_set_color (c_black)
draw_set_font(font0)

draw_text(view_xview[0]+8,view_yview[0]8,'Level:'+string(global.level))
draw_text(view_xview[0]+8,view_yview[0]32,'Exp:'+string(global.xp))
draw_text(view_xview[0]+8,view_yview[0]56,'Health:'+string(global.hp))
draw_text(view_xview[0]+8,view_yview[0]80,'Attack:'+string(global.attack))
  • 0

#4 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1853 posts
  • Version:GM:Studio

Posted 04 March 2012 - 12:42 AM

For the view_yview parts you didn't add a plus sign.

draw_set_color (c_black)
draw_set_font(font0)

draw_text(view_xview[0]+8,view_yview[0]+8,'Level: '+string(global.level))
draw_text(view_xview[0]+8,view_yview[0]+32,'Exp: '+string(global.xp))
draw_text(view_xview[0]+8,view_yview[0]+56,'Health: '+string(global.hp))
draw_text(view_xview[0]+8,view_yview[0]+80,'Attack: '+string(global.attack))

This will work.

Edited by Robert3DG+, 04 March 2012 - 12:43 AM.

  • 0

#5 xxgamenoobxx

xxgamenoobxx

    GMC Member

  • New Member
  • 35 posts
  • Version:GM8

Posted 04 March 2012 - 12:45 AM

but what was the matter with it in the first place? ...and thanks! :D

Edited by xxgamenoobxx, 04 March 2012 - 12:46 AM.

  • 0

#6 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1853 posts
  • Version:GM:Studio

Posted 04 March 2012 - 12:46 AM

For the view_yview parts you didn't add a plus sign.

view_yview[0]8
vs view_yview[0]+8
  • 0

#7 xxgamenoobxx

xxgamenoobxx

    GMC Member

  • New Member
  • 35 posts
  • Version:GM8

Posted 04 March 2012 - 12:48 AM

For the view_yview parts you didn't add a plus sign.

view_yview[0]8
vs view_yview[0]+8

-____- i didn't notice that? my name says it all. XD
  • 0

#8 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1853 posts
  • Version:GM:Studio

Posted 04 March 2012 - 12:50 AM

It's fine, we all make silly mistakes. Good luck with your game. Posted Image
  • 0

#9 xxgamenoobxx

xxgamenoobxx

    GMC Member

  • New Member
  • 35 posts
  • Version:GM8

Posted 04 March 2012 - 01:10 AM

ok i have one more question. how do i keep track of xp/health/mana/gold throughout different rooms? whenever i go to battle the next thing it resets my experience and level.
or if i go to the shop it also resets my gold 'n stuff.

Edited by xxgamenoobxx, 04 March 2012 - 01:11 AM.

  • 0

#10 Stian Aune

Stian Aune

    GMC Member

  • New Member
  • 131 posts
  • Version:GM:Studio

Posted 12 March 2012 - 05:34 PM

I believe this thread is misplaced, but anyway...

Firstly, they must be global variables, which means they are not dependant on an object. In addition, you would make an initualising object (basically one that sets them to their original values) in the first map, or better: a loading screen before you start the first level. If you do this, they won't restart by themselves, unless you restart the game.

EDIT: Oops, I forgot how slow threads leave the first page around these parts...

Edited by Stian Aune, 12 March 2012 - 05:36 PM.

  • 0

#11 BluePotato1994

BluePotato1994

    GMC Member

  • GMC Member
  • 184 posts
  • Version:GM8

Posted 16 March 2012 - 12:37 PM

Wrong Topic, please move
  • 0

#12 xxgamenoobxx

xxgamenoobxx

    GMC Member

  • New Member
  • 35 posts
  • Version:GM8

Posted 17 March 2012 - 12:47 AM

well..this is old and i don't know how to move it. also i already figured out all that i needed through another forum...soo yeah. how does one move or delete because whenever i delete it says i don't have the authority to do it.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users