Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

$gameVariables.addValue()? Whats the command?

Status
Not open for further replies.
How do I say in rm mv java script add a value to this variable?
JavaScript:
<Post-Damage Eval>
if (target.hp <= 0) {
  $gameVariables.addValue(70, 1);
}
</Post-Damage Eval>
<Custom Parameters>
atk = $gameVariables.value(70);
</Custom Parameteres>
I'm trying to make a sword that does more damage based off this variable.
 

Boy Who Codes

Praised Adventurer
Xy$
0.00
Well if you want to add a value to a variable:

Code:
$gameVariables.setValue(var, value);
where var is the variable number and value being the value you want to set it from.
 
<Post-Damage Eval>
JavaScript:
if (target.hp <= 0) {

var x = $gameVariables.value(70);

x = x + 1;

$gameVariables.setValue(70, x);

}
</Post-Damage Eval>

<setup action>

display action

immortal: targets, true

</setup action>

<target action>

if user.attackMotion() !== 'missile'

move user: targets, front, 20

else

perform start

end

zoom: 125%, 30

camera screen: target, front center, 30

camera focus: target, front center, 30

wait for movement

motion attack: user

wait: 10

attack animation: target

wait for animation

action effect

</target action>

Figured it out.
 
Status
Not open for further replies.
Top