RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Getting an event to trigger based on player's SP

0 Members and 1 Guest are viewing this topic.

*
Rep: +0/-0Level 86
Hey all, this is my first post, not sure if it's in the right forum, but I'm having trouble with an event and looking for guidance.

So I'm trying to have a "Frenzy" mode activate when an actor's SP goes to 0. Of course, there's nothing simple under the Conditional Branch like "If Character's SP == x," so what I've done is set up a parallel process Common Event that states:

Set Variable x = Character's SP

I then have a second parallel process Common Event that states:

If Variable x == 0, inflict state "Frenzy"

For some reason I find it works better to split these two into separate common events, though in theory they should work as one. Also, the trigger is some arbitrary switch that's activated toward the start of the game.

In addition to this, I'd like Frenzy state to cause the player to attack randomly, i.e., target both friendlies and hostiles, so I've implemented a battle event, with the condition of Don't Run, using a Conditional Branch that states:

If "Frenzy" is inflicted, force "Actor" action "Attack" on target "Random."

So ideally, what we have, is when the player's SP hits 0, he goes into Frenzy, and attacks random targets. However, the way it's ACTUALLY happening is that if the player's SP goes to 0 outside of combat, it only registers after he enters combat. Further, if it goes to 0 inside of combat, nothing happens. And to top it off, even if the player IS Frenzy inflicted, he's not attacking random targets.

Now in a perfect world I'd like to get to the point where little message windows pop up like "[Actor] is losing control..." and (as I've tied the Frenzy state to NAMKOR's Deathwatch State, which kills the player after x rounds of being inflicted) "[Actor] has lost himself to the Beast Within." However, this is secondary to actually getting the crap to work.

So if anyone has any advice, or can do a better version of this (admittedly haphazardly patched together) event sequence, or, even better, can just whip up or point me to a script that does the exact same thing, please post away.

Thanks.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, I think this is an example of something better left to scripts, but I will help the best I can. First, in all troops I would say you should have a page which runs every turn that calls both the common event that inflicts frenzy and the common event that does the force actio thingy. Try that. If you can't get it to work I'll make a demo.

*
Rep: +0/-0Level 86
Hey, thanks a lot.  Yeah my main foul up was in Battle Events.  Turns out its best to leave the Common Events out altogether and do the entire processing inside of Battle Events. 

Thanks again for your help.