Jump to content


Photo

Ruby/RGSS3 questions that don't deserve their own thread


  • Please log in to reply
1737 replies to this topic

#1721 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 1,243 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 07 May 2015 - 04:49 PM

I'm working on some animated trees to bring some life to my game maps with a more realistic enviroment.
Packing my maps with tons of events (one per tree) would surely ruin the game performance.
I would like to hear any other suggestions, to avoid eventing animated stuffs.
Any ideas on a good way to implement changes on the regular map update method?
Any script around there that already do something like that (cycle through map tileset frames)?
I'm not sure yet how many frames will the trees have (currently, with 11 frames, using some basic wind effect, my trees move in a rather unnatural way, but mostly due to the fact that I'm still learning my way on Blender...).
tree_zps38o4um4u.gif
*This sample tree and the others will be rendered on blender based on the great models available at http://yorik.uncreat...greenhouse.html


I think the best way to do this might involve actually messing around with the tilemap's bitmaps in real time. It wouldn't be too hard to do really. Might be more complected if you had a lot of different animations you wanted to do with different numbers of frames and framerates. Works better to change the tileset bitmap then to fiddle around with swapping the tiles on the map around.


Edited by KilloZapit, 07 May 2015 - 04:51 PM.


#1722 ???nOBodY???

???nOBodY???

    moogles + nightmares + coffee = Scripting Psychopathic Tendency

  • Ace Member
  • 73 posts
  • Location???nOWheRE???
  • RM Skill - Coder

Posted 07 May 2015 - 11:08 PM

You could also make the trees an animated parallax of sorts,

and just change the parallax for the trees every couple frames or something.


=========================================
#Every Moogle's Worst Nightmare; plus ramen#
=========================================
My Scripts:

(RGSS2)

(RGSS3)

Spoiler

=========================================

#1723 Soulpour777

Soulpour777

    Uncrowned King

  • + Premium Members
  • 2,020 posts
  • Locationフィリピン (Philippines)
  • RM Skill - Coder

Posted 07 May 2015 - 11:19 PM

You could also make the trees an animated parallax of sorts,

and just change the parallax for the trees every couple frames or something.

 

If parallax, this would work perfectly: https://infinitytear...ed-parallax-ex/


Z6H3dc2.png

 

My wonderful banner from Dainiri.

I support the following people:

 

Spoiler

 

I support the following projects.

 

Spoiler

 


#1724 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 1,243 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 08 May 2015 - 07:23 PM

Though given how much memory and disk space animated parallax takes up, and how slow it would probably end up being...

#1725 Wren

Wren

    Paragon/Renegade

  • Ace Member
  • 1,112 posts
  • RM Skill - Jack of All Trades

Posted 09 May 2015 - 01:51 AM

I am using the HD RGSS301.dll to allow me to run my game in 800 x 600.  This works fine until I make a change and save my project, at which time something is rewriting and reverting the RGSS301.dll back to it's default original state.  What is causing this?  I'd really like to continue and use the larger resoluiton but pasting the .dll in every time I test is tiresome.

 

Anyone have ideas what I can do to make it stop reverting back to the non HD .dll?

 

Actually, I think this needs it's own thread...


Edited by Wren, 09 May 2015 - 06:12 AM.

Super Awesome People Shoutout

Spoiler

#1726 AeghtyAteKees

AeghtyAteKees

    Nyctopheliac

  • Ace Member
  • 143 posts
  • LocationThe Cave of Ordeals
  • RM Skill - Designer

Posted 11 May 2015 - 09:34 AM

I've run into a common event issue where only the first event command is executed if the trigger is set to "None." It's supposed to run all the way through if it's called (with an event command or through the use of an item or whatever).

I copied my project, deleted all scripts, and the problem persists. So I'm assuming there was a tweak in a default script, but I don't know where to look for that. Nothing in Game_CommonEvent or Game_Map look any different from default...Any ideas?


Edited by AeghtyAteKees, 11 May 2015 - 11:03 AM.


#1727 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 1,243 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 11 May 2015 - 12:55 PM

Check Game_Interpreter maybe?

#1728 AeghtyAteKees

AeghtyAteKees

    Nyctopheliac

  • Ace Member
  • 143 posts
  • LocationThe Cave of Ordeals
  • RM Skill - Designer

Posted 11 May 2015 - 03:20 PM

I believe I have solved it. Stupid mistakes. Thank you, though. :)


Edited by AeghtyAteKees, 11 May 2015 - 09:12 PM.


