Ay_Ze

Villager
Member
Joined
Feb 28, 2020
Messages
6
Reaction score
0
First Language
German
Primarily Uses
RMMV
Like in the title, I want to make a skill that is similar to Demoman from Team Fortress 2 where he uses his sticky bomb to stack up and increase the damage. Making a similarity, I tried on the enemies but it just wont work (I tried using Yanfly stockpile).

Any recommendations?
 

sunnyFVA

how a demon do
Veteran
Joined
Nov 6, 2021
Messages
41
Reaction score
43
First Language
English
Primarily Uses
RMMV
Since you're already using Yanfly content, you could see what this Tips and Tricks entry shows about tracking and manipulating stacks within states on non-user targets. It does not sound like you will be creating a DoT effect, but this should illustrate how to work with the stacks generally. This entry may also be useful, especially if you intend for the state to stack through attacks and/or have a set maximum at which point the damage is triggered.
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
159
Reaction score
42
First Language
br portuguese
Primarily Uses
RMMV
for the state:
Code:
<custom apply effect>
   user._stackingDamage = user._stackingDamage || 0;
   user._stackingDamage++;
</custom apply effect>

<custom remove effect>
   user._stackingDamage = 0;
<custom remove effect>

<custom react effect>
   user._stackingDamage = user._stackingDamage || 0;
   // your damage formula below. i put some examples. remove the // to make  one them valid or create your own

   //value = Math.floor(value * user._stackingDamage);
     
   //if(user._stackingDamage >= 4){value += 800;}
   //else if(user._stackingDamage == 3){value += 500;}
   //else if(user._stackingDamage == 2){value += 200;}

   //value = Math.floor(value * (user._stackingDamage * 500));
</custom react effect>
 

Ay_Ze

Villager
Member
Joined
Feb 28, 2020
Messages
6
Reaction score
0
First Language
German
Primarily Uses
RMMV
(Sorry for my english not the first language)
Thanks for the help but none of them are fit what i'm looking for but what I'm trying to say is that if i place the sticky bomb into the enemy then the state will appear until i stacked it up to 6/8 then i use a different skill to detonate into the enemy that has been affected by the state that will increase the damage depend of how many sticky bomb the enemy is affected.
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
159
Reaction score
42
First Language
br portuguese
Primarily Uses
RMMV
(Sorry for my english not the first language)
Thanks for the help but none of them are fit what i'm looking for but what I'm trying to say is that if i place the sticky bomb into the enemy then the state will appear until i stacked it up to 6/8 then i use a different skill to detonate into the enemy that has been affected by the state that will increase the damage depend of how many sticky bomb the enemy is affected.
this explanation could have come sooner...

state:
Code:
<custom apply effect>
   user._stackingDamage = user._stackingDamage || 0;

   //limiting the stacks to 8 or adding one more
   if(user._stackingDamage > 8){user._stackingDamage = 8;}
   else{user._stackingDamage++;}
</custom apply effect>

<custom remove effect>
   user._stackingDamage = 0;
<custom remove effect>

skill:
Code:
<damage formula>
   b._stackingDamage = b._stackingDamage || 0;
   //setting damage to be 500 per stack. change what you need.
   value = 500 * b._stackingDamage;
</damage formula>
 

Ay_Ze

Villager
Member
Joined
Feb 28, 2020
Messages
6
Reaction score
0
First Language
German
Primarily Uses
RMMV
right i got two issues:

one for the state that wont stack in the enemy

Code:
<custom apply effect>
   user._stackingDamage = user._stackingDamage || 0;
   user._stackingDamage += 1;
   //limiting the stacks to 8 or adding one more
   if(user._stackingDamage > 8){user._stackingDamage = 8;}
   else{user._stackingDamage++;}
  user.setStateCounter(stateId, user._stackingDamage);
</custom apply effect>

<custom remove effect>
   user._stackingDamage = 0;
   user.setStateCounter(stateId, user._stackingDamage);
<custom remove effect>

And for the second it wont let me damage the enemy that has been affected by the state

Code:
<damage formula>
 if (!this._stackingDamage)
{
   b._stackingDamage = b._stackingDamage || 1;
   //setting damage to be 500 per stack. change what you need.
   value = 500 * b._stackingDamage;
}
</damage formula>

sorry i'm new for coding
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
159
Reaction score
42
First Language
br portuguese
Primarily Uses
RMMV
mine works just fine... needs at least 1 stack to cause damage and does 5 damage per stack. used my original code.

