Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] I need a scriptlet! (and other various questions)

--{EDIT}--
Aaand I figured it out, by extensive searching that took at least most of my night. (Yay insomnia?) Either way I still have a question, and more to come (but future ones are definitely script-only oriented so those will most likely go in the other forum).
So I sort of figured out a way to do this, but now it doesn't save the new attack when I exit and restart the game.
I'm currently using
Code:
$data_weapons[1].atk += 100 #large for testing ahaha
but this does not keep when I save. I think I have to update something in the Scene_Save/Load but I'm not sure what that would be.
...this has sort of turned into a scripting thing so feel free to move it to that forum, sorry. D:
Original Question:
I'm not sure if this would go here, since I need help with a small script snippet (the type you use when eventing), OR the script forum, so please let me know if this is correct.

SO, onto the question!
What I'm trying to do:
Character gains an item. When this item is gained, the base attack for a weapon (not necessarily equipped) is increased by whatever I want to increase it. I'm trying to do this with events, since it seems the easiest way (to me).
What I need:
I was thinking of calling a script each time this happens, one that takes the weapon ID and changes its base attack. I've looked through the scripts to see if that would help, but so far it hasn't.


I may have other questions later, but for now this will do.
Thank you in advance!

Second Question answered by awesome Brewmeister. Thanks again!
Ah, yep I do have another question, again with a scriptlet.
What would the coding be if I wanted to, through the script event command, equip a weapon/armor/acces/etc to a character?
Thanks again!

Currently no questions, so this thread can die until I have a new one!
 
$game_party.actors[n].equip(equip_type, id)

n: actors position in party (starting with 0)
equip_type: (0 = weapon, 1 = shield, 2 = head, 3 = body, 4 = accessory)
id: weapon or armor ID

Any reason you don't want to use the "Change Equipment" command?
 
I need to store which weapon the character was using (and the actual actor ID) in a variable, then equip things that way.

Also, I was just slightly curious, since I'm trying to figure out Ruby and RGSS better.

Thank you so much, this is exactly what I need!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top