Coders manual

fuzzalicious

Villager
Member
Joined
Jun 3, 2014
Messages
23
Reaction score
2
First Language
english
Primarily Uses
Where can I find the variable names of items, like if I wish to change the attack value of a weapon from the script editor, 

is there full documentation somewhere?
 
Joined
Feb 1, 2013
Messages
62
Reaction score
12
Primarily Uses
If you are interested, I have saved all RPG Maker VX ace scripts in txt format.

Edit: Also each item type is stored in an array

items -> $data_items

weapons -> $data_weapons

armors  ->  $data_armors

 

you can access those from every script.
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Not sure what you want to do here.  If you want to change the attack value of a weapon from the default/placeholder setting, then you put in whatever values you want in the database.  No script involved.

Or, do you mean change the attack value of the weapon in-game (perhaps because of an event, or something)?  Again, you probably don't need a script, but use an event - though exactly what the event does would depend upon what you want to happen.

Could you give more details?
 

fuzzalicious

Villager
Member
Joined
Jun 3, 2014
Messages
23
Reaction score
2
First Language
english
Primarily Uses
Yeah I mean, how can I find out what $data_weapons have for variables like attack and durability to access from script, and if it's

a child to another class and thereby inherit it's variables.

If I have access to members like attack I can make up values on the fly without having to use the database, so when I pick up a

sword I will set it's damage to a random value.

Or should I say parameters rather then variables.
 
Last edited by a moderator:
Joined
Feb 1, 2013
Messages
62
Reaction score
12
Primarily Uses
Yeah I mean, how can I find out what $data_weapons have for variables like attack and durability to access from script, and if it's

a child to another class and thereby inherit it's variables.

If I have access to members like attack I can make up values on the fly without having to use the database, so when I pick up a

sword I will set it's damage to a random value.

Or should I say parameters rather then variables.
You can set the damage of every weapon by executing this command

 

$data_weapons[id].params[2]=value where id the index value of the weapon in the database.

 

RPG::Weapon inherits from RPG::EquipItem the params array where

  • 0: Maximum hit points
  • 1: Maximum magic points
  • 2: Attack power
  • 3: Defense power
  • 4: Magic attack power
  • 5: Magic defense power
  • 6: Agility
  • 7: Luck 
 
Last edited by a moderator:

fuzzalicious

Villager
Member
Joined
Jun 3, 2014
Messages
23
Reaction score
2
First Language
english
Primarily Uses
Awesome, thanks! :D

If I need to find other parameters like for armor and such where can I look it up?
 
Joined
Feb 1, 2013
Messages
62
Reaction score
12
Primarily Uses
Both weapons and armors have the same parameters but some of them are set to 0. In the case of armors

$data_armors[id].params[3]=value

I changed the params index to 3 because the defense value is stored in that index (see above)
 

Mouser

Veteran
Veteran
Joined
Aug 19, 2012
Messages
1,245
Reaction score
264
First Language
English
Primarily Uses
The two main sources of information for this stuff is the help files index (look under the RGSS classes documentation) and the scripts accessible from the script editor. Half the classes are in one place and half are in the other. Stuff dealing with actors and combat is generally in the Scripts section, while database type stuff like items and equipment is documented in the help files. That's a generalization: there's quite a bit of overlap.
 

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
Keep in mind, any changes to $data structures are NOT saved when playing the game by default. As soon as you reload the save files, that change to the parameter will be lost. And even if they were saved, it would affect all save files, not just the one you're currently playing.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


OR you can just use features/states to change things during gameplay instead of doing it via scripts.


I have a Dynamic Features script hanging around somewhere that will let you change features of weapons during play and will save it.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top