chungusblastee

Villager
Member
Joined
Mar 21, 2021
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
I'm working on a golem unit that should spawn a smaller golem every time it is damaged with a value over 25. I'm trying to use custom respond effect on state 27's notes to get the variable to increase by one, which would spawn a smaller golem once if the damage on it was over 25. Essentially, every time the golem is damaged over 25, one spawn of smaller golems appears. I'll attach everything I've done so far but if I need to supply anymore information please let me know. Also, I'm a beginner so explaining every minor thing might help me more! :biggrin:

Elder Iron Golem --> State 27 (if damage over 25 increase variable 12 by 1) --> Variable 12 (If variable 12 is increased by 1 common event 8 should allow one smaller golem to appear)

Discord: Jeramy#7017 (if you would like to explain through share screens/mic/messages)

Notes for state 27:

<Custom Respond Effect>

if (this.isHpEffect() && value > 25)

$gameVariables.setValue(12, $gameVariables.value(12) + 1);

</Custom Respond Effect>

State 27:
1617165955725.png
Common Event: 8
1617165735046.png
Troop 32 / Variable 12:
1617167273191.png
Enemies: Elder Iron Golem (35) / Baby Iron Golem (36)
1617167431333.png
 

Attachments

  • 1617164821351.png
    1617164821351.png
    91.7 KB · Views: 3
  • 1617167104235.png
    1617167104235.png
    273.4 KB · Views: 3
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,212
Reaction score
14,684
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

chungusblastee

Villager
Member
Joined
Mar 21, 2021
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
[move]Plugin Support[/move]
Thank you for your hard work Shaz! Sorry for placing it in the wrong forum. I also had issues with adding threads and for some reason posted duplicates. If you would like to delete the first two I wouldn't mind. (Just so the same topic isn't spammed)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,212
Reaction score
14,684
First Language
English
Primarily Uses
RMMV
I didn't see them. If you can report them and ask for them to be deleted as they're duplicates, I (or someone else) will take care of it for you.
 

chungusblastee

Villager
Member
Joined
Mar 21, 2021
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
Bump
No clue how to make this mechanic work. Is there any way for a troop condition to activate everytime 25+ damage is done?
 

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
98
Reaction score
133
First Language
German
Primarily Uses
RMMV
Heyho!
I'm still a novice when it comes to Yanflys Lunatic Mode, but since no one else did answer yet and it's an interesting mechanic I played around a bit and I found a solution that might work for you:

Unfortunately I don't know exactly how to change a variable from a state note tag so I can't tell you why your code isn't working, but I do know how to force an action from this note tag. So you could force your Golem to use a skill, when it takes > 25 damage. This skill can call a common event and with this you have full controll over variables, switches & whatever you want.

So your state note tag would be:


<Custom Respond Effect>

if (this.isHpEffect() && value > 25)

var skill = 1;

var target = -1;

BattleManager.queueForceAction(user, skill, target);

</Custom Respond Effect>

The number following "var skill = " would be the skill ID
The number following "var target = " defines who's the target (-1 = random, -2 = last target)
In this case this wouldn't matter since your skill will just call a common event.
Let this common event add 1 to your variable. From now on everything should work like you set it up.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
957
Reaction score
504
First Language
English
Primarily Uses
RMMV
There are a couple of problems.

1 - You never say what your problem is. Presumably you're not spawning the little golems, but have you actually checked whether the variable is getting increased by the state? If it's not, you can use coucassi's instructions to take care of that, but that won't make everything else work correctly.

2 - Your battle event is set up incorrectly. You want to set the variable to 0 and run an event, but the condition is Don't Run, so it...wont' run. Also, why do you want to do that? If you set the variable to 0 then run your event, it will always have a value of 0.

To achieve what you want, you want two battle events. Give one the condition of Turn 0, so it happens at the beginning of the battle, and set the variable to 0 to initialize it.

Then, have a second battle event with a condition of Turn 1 + 1, so it will run at the beginning of every turn in battle. Have that run your common event.
 

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
98
Reaction score
133
First Language
German
Primarily Uses
RMMV
My bad, I just assumed something would be wrong with the code because of the title. ATT_Turan is totally right, it is your battle event that causes the problem, so your code might actually work.

