What code can I put in the lunatic mode code blocks on a skill note tag?
I'm trying to have a game Variable be altered each time the skill is used, but the game doesn't like me using $gameVariables there.
<After Eval>
$gameVariables.value(41) += 1;
</After Eval>
This should illustrate what i want to do, however this doesn't work.
What would be the correct way of coding this?
__________________________________________________________________________________________________
Edit: Figured it out.
I looked through the documentation and found that the gameVariables object has a setValue function.
Correct code:
<After Eval>
$gameVariables.setValue(41, $gameVariables.value(41) + 1);
</After Eval>
__________________________________________________________________________________________________
Edit 2:
Ok, at this point, I'm trying to get the weapon type through this code. As far as I can tell, items, armours and weapons are all "items". That is, they are defined by the item class. I cannot find any part that would store this information. Is there a sub-class for weapons somewhere?
pseudo (as in it doesn't actually work) code
<After Eval>
$gameVariables.setValue(20+user.actorId()*20+(7+user.weapons.weaponType()), $gameVariables.value(20+user.actorId()*20+user.weapons.weaponType()) + 1);
</After Eval>
I'm trying to make a weapon exp system where the more a character uses a weapon type, the better they get with that weapon type.
This code starts with 20 as the first two variable arrays are used for other things, adds the actor id times 20 as each actor gets their array, and then adds the weapon type increase the corresponding variable (plus 7 because the first 7 variables are used for other things).
I'm trying to have a game Variable be altered each time the skill is used, but the game doesn't like me using $gameVariables there.
<After Eval>
$gameVariables.value(41) += 1;
</After Eval>
This should illustrate what i want to do, however this doesn't work.
What would be the correct way of coding this?
__________________________________________________________________________________________________
Edit: Figured it out.
I looked through the documentation and found that the gameVariables object has a setValue function.
Correct code:
<After Eval>
$gameVariables.setValue(41, $gameVariables.value(41) + 1);
</After Eval>
__________________________________________________________________________________________________
Edit 2:
Ok, at this point, I'm trying to get the weapon type through this code. As far as I can tell, items, armours and weapons are all "items". That is, they are defined by the item class. I cannot find any part that would store this information. Is there a sub-class for weapons somewhere?
pseudo (as in it doesn't actually work) code
<After Eval>
$gameVariables.setValue(20+user.actorId()*20+(7+user.weapons.weaponType()), $gameVariables.value(20+user.actorId()*20+user.weapons.weaponType()) + 1);
</After Eval>
I'm trying to make a weapon exp system where the more a character uses a weapon type, the better they get with that weapon type.
This code starts with 20 as the first two variable arrays are used for other things, adds the actor id times 20 as each actor gets their array, and then adds the weapon type increase the corresponding variable (plus 7 because the first 7 variables are used for other things).