[ACE] Dynamicly created ttem stats based on dynamicly created actors

● ARCHIVED · READ-ONLY
Started by KahirDragoon 1 posts View original ↗
  1. Hi, i want to dynamically create the actors and armors during runtime.

    For the creation i use Himes Custom Database.

    Creating the actor works fine. I create a new actor based of a template actor with

    actor = $data_actors[actorTemplate]id_actor = CustomData.add_actor(actor)$data_actors[id_actor].name = actorName$game_party.add_actor(id_actor) actorTemplate and actorName are passed as arguments to the function.

    But when i try to create a armor with

    armor = RPG::Armor.new armor.name = armorName armor.icon_index = $data_armors[armorTemplate].icon_index armor.description = $data_armors[armorTemplate].description armor.features = $data_armors[armorTemplate].features armor.note = $data_armors[armorTemplate].note armor.price = $data_armors[armorTemplate].price armor.etype_id = $data_armors[armorTemplate].etype_id armor.params = $data_armors[armorTemplate].params armor.atype_id = $data_armors[armorTemplate].atype_id id_armor = CustomData.add_armor(armor) $game_party.gain_item($data_armors[id_armor], 1)i get the folowing error:

    Sript 'Game Interpreter' line 1411: Argument error occured. comparision of NilClass with 1 failedArmors that where added to the database within the editor work fine though. It only happen with the items i create during runtime.

    If i use

    armor = $data_armors[armorTemplate] armor.name = armorName id_armor = CustomData.add_armor(armor) $game_party.gain_item($data_armors[id_armor], 1)i can add the armor without the error. But if i add another armor from the same template and change the name, the first armors name changes to.

    Since i use severeal of Yanflys script i thought it could be a compatility problem and disabled them one after another. And it seems the scipt thats causing the error is Yanflys Adjust Limit script. After i removed it adding armors works fine. I looked through it but dont really understand whats causing the error. I have a programming background but no expierence with Ruby and just startet with the RPG Maker.

    The Adjust Limit script is not that important i can live without it. But would be nice to have.

    Anyone an idea what causes the error?

    Scripts used:

    Himes Custom Database

    Adjust Limits

    Other Scripts:

    Yanfly Engine Ace - Ace Core Engine v1.0

    Yanfly Engine Ace - Battle Core

    Yanfly Engine Ace - Battle Engine Add-On

    Yanfly Engine Ace - Battle Engine Add-On

    Yanfly Comptiable ATB Battle System

    Yanfly Engine Ace - Battle Command List

    Yanfly Engine Ace - Element Absorb

    Yanfly Engine Ace - Element Reflect

    Yanfly Engine Ace - Victory Aftermath

    Yanfly Engine Ace - Ace Equip Engine

    Yanfly Engine Ace - Convert Damage

    Yanfly Engine Ace - Equip Dynamic Stats

    Yanfly Engine Ace - Passive States

    Yanfly Engine Ace - Steal Items

    Yanfly Engine Ace - Common Event Tiles

    Yanfly Engine Ace - Gab Window

    Yanfly Engine Ace - Move Restrict Region

    Yanfly Engine Ace - Ace Menu Engine

    Yanfly Engine Ace - Ace Save Engine

    Yanfly Engine Ace - Ace Shop Options

    Yanfly Engine Ace - Ace Item Menu

    Yanfly Engine Ace - System Options

    Yanfly Engine Ace - Ace Status Menu

    Yanfly Engine Ace - Spawn Event

    Yanfly Engine Ace - Visual Battlers

    and my own which only contains the functions that add the actor and weapon.

    YEA Scripts can be found under https://yanflychannel.wordpress.com/rmvxa/1393/

    EDIT: After trying for while now, my guess is that the error comes because some YEA Scripts add new members to the items. These variabes are all nil when i use the CustomDatabase create item method. So unless someone can tell me how i can initialize all members with something other than nil, im trying another approach to archive what i want.