Still I believe there is another problem conerncing the span of the battle event. @ATT_Turan please correct me, if I'm wrong here:

You will need to set the span of the first event that happen at the beginning of the battle and sets the variable to zero to battle in order to prevent it from happening again and again.

For your second event this mechanic causes a problem: You can't set the span to battle, since you want to have more than one little golem to appear.
If you set it to turn, the event will only run once per turn, so if the big golem > 25 damage from two or more actors, only the first attack will make a little golem spawn.
If you set it to moment the event will repeat itself immediately, which will your game cause to crash, since every small golem is just able to spawn once.

As I said, without some testing I am not entirely sure that this will happen, but I think this is the way it works ...

To avoid that I would recommend using a switch in addition to the variables. The Switch turns on when the golem takes > 25 damage, so you can add the code for that to the Custom Respond Effect or use a common event in a skill, like I suggested earlier.

The you have to se the condition of your battle event that spawns the golems to that switch and include a line that after the golem spawned sets the switch back to off. The span of this event could be moment then, without causing your game to crash and still the event could run multiple times per turn.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
957
Reaction score
504
First Language
English
Primarily Uses
RMMV
Still I believe there is another problem conerncing the span of the battle event. @ATT_Turan please correct me, if I'm wrong here:
You're wrong :smile:
You will need to set the span of the first event that happen at the beginning of the battle and sets the variable to zero to battle in order to prevent it from happening again and again.
I'm not sure what you're saying - what does "set the span to battle" mean? He should set it up exactly as I stated: a battle event whose condition is Turn 0 + 0 will happen one time as soon as the battle screen comes up.
For your second event this mechanic causes a problem: You can't set the span to battle, since you want to have more than one little golem to appear...To avoid that I would recommend using a switch in addition to the variables.
All of this is unnecessary. Again, I don't know what you mean by setting a span, I don't see any setting or wording like that in my battle events - perhaps we're having a mistranslation? Or you're thinking of the scope of the variable...but it doesn't have one because he's not using script to declare a temporary variable, he's using one of the game's built-in global variables.

I believe the events should work properly as I described before, but if you can explain what you mean with this span stuff, I'm absolutely open to correction.
 

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
98
Reaction score
133
First Language
German
Primarily Uses
RMMV
I'm not sure what you're saying - what does "set the span to battle" mean?
It may in fact be a mistranslation, if so I am sorry. What I mean is this part of the troop event page:
BattleEvent.png

There are three possible settings (again there may be some mistranslations but I think you will get what I mean):

Battle - the event will happen once per battle, if the conditions are met
Turn - the event will happen once per turn, if the conditions are met
Moment - the event will happen multiple times per turn, as long as the conditions are met

My thought was: If you want more than one golem to spawn during the same turn, namely every time the big golem suffers more than 25 damage, you have to use either multiple battle events or set the "Spanne" (which it's called in german, the circled thingy in the screenshot) to "Moment".

If you do so however this event will try to repeat itself as long as the conditions are met. As long as those conditions are just the turn as a condition of the battle event and the variable as a condition of the common event, they are still met, even after the golem spawned.
That's why I thought of using a switch as a condition which will turned of automatically after the golem spawned, but will be turned on again, if the big golem suffers the damage.

As I said I put more trust in your experience than in mine, but I thought this is how battle events work. If not I would appreciate anyone to explain which part I got wrong in particular^^

I'm still not sure if I got all the terminology right. Also sorry if I caused to much confusion x.x
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
957
Reaction score
504
First Language
English
Primarily Uses
RMMV
It may in fact be a mistranslation, if so I am sorry. What I mean is this part of the troop event page:
No, you are completely right! I just never noticed that tucked in the corner! I apologize for contradicting you incorrectly.

The default is Battle, which is what he wants for initializing the variable at Turn 0. For the rest of it, he'd have to decide whether he wants to be checked once a turn or constantly as the damage is applied, and a switch is a very good idea (or some more complex checks in the state so that he doesn't go from the variable being 1 to 4 in one turn before anything gets spawned).
 

chungusblastee

