Errr.... not THAT simple....
The simple wayshould be to write the following:
$data.weapons[ <index>].<stat> = <new_value>
where:
- <index> is the id of the weapon (the number that appear in the weapon list in the database, and that you have to explain how to find it during scripting time (the one equipe by a given character => which character, one in the inventory => how do want to indentify it, etc...)).
- <stat> is the weapon stat and must be one of the following:
- name
- icon_index
- desctiption
- note
- animation_id
- price
- hit
- atk
- def
- spi
- agi
- two_handed
- fast_attack
- dual_attack
- critical_bonus
- element_set
- state_set
- <new_value> is the new value you want for the stat. Its type is determined by the stat you want to change. It may be a string, number, boolea (true/false) or even an array. Look at the TOG Maker help file
for exemple:
$data_weapons[1].atk = 10
Alas this solution has a couple major drawbacks:
- It changes the stats of ALL weapons with the same index. That is: if 2 characters have the same weapon, the stats are changes for both of them
- the changes are not saved
- I thought of another one, but forgot it....
to resolve that, we have to create another, more complex, class for the $data_weapon variable. By luck, I am working on it, but still don't have THE idea that will resolve all....
See ya later.