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!

[Scripting] How to increase Enemy variable?

Status
Not open for further replies.

Adlw

Villager
Xy$
0.00
Hello everybody


I try to create my SensoryMod, a combat system parallel to the normal .
You have a formula JS has to put in "Notebox" of an enemy to make so that every time this enemy dies a variable adds a value x? I may think and look but I bug since some hours.

I think that i must use this "$gameVariables.value(12)... but after
My variable its number 12 and i want when the ennemy died it's increase the value than i want.
 

eivl

Local Hero
Xy$
0.00
There is no "if enemy dies" check in the game.

you would have to change the core game to do this, in fact, you would be writing a new battle system in this case.
I can explain how you could do this if you want but it would require a lot of JavaScript knowledge.
[doublepost=1448193535,1448193252][/doublepost]Here is the code for what happens when an enemie dies.

JavaScript:
Game_BattlerBase.prototype.die = function() {
      this._hp = 0;
      this.clearStates();
so you would need to extend this method to include
*check if enemy has your code in note
*increase your variable counter
 

Adlw

Villager
Xy$
0.00
Really obliged to make a plugin, I really have only bases from bases in javascritp. Roughly I have to say:
When the enemy arrives in 0HP (with sound ID or not?) increase a variable (the variable is specified in "Notebox")
If in "Notebox" there is this code then the code applies.
 

eivl

Local Hero
Xy$
0.00
give me an example of what you write in your notebox and how would you like the variable to be? should it increase all the time until it has a power level of 9000 or do you want it to reset after x amount?
 

Adlw

Villager
Xy$
0.00
An example of what i would like to seems in Notebox? Euuh like this ?
If (ThisEnemy.ID = 0)
{MyVariable =+ Myvalue;}
I want to reset manually this variable, i woudnt no reset this automatic.

In fact i would use these variable for quest and for create level of training battle.
^^' im naze huh? My poor english not help too
 

eivl

Local Hero
Xy$
0.00
No need to put formulas in note tag, the plugin will do what is needed.
there is no stopping you running formulas, but it is not needed for this in my honest opinion.

you would need something like this :
Code:
<SensoryMod>
Variable: 12
IncreaseValue: 1
</SensoryMod>
and you put this on the enemy note tag.
Then you would use $gameVariables.value(12) for what ever you want.

I hope i have understood what you are asking. If not please bear with me and explain again, I am not native English speaking so i know how you feel! ;)
 

Adlw

Villager
Xy$
0.00
you would need something like this :
Code:
<SensoryMod>
Variable: 12
IncreaseValue: 1
</SensoryMod>
and you put this on the enemy note tag.
Then you would use $gameVariables.value(12) for what ever you want.
Yes it's that !!! totally that !!
 
Status
Not open for further replies.
Top