Villager
Member
Joined
Mar 21, 2021
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
Thank you coucassi, and ATT_Turan so much! The copper golem state is working almost perfectly. Currently, I only have one peculiar issue. Right now, the state works perfectly without an animation being played. But if I were to add an animation, the Giant Copper Golem gains immortality after being reduced to 0! I'm not sure exactly how to fix it, but I'll make sure to attach everything I've done so far.
-2 Hours later: I did a lot of tinkering with the animations, and I seem to have made it a little worse because now the Giant Copper Golem seems to always be immortal. I'm going to take a break for now, but I'm positive there was a moment where I had it working perfectly without the Giant Copper Golem being immortal.
Link to the battle test after I messed it up a little:


Credits:
Ækashics for the golem side view battler, here's a link to the website where it can be found!

whtdragon for the copper golem's sprite, heres a link to the forum

Enemies:
(32) Giant Copper Golem
1618068174061.png
(34) Newborn Copper Golem:
1618068259911.png

States:
(26) Chipping Copper Golem:

<Custom Respond Effect>

if (this.isHpEffect() && value > 25)

var skill = 85;

var target = -2;

BattleManager.queueForceAction(user, skill, target);

</Custom Respond Effect>

1618068327955.png

Skills:
(85) Chipped Copper Golem
1618068397639.png

Common Events:
(12) Add 1
1618071054205.png
(15) Copper Reformation Switch
1618071038951.png
Troops:
(24) Giant Copper Golem:
1618068634479.png
1618068759442.png
 

Attachments

  • 1618068464756.png
    1618068464756.png
    164.5 KB · Views: 1
  • 1618068496385.png
    1618068496385.png
    158.4 KB · Views: 1

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
957
Reaction score
504
First Language
English
Primarily Uses
RMMV
I'm not sure about your immortality problem, but I do have a few questions.

1 - In your state, why are you declaring variables that always have the same value and are only used once? It's considered poor practice in coding, and it doesn't do anything except take up extra lines in your state.

2 - What's the point of having a common event that only turns a switch on? Any place you call that event you could simply have the command to turn the switch on directly.

3 - When do you use that, anyway? I should think you'd have a Turn 0 battle event that turns your switch on, but I don't see that, and I don't see anyplace that calls your unnecessary refromation [sic] event.

4 - I'm surprised your Custom Respond code works at all as expected. By default, only the first command after an if check is executed; if you want it to do all of the things (and only do them when the condition is true), it should have braces around it. Fortunately, as I said above, you don't need all of those lines, your entire response could be:
Code:
<Custom Respond Effect>
if (this.isHpEffect() && value > 25)
    BattleManager.queueForceAction(user, 85, -2);
</Custom Respond Effect>
 
Last edited:

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
98
Reaction score
133
First Language
German
Primarily Uses
RMMV
This immortality thing seems really strange, even more since you said it happens only if you use an animation. Maybe it is absurdly long and the battle can't end before it is played through?
Seems really unlikely to me, but it is the only thing I can think of. Just in case please take a screenshot of the animation settings too.

Can you confirm that the golem does not stay immortal even without the animation?
 

chungusblastee

Villager
Member
Joined
Mar 21, 2021
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
I'm not sure about your immortality problem, but I do have a few questions.

1 - In your state, why are you declaring variables that always have the same value and are only used once? It's considered poor practice in coding, and it doesn't do anything except take up extra lines in your state.

2 - What's the point of having a common event that only turns a switch on? Any place you call that event you could simply have the command to turn the switch on directly.

3 - When do you use that, anyway? I should think you'd have a Turn 0 battle event that turns your switch on, but I don't see that, and I don't see anyplace that calls your unnecessary refromation [sic] event.

4 - I'm surprised your Custom Respond code works at all as expected. By default, only the first command after an if check is executed; if you want it to do all of the things (and only do them when the condition is true), it should have braces around it. Fortunately, as I said above, you don't need all of those lines, your entire response could be:
Code:
<Custom Respond Effect>
if (this.isHpEffect() && value > 25)
    BattleManager.queueForceAction(user, 85, -2);
</Custom Respond Effect>
I am very very new to rpgmaker mv and to coding. The simplest of things are most complex from my view because I haven't fully developed an understanding of how to make everything work seamlessly.

