Sharing your Lunatic code tips!

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
Sharing your Lunatic code tips!
 ​
Hi people I experimented Luna and well I love it! 

but as a script maker I already played into the lunatic configuration the minute I saw it~ 

Also I found this really sad to not share a list of useful little lunatic configuration who permit to help people who are not used to or don't how to implemented it so why not make a list ??

so I will open the ball with some status configuration tips! 

How to add "big description" without having to use a script! 

 this fairly easy !  

go in Import_status

and modify this line :

import["DESCRIPTION"] = [] actor.description.split(/[\r\n]+/).each_with_index do |line, i| description = [ # text "#{line}", # [offset x, offset y] [0, 24 * i], # [text width, align] [Graphics.width - 28, 0], # [Red, Green, Blue, Alpha] [255, 255, 255, 255], # [Font name, Font size, Bold, Italic] [Font.default_name, Font.default_size, Font.default_bold, Font.default_italic] ]by this !

import["DESCRIPTION"] = [] description = [ # bitmap location and name "$bitmap[System, #{"Description_" + actor.name}]", # [offset x, offset y] [330, 30], # opacity 255, ] This will replace the description text by a sprite! 

Screenshot in game 

I have plenty other tips but I also want people to contribute to this! 

so people don't hesitate to participate!

Disclaimer : Don't ask support on this topics this a place for sharing lunatic code not a place for asking your question!
 
Last edited by a moderator:

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
How to change Window_Command Text and Options Visually

Code:
def self.user_command_text(index, contents, item_rect, enable, select)

## Extra commands can be added to the set.These are then added to## the menu visually but not mechanically.
set = [Vocab::item, Vocab::skill, Vocab::equip, Vocab::status, Vocab::formation, Vocab::save, "System"] 
contents.clear
## Change Font settings. Reference Text in Lunatic Options 
result = [] set.each_with_index do |name, i | result.push([name, [16, 24 * i],  [160, 0],  [255, 255, 255], #Text [X, Y],  [Width, Align], [R, G, B(, A)]["VL Gothic", 26, false, false]])
# Font Name, Font Size, Bold, Italic, RGBA 
end 
result
 
Last edited:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
how to create a bust into your Menu

def self.user_status_text(actor, temp_actor, contents) # this one can depend from wich menu you use! result = [ #folder "filename_actor_name" x , y opacity ["$bitmap[Pictures,#{"bust_" + actor.name} ]", [10, 10], 255 ], ] endI don't know if this need to show a screenshot but if people need it I will put it 

Explaination : bust are simply the picture of the girl on the screenshot!
 
Last edited by a moderator:

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
How to do this:



In Lunatic Status Menu under def self.user_status_text(actor, contents)
Code:
      #--- initialize ---
       result = []
    
      #--- Actor Name ---
      aname = actor.name
      if actor.id == 1
        hash = [aname + " Cielrus", [2, 33], [200, 200], [255, 255, 255, 255], ["Open Sans", 35, true, false], [0, 0, 0, 0]]
      elsif actor.id == 2
        hash = [aname + " Yo!", [2, 33], [200, 200], [255, 255, 255, 255], ["Open Sans", 35, true, false], [0, 0, 0, 0]]
      else
        hash = [aname, [2, 33], [200, 200], [255, 255, 255, 255], ["Open Sans", 35, true, false], [0, 0, 0, 0]]
      end
      result.push(hash)
    
      #--- big portrait ---
      filename = "ST_Actor_#{actor.actor.id}"
      hash = ["$bitmap[Faces, #{filename}]", [310, 12], 255, [0, 0, "bw", "bh"]]
      result.push(hash)
    
      #--- level ---
      level = actor.level
      hash = [level, [25, 4], [64, 2], [255, 255, 255], ["Open Sans", 35, true, false]]
      result.push(hash)
    
      #--- description ---
      desc = actor.description
      desc.split(/[\r\n]+/).each_with_index { |line, index|
        x = 4
        y = 410 + index * 24
        hash = [line, [x, y], [640, 0], [255, 255, 255], ["Open Sans", 20, true, false]]
        result.push(hash)
      }
    
      #--- element rate ---
      elements = [1, 2, 3, 4, 5, 6, 7, 8, 9]
      elements.each_with_index { |element, i|
        x = 7 + 34 * i
        y = 112
        rate = (actor.element_rate(element) * 100).round.to_s
        hash = [rate, [x, y], [42, 0], [0, 0, 0], ["Open Sans", 20, true, false],[0,0,0,0]]
        result.push(hash)
      }
      result
 
Last edited:

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
Here @Nio, take a cookie! Incredible thread! 

It seems I will exhaust all my likes here. 

At least I hope so... XD
 
Last edited by a moderator:

SweetMeltyLove

Veteran
Veteran
Joined
May 4, 2015
Messages
113
Reaction score
155
First Language
English
Primarily Uses
RMVXA
Any tips on editing the battle menus? I find they have a lot less options than the more specific menus. Like, in the item menu config I can change the size of each item being displayed, but in the battle config, this option is missing
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
Any tips on editing the battle menus? I find they have a lot less options than the more specific menus. Like, in the item menu config I can change the size of each item being displayed, but in the battle config, this option is missing
Disclaimer : Don't ask support on this topics this a place for sharing lunatic code not a place for asking your question!

I said in the topic to not ask questions in this thread
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
showing faces instead of character sprites.
upload_2018-9-26_22-1-34.png
Code:
      result = []
      alpha = enable ? 255 : 128
      header = DataManager.load_header(index)
      result = [
        [Vocab::File + " #{index+1}", 
          [4, 0], [0, 0], [255, 255, 255], ["VL Gothic", 20, false, false], [66, 33, 49,alpha]],
      ]
      return result unless header

      #---------------------------------------------------
      # Show Characters
      #---------------------------------------------------
      data   = DataManager.load_savefile_data(index) rescue nil
      return nil unless data
      actors = data[:party].battle_members
      #---
      actors.each_with_index { |actor, i|
        face_name  = actor.face_name
        face_index = actor.face_index
        rx   = face_index % 4 * 96
        ry   = face_index / 4 * 96
        hash = ["$bitmap[Faces, #{face_name}]", [(96 * i) + 80, 0], 255, [rx, ry, 96, 96]]
        result.push(hash)
      }
      #---

      result
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top