plugin order or another factor, maybe?

 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,024
Reaction score
3,194
First Language
English
Primarily Uses
RMMV
Rather than creating a variable on the battler, you could just use Yanfly's built-in state counter functions. Not that adding one thing is going to make your save files bloated or anything, just a minor suggestion.

So...
Code:
<Custom Apply Effect>
if (!target.getStateCounter(X))
{
    target.setStateCounter(X, 1);
    target.clampStateCounter(X, 1, 8);
}
else
    target.addStateCounter(X, 1);
</Custom Apply Effect>
where X is the ID of your state.

Then in your skill you can reference b.getStateCounter(X) to reference how many stacks are on there.

And for the second it wont let me damage the enemy that has been affected by the state

sorry i'm new for coding
Then why did you change the code nuke gave you? That if check you put around the whole thing 1) isn't necessary, even if you did it correctly, and 2) broke your skill, along with the change from 0 to 1.

Also, do you have the required plugins? I don't see that addressed anywhere in this thread - the code nuke gave you relies on you having the States and Buffs Core as well as the Damage Core, which I don't think most people use.
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
159
Reaction score
42
First Language
br portuguese
Primarily Uses
RMMV
the 1 he added was to make the skill cause damage even without a state present, but i think it would be weird based on his description. if one would press a detonator, it would make sense to have the explosive set first...

the rest, i really dont know why he changed.

Rather than creating a variable on the battler, you could just use Yanfly's built-in state counter functions. Not that adding one thing is going to make your save files bloated or anything, just a minor suggestion.
[...]
i just went along with the stacking damage tips and tricks... and i think its cleaner. kind of...
 
Last edited:

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
159
Reaction score
42
First Language
br portuguese
Primarily Uses
RMMV
(Sorry for my english not the first language)
[...]
i just noticed: english is your 1st language (says your info)... :mrsatan:


EDIT: so, let me redo, step by step, what was proposed:
1) have yanflys plugins set in the right order. youre going to need damage core and buffs & states;
2) create a blank state, give it an icon, set it to auto-remove however youd like (or leave it there without decaying);
3) put the code below in its note box. ive added the counter to the code since i think youd like the player to know how many stacks are there.

Code:
<custom apply effect>
   user._stackingDamage = user._stackingDamage || 0;

   //limiting the stacks to 8 or adding one more
   if(user._stackingDamage >= 8){user._stackingDamage = 8;}
   else{user._stackingDamage++;}
   //change ID below to fit your game
   user.setStateCounter(ID, user._stackingDamage);
</custom apply effect>

<custom remove effect>
   user._stackingDamage = 0;
   //change ID below to match your state
   user.setStateCounter(ID, 0);
<custom remove effect>

4) create a skill to apply the state;
5) create a skill to cause damage. put the code below in its note box. ive added a line that removes the state since the bombs will detonate
Code:
<damage formula>
   //if changing zero below to 1, the skill will work without the state
   b._stackingDamage = b._stackingDamage || 0;

   //setting damage to be 500 per stack. change what you need.
   value = 500 * b._stackingDamage;

   //remove the bombs. replace ID with your state id
   b.removeState(ID);
</damage formula>

6) test.

EDIT2: also, hit F8 whenever youre testing and something didnt work. the console might give you a hint of what went wrong.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,024
Reaction score
3,194
First Language
English
Primarily Uses
RMMV
the 1 he added was to make the skill cause damage even without a state present, but i think it would be weird based on his description.
Exactly, that's why I said it broke his skill...it makes putting the state on the target one time pointless if it's going to cause one stack of damage anyway. Better to cause a set amount of damage and then add or multiply based on the stacks, including 0.

Even better yet to use the Selection Core and not be able to use it on a target who doesn't have the state. But that's a separate matter...
 

Ay_Ze

Villager
Member
Joined
Feb 28, 2020
Messages
6
Reaction score
0
First Language
German
Primarily Uses
RMMV
yea i thought its going to change the language for the website

Other than that, it finally worked because i've restart the plugin and the application entirely.

Thank you very much for the help
i just noticed: english is your 1st language (says your info)... :mrsatan:


EDIT: so, let me redo, step by step, what was proposed:
1) have yanflys plugins set in the right order. youre going to need damage core and buffs & states;
2) create a blank state, give it an icon, set it to auto-remove however youd like (or leave it there without decaying);
3) put the code below in its note box. ive added the counter to the code since i think youd like the player to know how many stacks are there.