#1729 AeghtyAteKees

AeghtyAteKees

    Nyctopheliac

  • Ace Member
  • 143 posts
  • LocationThe Cave of Ordeals
  • RM Skill - Designer

Posted 13 May 2015 - 08:11 PM

Can I use a script call to adjust message line height? If a small font is used, it can almost look double-spaced. My message system (Modern Algebra's ATS) doesn't seem to support this; possibly for good reason that I don't understand. Haha.



#1730 WCouillard

WCouillard

    Sanubian Menace

  • Ace Member
  • 1,106 posts
  • RM Skill - Jack of All Trades

Posted 14 May 2015 - 06:22 PM

You can add this method to Window_Message:

  #--------------------------------------------------------------------------
  # * Calculate Height of Window Suited to Specified Number of Lines
  #--------------------------------------------------------------------------
  def fitting_height(line_number)
    line_number * DESIRED HEIGHT HERE + standard_padding * 2
  end

Just input the number of the line_height you'd like to use in message windows.


My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#1731 AeghtyAteKees

AeghtyAteKees

    Nyctopheliac

  • Ace Member
  • 143 posts
  • LocationThe Cave of Ordeals
  • RM Skill - Designer

Posted 14 May 2015 - 10:27 PM

Can I use this via script call? I don't always have a small font--only on certain books and things. :)



#1732 WCouillard

WCouillard

    Sanubian Menace

  • Ace Member
  • 1,106 posts
  • RM Skill - Jack of All Trades

Posted 15 May 2015 - 09:30 AM

  #--------------------------------------------------------------------------
  # * Calculate Height of Window Suited to Specified Number of Lines
  #--------------------------------------------------------------------------
  def fitting_height(line_number)
    line_number * (contents_height / visible_line_number) + standard_padding * 2
  end

I didn't test it (I use SFonts so they're always the same size), but this should automatically change the height of a message window based on the height of the font and lines.


My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#1733 AeghtyAteKees

AeghtyAteKees

    Nyctopheliac

  • Ace Member
  • 143 posts
  • LocationThe Cave of Ordeals
  • RM Skill - Designer

Posted 15 May 2015 - 02:46 PM

Thanks for the help, but the message window height isn't what I'm trying to adjust. Line height needs to be smaller. Look at line 30 of Window_Base. How can that definition be set in game with a script call?



#1734 Evgenij

Evgenij

    Advanced Member

  • Ace Member
  • 152 posts
  • LocationGermany
  • RM Skill - Coder

Posted 17 May 2015 - 07:05 AM

You could make line_height variable:

def line_height
  @line_height ||= 24
end

def change_line_height(new_value) 
  @line_height = new_value
end

Then just call the change_line_height method on your window. You will then need to redraw the contents of the window to see changes


logoaa.png


#1735 AeghtyAteKees

AeghtyAteKees

    Nyctopheliac

  • Ace Member
  • 143 posts
  • LocationThe Cave of Ordeals
  • RM Skill - Designer

Posted 18 May 2015 - 12:17 PM

I'm not sure how to use this. change_line_height(14) in a script call gives an undefined method error. :/



#1736 DrDhoom

DrDhoom

    *wink~*

  • Ace Member
  • 99 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 18 May 2015 - 12:34 PM

You can't access window_message directly from script call. Instead, change it through $game_message.

class Game_Message
  attr_accessor :line_height
end

class Window_Message < Window_Base
  def line_height
    $game_message.line_height ? $game_message.line_height : 24
  end
end

The script call would be: $game_message.line_height = value

I didn't test this though :P


Edited by DrDhoom, 18 May 2015 - 12:34 PM.

Open for Script Commissions. Interested? PM me.

Check out my DA

My Blog


#1737 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 1,243 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 18 May 2015 - 02:34 PM

You can't access window_message directly from script call. Instead, change it through $game_message.

class Game_Message
  attr_accessor :line_height
end

class Window_Message < Window_Base
  def line_height
    $game_message.line_height ? $game_message.line_height : 24
  end
end

The script call would be: $game_message.line_height = value

I didn't test this though :P

 

why not $game_message.line_height || 24 instead? Heck I would use an alias to get the old value if nil.



#1738 AeghtyAteKees

AeghtyAteKees

    Nyctopheliac

  • Ace Member
  • 143 posts
  • LocationThe Cave of Ordeals
  • RM Skill - Designer

Posted 18 May 2015 - 08:23 PM

Well regardless, DrDhoom's snippet works fine, I believe. Thanks. :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users