Is there no way to do this within the damage formula?
I have several skills which use common events individually. In order to tidy them up, I thought it would be ideal to use the damage formula to set the variable Skill [variable 5] to the number of the skill [67, for instance], and then call up the common event "Skill" as one of the effects. The common event would contain conditional branches:
If skill = 67, do the stuff for skill 67. If skill = 68, do the stuff for skill 68. etc. That way I would just need to change the number I set the variable to for each individual skill, but they would all draw upon the same common event. I have the skills I want all working properly, as separate common events, I just want to unify them.
However, every way I have tried to set the game variable within the damage formula box has failed. From memory, I have tried [using both square and round brackets]:
v[5] = 67
$gameVariables[5] = 67
$gameVariables.Value[5] = 67
$gameVariables.setValue(5, 67)
If someone can tell me the correct syntax for the damage formula box to set variable 5 to a value of 67, I would be forever grateful. I have trawled through this thread for an hour, trying many different suggestions, and nothing has worked.
I have several skills which use common events individually. In order to tidy them up, I thought it would be ideal to use the damage formula to set the variable Skill [variable 5] to the number of the skill [67, for instance], and then call up the common event "Skill" as one of the effects. The common event would contain conditional branches:
If skill = 67, do the stuff for skill 67. If skill = 68, do the stuff for skill 68. etc. That way I would just need to change the number I set the variable to for each individual skill, but they would all draw upon the same common event. I have the skills I want all working properly, as separate common events, I just want to unify them.
However, every way I have tried to set the game variable within the damage formula box has failed. From memory, I have tried [using both square and round brackets]:
v[5] = 67
$gameVariables[5] = 67
$gameVariables.Value[5] = 67
$gameVariables.setValue(5, 67)
If someone can tell me the correct syntax for the damage formula box to set variable 5 to a value of 67, I would be forever grateful. I have trawled through this thread for an hour, trying many different suggestions, and nothing has worked.
If you are using Yanfly DamageCore you can just reach the Id of your skill with
Code:
item.idAnd this
$gameVariables.Value[5] = 67
What you thus want is this
Code:
$gameVariables.setValue(5,item.id);Edit: A quick way to test my example is when you the required plugins installed is selecting your skill and make it do damage without variance and put in this
Code:
You will now deal damage equal to your skill id.<damage formula>
value = item.id;
</damage formula>
