Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Am I doing it right?

So I just was trying to whip up a quick snippet for ccoa's UMS, so that when there is no face specified, game_system.ums_mode = FIT_WINDOW_TO_TEXT, and when there is a face, game_system.ums_mode = NORMAL_MODE.  Since I'm hopeless with scripting, I just need to know if I'm doing this correctly.  Would this update?  Would it cause lag?  Is there a more efficient way of writing it?  Where should I put the script?  I'm hopeless. :dead: Here's the code:
Code:
if $game_system.face_graphic = ""
  game_system.ums_mode = FIT_WINDOW_TO_TEXT
else game_system.ums_mode = NORMAL_MODE
end
Thanks! :smile:
 
Well, I'm not sure what you're trying to do exactly, but, assuming that you want the text to use the proper space in the window depending on if there's a face graphic or not, then:
Code:
if $game_system.face_graphic == ""
  $game_system.ums_mode = FIT_WINDOW_TO_TEXT
else 
  $game_system.ums_mode = NORMAL_MODE
end
This should be added into the update method of Window_Message. I suggest to add it right below def update.
I've never used Ccoa's UMS but it should do the trick.

Take care!
-Dargor
 
Dargor":2r0dlunv said:
Well, I'm not sure what you're trying to do exactly, but, assuming that you want the text to use the proper space in the window depending on if there's a face graphic or not, then:
Code:
if $game_system.face_graphic = ""
  game_system.ums_mode = FIT_WINDOW_TO_TEXT
else 
  game_system.ums_mode = NORMAL_MODE
end
This should be added into the update method of Window_Message. I suggest to add it right below def update.
I've never used Ccoa's UMS but it should do the trick.

Take care!
-Dargor
Thanks!  I'll play around with it a bit to see if I can get the result I'm looking for. :smile:
 
Code:
$game_system.ums_mode = ($game_system.face_graphic == "" ? FIT_WINDOW_TO_TEXT : NORMAL_MODE)


you needed a double == on the first line of code (== is comparison, = is to set a variable, big difference.. = will always return true.)

but my line is just an easier way to do it.
 
FireRaven":aeib566a said:
It's more clean, indeed, but personally, I don't like to have too much code exceeding the editing field's width, so I would've used the if blocks.

I find that interesting, actually. When I was taught to code at school, I was taught to use a few lines as possible, and condense. As long as the code still followed identical logical flow. Yet the year after I left school, they started teaching the "Don't exceed the window size, space your code out so its readable, etc." bullshit.
 
Prexus":3vrntkeg said:
I find that interesting, actually. When I was taught to code at school, I was taught to use a few lines as possible, and condense. As long as the code still followed identical logical flow. Yet the year after I left school, they started teaching the "Don't exceed the window size, space your code out so its readable, etc." bullshit.
Ahahaha! They were totally messing with your head :P
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top