Code:
<custom apply effect>
   user._stackingDamage = user._stackingDamage || 0;

   //limiting the stacks to 8 or adding one more
   if(user._stackingDamage >= 8){user._stackingDamage = 8;}
   else{user._stackingDamage++;}
   //change ID below to fit your game
   user.setStateCounter(ID, user._stackingDamage);
</custom apply effect>

<custom remove effect>
   user._stackingDamage = 0;
   //change ID below to match your state
   user.setStateCounter(ID, 0);
<custom remove effect>

4) create a skill to apply the state;
5) create a skill to cause damage. put the code below in its note box. ive added a line that removes the state since the bombs will detonate
Code:
<damage formula>
   //if changing zero below to 1, the skill will work without the state
   b._stackingDamage = b._stackingDamage || 0;

   //setting damage to be 500 per stack. change what you need.
   value = 500 * b._stackingDamage;

   //remove the bombs. replace ID with your state id
   b.removeState(ID);
</damage formula>

6) test.

EDIT2: also, hit F8 whenever youre testing and something didnt work. the console might give you a hint of what went wrong.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,024
Reaction score
3,194
First Language
English
Primarily Uses
RMMV
Other than that, it finally worked because i've restart the plugin and the application entirely.
I don't know what "restart the plugin" means, but you don't need to do that. What you do need to do, is any time you make changes to your project you need to start a new game, not load a save. Save games store a lot of the game info in them, so many changes won't be reflected.

Glad you got it working.
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
159
Reaction score
42
First Language
br portuguese
Primarily Uses
RMMV
restart a plugin means that you remove it from the list and add it again. it will come with its default settings. handy if there are a lot of settings, things are wrong somehow and you have long forgotten what and how you changed it.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,024
Reaction score
3,194
First Language
English
Primarily Uses
RMMV
restart a plugin means that you remove it from the list and add it again.
If you say so - I know what that procedure does, but that's not the word I would choose :wink:
 

Ay_Ze

Villager
Member
Joined
Feb 28, 2020
Messages
6
Reaction score
0
First Language
German
Primarily Uses
RMMV
is there a way to make a requirement for the skill like the skill wont be used unless the enemy has the "sticky bomb" as a state? or do i need to make a new post?
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
159
Reaction score
42
First Language
br portuguese
Primarily Uses
RMMV
is there a way to make a requirement for the skill like the skill wont be used unless the enemy has the "sticky bomb" as a state? or do i need to make a new post?
that will depend on your approach. how much do you want to hide and how will the skills operate?

a simpler way is just making the skill select targets with "bombs".
like this:
Even better yet to use the Selection Core and not be able to use it on a target who doesn't have the state. But that's a separate matter...

other matter would be making the skill only visible if there are "bombs".

theres also the matter of the targeting scope of the detonating skill: will it detonate all of the bombs at once or will it only detonate targets you select (so if multiple targets are with "bombs", only one of them "gets bombed" per use, leaving time to other targets remove the bombs, maybe - maybe not)?
 

Ay_Ze

Villager
Member
Joined
Feb 28, 2020
Messages
6
Reaction score
0
First Language
German
Primarily Uses
RMMV
that will depend on your approach. how much do you want to hide and how will the skills operate?

a simpler way is just making the skill select targets with "bombs".
like this:


other matter would be making the skill only visible if there are "bombs".

theres also the matter of the targeting scope of the detonating skill: will it detonate all of the bombs at once or will it only detonate targets you select (so if multiple targets are with "bombs", only one of them "gets bombed" per use, leaving time to other targets remove the bombs, maybe - maybe not)?
Yea the selection core is what I needed, cheers!
 

Latest Threads

Latest Profile Posts

Fun question - how do you manage the scope of your projects? All of my projects seem to balloon until they pop and they are suddenly nonexistent!
no I did not just have to write a song three different times because my music software doesn't support tempo changes!!
I WILL defeat this demonic USB connection notification bug
ScreenShot_8_15_2022_6_22_24.png
Mike trying to dodge the Memory Pawns invading Bantam Street. I like how the filters I used on the map almost make it look like the street is wet in a sense.
Come watch as Studio Blue plays OMORI live on the final RPG Maker Critiques stream!

Forum statistics

Threads
124,567
Messages
1,164,449
Members
163,385
Latest member
goonfuture
Top