1. At the time, I was not sure how the code works so I made sure not to take away anything in fear of making the code malfunction. Reading your response made me understand which variables I don't need and I'll make sure to remove them, thanks!

2. Good point, I tried to make the switch turn indefinitely on by making it's condition:
Turn 0 x 0 or Enemy HP 100% or below, but it seems to no longer spawn the newborn copper golems. I even removed the conditional branch and it looks something like this.
1618083307092.png
3. The copper reformation switch is an event that would turn the switch for the battle event, copper switch 1, on. From what I understand I think it is poor practice to do it that way, since you let me know it can be turned on indefinetely. But turning the troop battle conditions on indefinitely seems to break it, so I'm not sure what I'm doing wrong.

4. Yeah I'm suprised too, but I spent a few hours tinkering with it until it worked. I guess I kept trying until I finally got a result close enough to what I want, but I'm sure from your comments there is a lot of room for improvement! One again thank you and thanks to coucassi, we're finally getting some results.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
957
Reaction score
504
First Language
English
Primarily Uses
RMMV
2. Good point, I tried to make the switch turn indefinitely on by making it's condition:
Turn 0 x 0 or Enemy HP 100% or below, but it seems to no longer spawn the newborn copper golems. I even removed the conditional branch and it looks something like this.
I strongly suggest you take a break from this and do some of the RPG Maker event tutorials that you can find on YouTube or the tutorials forum here. You're trying to follow instructions without knowing what anything means, and you change things slightly and then it doesn't work and we're trying to react to what you changed.
3. The copper reformation switch is an event that would turn the switch for the battle event, copper switch 1, on. From what I understand I think it is poor practice to do it that way, since you let me know it can be turned on indefinetely.
I don't know where you got this "turn on indefinitely" thing from - I said there's no point in clicking in your event and selecting the Common Event button and choosing an event just to turn on a switch...just click in your event and select the Control Switches button. You were already turning on the switch in your Add 1 event, I have no idea why you made another event just to do it again.

If you just go back to the way you were set up in post 12, with the adjustments I commented on, but change the span of the battle event to Moment like coucassi said, I don't see why it shouldn't work exactly as you like.
 

chungusblastee

Villager
Member
Joined
Mar 21, 2021
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
This immortality thing seems really strange, even more since you said it happens only if you use an animation. Maybe it is absurdly long and the battle can't end before it is played through?
Seems really unlikely to me, but it is the only thing I can think of. Just in case please take a screenshot of the animation settings too.

Can you confirm that the golem does not stay immortal even without the animation?
It does stay immortal even after taking away the animation, so I made an incorrect observation. I took away the animations and it seems the unit is still immortal. So I'm beginning to narrow the issue down to the force action skill. If the golem is killed with damage under 26 the state does not activate, and the golem can be killed. However if the damage is over 25 then the state activates and the golem casts the skill (chipped copper golem) and becomes immortal.
The skill also seems to spawn the newborn copper golem after the golem's next turn, not during the initial hit. I gave the skill extra speed but it did not change anything sadly.
 

chungusblastee

Villager
Member
Joined
Mar 21, 2021
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
I strongly suggest you take a break from this and do some of the RPG Maker event tutorials that you can find on YouTube or the tutorials forum here. You're trying to follow instructions without knowing what anything means, and you change things slightly and then it doesn't work and we're trying to react to what you changed.

I don't know where you got this "turn on indefinitely" thing from - I said there's no point in clicking in your event and selecting the Common Event button and choosing an event just to turn on a switch...just click in your event and select the Control Switches button. You were already turning on the switch in your Add 1 event, I have no idea why you made another event just to do it again.

If you just go back to the way you were set up in post 12, with the adjustments I commented on, but change the span of the battle event to Moment like coucassi said, I don't see why it shouldn't work exactly as you like.
Sorry if this is frustrating to you. I don't enjoy watching a lot of tutorials because I don't remember a lot of the information I was taught. I would rather learn hands on and make many mistakes, and eventually learn to refine my practices. Regardless, I'll listen to your advice and I will watch Java code tutorials related to rpgmaker MV since I've read it might help with using/understanding how to operate Yanflys Lunatic mode plugins. I'll make sure to take breaks from this troop event. However, I'm going come back to this thread regulary because it will bug me if I don't refine and complete it.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
957
Reaction score
504
First Language
English
Primarily Uses
RMMV
You don't have to watch anything, there are plenty of Web sites that have interactive tutorials you type into. But actually learning is much more effective than just blundering off all day on a single project.

