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.

2 Quick Questions: Variable/Call Script

Hello everyone!

First Question:
I was fiddling around with the Variables in VX when I decided that I want a Variable to store a percentage rather than a number. So that I may call upon it when necessary.

For example, let's say you lose a battle, I would like for a Variable to come up that holds 10% to be the amount of EXP lost, and another Variable that holds 50% for, let's say, how much Gold the party loses and vice-versa.

I'm not sure if this would work, but I was thinking you could store a percentage in a Variable using a Call Script like:

Code:
$game.variable[1] = 10%

Or something like that you know? But that doesn't work, so if anyone has a solution then please let me know!


Second Question:  [RESOLVED] :toot:
I was also wondering, in a Call Script, if it was possible to change which class can use which weapon? For example, let's say I want Arshe's class not to be able to use the Excalibur or whatever at all until later in the game (whether you get the weapon or not is irrelevant), without changing classes, what would the call script be so that it let's him use it later on? And same goes for other party members as well as other equipment.

Thanks!
-Krobe
 
I don't have alot of time right now, but i'll answer your second question quickly. The line should be this:
Code:
# For weapons
$data_classes[$game_actors[ACTOR_ID].class_id].weapon_set.push(WEAPON_ID)

# For armors
$data_classes[$game_actors[ACTOR_ID].class_id].armor_set.push(ARMOR_ID)

But since that line is too long for a call script, and let's say you wanted to enable aluxes to use the weapon Bronze axe, in a call script your line could look like this:
Code:
a = $game_actors[1].class_id
$data_classes[a].weapon_set.push(9)

I hope that helped :thumb:

Over and out - Gando
 

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