Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Sign in to follow this  
Jesse66126

Need Help Custom Weapon Shop

Recommended Posts

I'm trying to make a shop that sells custom made weapons.

Does anyone know how to make a script to edit a weapon inside the game?

All I know how to do is make like a 100+ weapons with different stat combinations.Lol

Share this post


Link to post
Share on other sites

I've spent amany hours on this subject. If you have 2 Iron Swords of the same ID, changing 1 changes both. You must find a way to make each weapon individual. This sounds easy, but isn't.

 

If you take up scripting and find a decent way of doing this, let me know.

Share this post


Link to post
Share on other sites

It's...too....hard.....I made eight hundred different weapons...there are too many possible stat combinations....

Well that and I ran out of space! You can only have 999 different weapons lol

Share this post


Link to post
Share on other sites

In the end,i went with the kingdom hearts approach.Like picking a stat to have and a stat not to have.with only 3 different possible weapons.

Share this post


Link to post
Share on other sites

The main problem with creating such a system is that the default design does not support it and is not easily expanded to support it.

If one were to make an attempt at such a system I would suggest that you start by following the style of having a Game_Weapon for runtime changes which uses the database (RPG::Weapon) as base. You can easily have several Game_Weapons for each weapon in the database.

The Game_Weapon class could for example look like this:

class Game_Weapon
 # The attributes present in a RPG::Weapon
 ATTRIBUTES = ["agi_plus", "animation1_id", "animation2_id", "atk",
			"description", "dex_plus", "element_set", "icon_name",
			"int_plus", "mdef", "minus_state_set", "name", "pdef",
			"plus_state_set", "price", "str_plus"]
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(data_weapon)
@data = data_weapon
 end
 #--------------------------------------------------------------------------
 # * Generate getters and setters for the attributes
 #--------------------------------------------------------------------------
 for attribute in ATTRIBUTES
# Computes the setter and getter code for the specific attribute
PROG = <<FIN
attr_writer :#{attribute}
def #{attribute}
  if @#{attribute}.nil?
	return @data.#{attribute}
  else
	return @#{attribute}
  end
end
FIN
# Evaluates the method definitions
eval(PROG)
 end
end

The class contains each of the attributes present in the RPG::Weapons. It reads from the RPG::Weapon unless another value has been written to the specific attribute, which it will return instead. This way you can have for example two Iron Swords with the same ID and different stats.

You may want more information stored in the Game_Weapon. This is but an example

 

The code won't do anything on it's own. You have to change a large area of the default scripts to employ the Game_Weapon efficiently.

 

I have written this more for Leon than you Jesse. Don't be discouraged if you don't understand what I am talking about

 

*hugs*

- Zeriab

Share this post


Link to post
Share on other sites

Wait,how does this help me?

I want to be able to edit the weapon's stats inside the game.Like you can in Fire Emblem:Path of Radiance.

I'm working on an input weapon configuration script to edit weapons by talking to a npc.

 

Thanks for trying though.

You should take progamming classes with me at Viginia College.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...