Sharing your Lunatic code tips!

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 

Spoiler
P8Sc0lX.png
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!
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
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 

Spoiler
P8Sc0lX.png
Explaination : bust are simply the picture of the girl on the screenshot!
How to do this:

KuFyUMA.jpg


In Lunatic Status Menu under def self.user_status_text(actor, contents)
Spoiler
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
Here @Nio, take a cookie! Incredible thread! 

It seems I will exhaust all my likes here. 

At least I hope so... XD
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
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
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

Original thread: https://forums.rpgmakerweb.com/threads/sharing-your-lunatic-code-tips.35304/