Longer Names

Started by syldocaine, September 30, 2014, 01:39:37 pm

Previous topic - Next topic

syldocaine

Hi guys

is there a way to make longer names for items,actors,monsters and so on?
The field of the editor is very limited.

Maybe a script or something?

For example: i want to create a weapon named " Legendary Greatsword of the Endless Dragonslayers"

I already edited my menu scripts for enough space to show such a name but the database of RMXP is messing up...

G_G

You can edit everything by script calls.

Code: ruby
$data_weapons[ID].name = "Legendary Greatsword of the Endless Dragonslayers"


Same with most everything else.

$data_actors
classes
weapons
items
armors
enemies

KK20

Or via configuration method

module RPG
  class Weapon
    def name
      return case @id
      when 1 then "Bronze Sword of Epic Justice and Friendship"
      when 2 then "Iron Sword for Better Slashing and Stuff"
      else
        @name
      end
    end
  end

  class Armor
    def name
      return case @id
      when 4 then "Mythirl Shield Blessed by Faeries of Another Dimension"
      else
        @name
      end
    end
  end

  class Item
    def name
      return case @id
      when 1 then "Healing Potion from Crushed Juniper Berries"
      else
        @name
      end
    end
  end
end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

syldocaine

Works fine.

Thx alot you two!

Blizzard

Quote from: gameus on September 30, 2014, 03:58:09 pm
You can edit everything by script calls.

Code: ruby
$data_weapons[ID].name = "Legendary Greatsword of the Endless Dragonslayers"


Same with most everything else.

$data_actors
classes
weapons
items
armors
enemies


This doesn't get saved with the save file.

Quote from: KK20 on September 30, 2014, 04:14:30 pm
Or via configuration method

module RPG
 class Weapon
   def name
     return case @id
     when 1 then "Bronze Sword of Epic Justice and Friendship"
     when 2 then "Iron Sword for Better Slashing and Stuff"
     else
       @name
     end
   end
 end

 class Armor
   def name
     return case @id
     when 4 then "Mythirl Shield Blessed by Faeries of Another Dimension"
     else
       @name
     end
   end
 end

 class Item
   def name
     return case @id
     when 1 then "Healing Potion from Crushed Juniper Berries"
     else
       @name
     end
   end
 end
end



This can't be dynamically changed during the game.




Just being a dick~
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

But requester does not want dynamic.
HAH!

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Ryex

just because I feel like oneuping both of you.


class Game_System
  attr_accessor :dynamic_item_properties

  alias ryex_dynamic_item_properties_initialize initialize

  def initialize
      @dynamic_item_properties = {}
      ryex_dynamic_item_properties_initialize
  end
end

module RPG
  class Weapon
    def name
      key = "weapon_" + @id.to_s + "_name"
      if $game_system.dynamic_item_properties.has_key?(key)
        $game_system.dynamic_item_properties[key]
      else
        @name
      end
    end
  end

  class Armor
    def name
      key = "armor_" + @id.to_s + "_name"
      if $game_system.dynamic_item_properties.has_key?(key)
        $game_system.dynamic_item_properties[key]
      else
        @name
      end
    end
  end

  class Item
    def name
      key = "item_" + @id.to_s + "_name"
      if $game_system.dynamic_item_properties.has_key?(key)
        $game_system.dynamic_item_properties[key]
      else
        @name
      end
    end
  end

end


Now you can dynamically and permanently change an item's name with



$game_system.dynamic_item_properties["weapon_" + ID + "_name"] = "Legendary Greatsword of the Endless Dragonslayers"




Ha! now both problems are solved Blizz!
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

Ew, long script call. Just because the average user doesn't typically follow instructions, I'd probably add methods in Interpreter to shorten it up, something that's easy to remember.
change_weapon_name(ID, NAME)

And for teh lulz, I'd also add a way to revert the item's custom name back to its database form.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Ryex

October 01, 2014, 02:41:55 am #9 Last Edit: October 01, 2014, 02:43:44 am by Ryex
oh fine, here

Code: ruby

class Game_System
 attr_accessor :dynamic_item_properties

 alias ryex_dynamic_item_properties_initialize initialize

 def initialize
     @dynamic_item_properties = {}
     ryex_dynamic_item_properties_initialize
 end
end

module RPG
 class Weapon
   def name
     key = "weapon_" + @id.to_s + "_name"
     if $game_system.dynamic_item_properties.has_key?(key)
       $game_system.dynamic_item_properties[key]
     else
       @name
     end
   end
 end

 class Armor
   def name
     key = "armor_" + @id.to_s + "_name"
     if $game_system.dynamic_item_properties.has_key?(key)
       $game_system.dynamic_item_properties[key]
     else
       @name
     end
   end
 end

 class Item
   def name
     key = "item_" + @id.to_s + "_name"
     if $game_system.dynamic_item_properties.has_key?(key)
       $game_system.dynamic_item_properties[key]
     else
       @name
     end
   end
 end

end


class Interpreter
 def change_weapon_name(id, name)
   $game_system.dynamic_item_properties["weapon_" + id + "_name"] = name
 end
 def revert_weapon_name(id)
   $game_system.dynamic_item_properties.delete("weapon_" + id + "_name")
 end
 def change_armor_name(id, name)
   $game_system.dynamic_item_properties["armor_" + id + "_name"] = name
 end
 def revert_armor_name(id)
   $game_system.dynamic_item_properties.delete("armor_" + id + "_name")
 end
 def change_item_name(id, name)
   $game_system.dynamic_item_properties["item_" + id + "_name"] = name
 end
 def revert_item_name(id)
   $game_system.dynamic_item_properties.delete("item_" + id + "_name")
 end
end


now it can be called with pretty names from scripts calls and you can revert it

scripts calls look like
Code: ruby

change_weapon_name(ID, "Legendary Greatsword of the Endless Dragonslayers")
change_armor_name(ID, "Cheapest cloth armor available")
change_item_name(ID, "Poison, Don't Drink")


then set them back to database defaults with
Code: ruby

revert_weapon_name(ID)
revert_armor_name(ID)
revert_item_name(ID)


Wait... did we just create a new script because we felt like onaping each other?
Meh, don't care. if anyone feels like claiming it and putting it in the database feel free.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

KK20

Slap a "cannot be used in saved games" label and database it 8)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Ryex

hey, I did the work of writing it, I even had to look at the RMXP scripts again to remember this shit. YOU can database it ya lazy slop!  :V:
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

syldocaine

A little bit late, but i just wanted to say:

You guys are awsome  :)

Thx