Help With Syntax(?)

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
Two things. I'm not sure if this is the appropriate place to ask for help with scripts, but it's here now. Mods can move it if they please. Second, I'm not really sure if this would be classified as syntax. Anyways...

I recently began learning all the things I can do with script calls. Such as run event commands with some extra functionality. Especially when I learned some advanced trick with game variables here. I saw in there that you can store an actors name into a game variable by doing 

$game_variables[1] = $data_actors[1].nameI also found I could do the same thing with weapon names by using $data_weapons instead. I assume it would be the same for items and armors too. Mighty useful for displaying the name of dynamic loot and rewards which is what I am using this technique for. But that's all I know how to call upon. Names by adding .name to the end of it.

I'm sure I could access other things such as descriptions, stats, notes. But I don't know how. I would assume it's similar like .description. But I could be wasting my time trying to figure it out since it could even be something like .desc.

So what I'm asking is if someone could tell me or point me to a list of different things I could store into variables with that technique such as description, stats or notes. It could be even more useful for features in my game. It's open world with a lot of randomly generated elements. So storing things like those into variables would be super fine.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
RGSS3 Scripts is for completed scripts you wrote yourself...


I've moved this thread to Learning Ruby. Please be sure to post your threads in the correct forum next time. Thank you.
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
You could always activate the console and use

p $data_weapons[1].methodsto get a list of all available methods printed.

Or you use F1 in the RM Editor and search for RPG::BaseItem to get a documentation of the basic methods and attributes of actors, items, weapons, skills and so on.

For specifiy methods and attributes search for RPG::UsableItem (Skills, and normal Items) and RPG::Item, RPG::Weapon, RPG::Armor, RPG::Skill, RPG::Actor....
 

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
RGSS3 Scripts is for completed scripts you wrote yourself...

I've moved this thread to Learning Ruby. Please be sure to post your threads in the correct forum next time. Thank you.
Woah... I should learn to read. Sorry about that.
 

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
You could always activate the console and use

p $data_weapons[1].methodsto get a list of all available methods printed.

Or you use F1 in the RM Editor and search for RPG::BaseItem to get a documentation of the basic methods and attributes of actors, items, weapons, skills and so on.

For specifiy methods and attributes search for RPG::UsableItem (Skills, and normal Items) and RPG::Item, RPG::Weapon, RPG::Armor, RPG::Skill, RPG::Actor....
Method! That's the term I was looking for. One question. How does one activate console?

EDIT: I'm a stoop and double posted. Ooops.

EDIT2: I figured it out on my own and found out you need to print into it using scripts. I also, as a test, changed the name of Rusted Daggers (weapon id 1 in my game) to Dehinin by using $data_weapons[1].name = "Deshinin". This could have so much functionality, such as upgrading weapons. I just need to figure out how to access and change the actors weapons instead of databases weapons.
 
Last edited by a moderator:

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
Keep in mind that the database objects have only one instance. So you would need a more complex script to make upgrade systems. If you change $data_weapons[1].name to something else you change the database entry, and it would change it for every savegame as long as your game is running.
 
Last edited by a moderator:

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
Keep in mind that the database objects have only one instance. So you would need a more complex script to make upgrade systems. If you change $data_weapons[1].name to something else you change the database entry, and it would change it for every savegame as long as your game is running.
Yes, I've noticed that. After some messing around, I've tried $game_party.leader.equips[0].name but it still had the same result of changing every copy of that weapon. Is there anyway I can access specifically the weapon that actor 1 has equipped?
 
Last edited by a moderator:

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
You can use Hime's Item Instance script to circumvent the issue.
 

KadoDragon

Veteran
Veteran
Joined
Sep 10, 2013
Messages
155
Reaction score
9
First Language
English
Primarily Uses
You can use Hime's Item Instance script to circumvent the issue.
That is an interesting script. But I have no use for instancing items in my game right now. Just checking out what I could and couldn't do with script calls and playing around with it. Thanks for pointing out the script, I will probably use it in future projects.
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top