Did you try it with the changes I suggested?
 

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
98
Reaction score
133
First Language
German
Primarily Uses
RMMV
I would agree with ATT_Turan that it might help to do something else for a time, just to get your head free and get used to the base mechanics : )

But if it bugs you so much right now maybe you are better off starting all over again with this mechanic, since at least I am a bit lost now with all these screen shots and changes you made^^

Best create a new troop or even a new project and remove all plugins you don’t need to pullt his off.

Here’s a step by step instruction that I hope will do the trick. It’s pretty late here though, so I can’t assure you that I did not forget something.

  • Create a Common Event “Add 1”
  • Make this event turn on a switch “copper switch”
  • Make this event add +1 to variable “random despawn”
  • Create a Skill “Chipped Copper Golem”
  • Make this skill this call the common event “Add 1”
  • Set this skill to Certain Hit
  • Create a State “Chipping Copper Golem”
  • Set the auto time removement to None
  • Add this code to the notetag
<Custom Respond Effect> if (this.isHpEffect() && value > 25) BattleManager.queueForceAction(user, 85, -2); </Custom Respond Effect>



  • Make sure “85” is replaced by the ID of the Skill “Chipped Copper Golem”
  • Create an enemy “Copper Golem”
  • Add this code to it’s notetag
<Passive State 26>

  • Make sure “26” is replaced by the ID of the state “Chipping Copper Golem”
  • Create an enemy “Newborn Copper Golem”
  • Create a troop
  • Add 1 “Copper Golem” and 4 “Newborn Copper Golem”
  • Set the Condition of the first Event Page to Round 0+0
  • Set the span of the first Event Page to battle
  • Add a Command to the first Event Page that Sets the variable "random despawn" to 0
  • Add a second Event page
  • Set the Condition of the second event page to Switch: “Copper Switch”
  • Set the Span of the second event page to “Moment”
  • Add the following Commands to the second event page
If: Variable Random Despawn = 1 Enemy Appear: #2 Newborn Copper Golem If: Variable Random Despawn = 2 Enemy Appear: #3 Newborn Copper Golem If: Variable Random Despawn = 3 Enemy Appear: #4 Newborn Copper Golem If: Variable Random Despawn = 4 Enemy Appear: #5 Newborn Copper Golem Control Switches: Copper Switch OFF

You won’t need any additional switches, no Instant Cast and no extra speed on the skill.

If you follow these steps and do not add anything else, it should work out.

If not there might be a plugin incompatibility. From what I saw you are using more plugins than just the ones needed for this mechanic and since you stated you aren’t that experienced they might be in the wrong order or interfere with each other in other ways.

As said above I would recommend you to try all this with an empty project first, to make sure nothing is getting in the way.

EDIT: Did you make changes to State #1 by any chance? This one has to be the K.O state. If you deleted or changed it to something else, this might cause your enemies being immortal.
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Working on a case. Get all the evidence to prosecute some bad guys. :kaojoy:
But, the game development schedule delayed. :kaoswt2:
The moral of the story: No good deed goes unpunished... I guess...
Except that, nothing to see here. :kaoswt2:
just beat ff7 original for the first time since 2010. having played remake last year, I have a much better appreciation for the original oddly enough. I still like some of the character presentation in remake more, but the original's got a lot going for it.
Ever reach that moment in your life when your juggling a dozen or more projects that you know will never be made but don't have the heart to delete them? Ugh, I hate those moments...
:kaosigh: Why must you hurt me so?
my main character isn't the warrior of light or the chosen one, he's a self righteous, invasive try hard who gets ahead of himself and makes a critical error, resulting in a downward moral spiral that, eventually, leads him to truths that make him a better man, and im DAMN proud of that.

Forum statistics

Threads
111,451
Messages
1,061,202
Members
144,817
Latest member
tocurse
Top