Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Problem with switch controlled skills for enemies

What I want to do is simple, I have a troop where there is a captain and 3 soldiers.  I want the captain to buff his soldiers while they are alive, but when they are all dead I want him to stop buffing and only attack from then on out.  So I have two switches, captain alone and captain not alone. 

My condition for the captain using buffs is that the switch captain not alone is ON.  My condition for fighting is for captain alone ON.  I have it so in the troop the first page has condition of turn 0 and it sets captain not alone ON.

I've tried a few things that all seem to not work at all.  No matter what when the soldiers are dead he still just keeps trying to cast buffs.

The first thing I tried was to have it check every turn (turn 0 + 1*X) and there was a condition branch for each enemy (excluding the captain) if they were all of state Incapacitated Inflicted, then it would turn Captain not alone OFF and captain alone ON.  This didn't work, so I figured that the way RMVX works the enemies maybe don't have an incapacitated state.

So I made 3 pages that had conditions for each of the soldiers HP being at 0% or below.  I then had it set a switch (1,2, or 3) if any of them met those conditions.  I then had a page like before that checked every turn(turn 0 + 1*X) but this time instead of having the conditional fork for states, I just used it for switches.  So if every switch 1,2, and 3 were turned on, then Captain not Alone OFF and captain alone ON.

Still doesn't fucking work.  Pisses the shit out of me.  Does anyone know what I'm doing wrong?  Obviously it must either A.) not be detecting the dead soldiers, or B.) the switch based enemy skills are bogus in VX.  I really don't know what to do.
 
Bump/Update

I've since made it so the monster only uses a skill when alone.  It turns out he uses both the skills for not alone and alone when he's alone... So this leads me to believe it does in fact detect the deaths of the soldiers, because the switch is getting turned on.  I also believe the not alone switch does in deed turn off.

My conclusion is that Enterbrain fucked up yet another script and that once a switch is on, it just has the enemy always use that move, and that if the switch is turned off after that it does not matter it will still use the move.

Should I take this to scripts and see if anyone can figure it out?

It would be helpful if someone could back me up on this and tell me that I'm making sense....
 
Ryuzaki":7mc04tf7 said:
You have to wait 72 hours before bumping ¬_¬


Have you set it so that after all the enemies are dead, the switch turns off?

Yep... the switch is definitely off.  Because I set the switch for alone on the same time I set not alone off.
 
Basically I have it set up like so:  One boss and 3 soldiers. 
The first turn (Turn 0 only) it turns the switch "Not alone" ON (because he isn't alone yet).

Every turn there are 3 separate pages that check to see if a particular soldier has died.  If they have, their respective switch gets turned ON (soldier 1 dead, soldier 2 dead, soldier 3 dead).

Then there's another page that checks each turn to see if all those 3 switches are on.  If they are:
Turn the switch "Not Alone" OFF (because he's now alone)
Turn the switch "Alone" ON

So the fact that "Alone" doesn't start ON but if I kill all the soldiers -- The Boss will then sometimes use a move that I said can only be used when "Alone" is ON -- leads me to believe that "Not Alone" must also be off.  But... he still uses the move that is supposed to only be used when "Not Alone" is on.

So as far as I can tell it's an error in the default scripts.  Am I wrong here or have I found a serious bug?
 
It runs the pages in reverse order, i.e. it does the last page first. I found that out the hard way in my old VX project.


Clarification: If your last page turns the switch off, that's the problem.
 
That would work easier, if at the end of the turn there was a conditional branch. I.e. it checks to see if 'little guy' is under the state Incapacitated or not.

Assuming that'd work of course.
 
Ryuzaki":37fbxfb9 said:
That would work easier, if at the end of the turn there was a conditional branch. I.e. it checks to see if 'little guy' is under the state Incapacitated or not.

Assuming that'd work of course.
it doesn't. enemies don't get the 'incapacitated' state. they just disappear. :\ that's his biggest problem.
 
I think the problem is the pages' orders.

You said you have 3 separate pages that check if one of the three enemies is dead; the problem with this is, if the 2nd enemy dies, the 2nd page will be activated, but the 1st page will never activate. This is because a higher page will override one below it. You can try to find a way to put all three checks in one page, which might solve the problem.
 
But the thing is it has to work because Somewhere the "Alone" switch is being turned on (my proof is that after I kill all the soldiers, the Boss will occasionally use his "Alone" switch move).  And at the exact same time I turn alone on I turn not alone off, so it has to be off.... but the enemy still attacks with his moves that are only supposed to be activated when "not alone" is on.

Try a test run yourself by having a switch activated skill... turn it on and see that he uses, but then try turning it off like a turn after that and he still uses it.... has to be a script error?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top