Chaos Project

RPG Maker => General Discussion => Topic started by: syldocaine on September 30, 2014, 01:39:37 pm

Title: Longer Names
Post by: syldocaine on September 30, 2014, 01:39:37 pm
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...
Title: Re: Longer Names
Post by: G_G 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
Title: Re: Longer Names
Post by: 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
Title: Re: Longer Names
Post by: syldocaine on September 30, 2014, 05:06:01 pm
Works fine.

Thx alot you two!
Title: Re: Longer Names
Post by: Blizzard on September 30, 2014, 05:09:30 pm
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~
Title: Re: Longer Names
Post by: KK20 on September 30, 2014, 05:15:33 pm
But requester does not want dynamic.
HAH!
Title: Re: Longer Names
Post by: Ryex on September 30, 2014, 08:33:37 pm
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!
Title: Re: Longer Names
Post by: Blizzard on October 01, 2014, 01:21:35 am
:nod:
Title: Re: Longer Names
Post by: KK20 on October 01, 2014, 02:30:13 am
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.
Title: Re: Longer Names
Post by: Ryex on October 01, 2014, 02:41:55 am
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.
Title: Re: Longer Names
Post by: KK20 on October 01, 2014, 02:43:52 am
Slap a "cannot be used in saved games" label and database it 8)
Title: Re: Longer Names
Post by: Ryex on October 01, 2014, 02:46:58 am
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:
Title: Re: Longer Names
Post by: syldocaine on November 06, 2014, 06:44:52 am
A little bit late, but i just wanted to say:

You guys are awsome  :)

Thx