Cookie Holiday 3 Posted July 18, 2015 I've tried messing around with some scripts and custom damage formula but honestly my knowledge on either is laughable so I'm coming up just a little short on what I want. I want to make an upkeep spell that can be cast on a target, which drains the casters MP each turn it is upheld and then stops doing so once the skill is selected again as it turns off the effect of the skill. Any idea how I can make a kind of toggle like this? I used one of Hime's scripts to toggle states but this only works on the state that is cast and keeps the upkeep cost ticking on the caster even once the spell is stopped. Thanks in advance. Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 20, 2015 Giving this a bump. (Y) Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 20, 2015 (edited) if b.state?(3); b.remove_state(3); else; b.add_state(3); end This formula asks if target has state with ID 3.If target has that state active then it will be removed;if not, the state will be added. And add magic regeneration on that state, for example -10% ; it will drain 10% MP / turn when state is active ~ removing that state will stop MP draining. Hope that helps! =) Edited July 20, 2015 by Rikifive 1 Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 20, 2015 Nice one, that's great! I've got a bit of a problem though, I'd like it to drain the MP of the caster, not the person who is under the effect of the spell itself. That's the bit that's giving me the most headache. Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 20, 2015 Could you provide more details about how it supposed to work? =) Then I'll be able to change formula to work properly. =P Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 20, 2015 Sure! One character is a Bard class and their abilities are split into two different types, notes and melodies. Notes are skills that work in a single turn but melodies are the upkeep ones I need help with. The idea is that he plays a melody to either himself, an ally or an enemy (depending on whether it gives a positive or negative effect depends on the target of course). While he's playing this melody it causes him to expend MP but also keeps the effect on the target of choice. Once the skill is selected again both the effect and the MP loss are removed. I'm quite willing to have the effects limited to states if that makes it easier to manage in any way. I hope that explains well enough? Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 20, 2015 (edited) This explains everything. =) ----------------------------------------------------------------- Crap, I didn't knew there is a limit when writing damage formula. :/ I know how to do that - I wanted to make *let's name it* double formula. I wanted to write that: if b.state?(3); b.remove_state(3); else; b.add_state(3); end || if a.state?(10); a.remove_state(10); else; a.add_state(10); end Let's assume state #3 is a buff/debuff that is applied on target (That's what we got already) and state #10 is a *debuff* that drains MP of the caster. Then this formula would do what we already managed to do, plus ask if caster has state #10 and do the same stuff. (I think that would work, but I can't even test that). The problem is that, the formula is long as balls and it can't fit into the damage formula, so... at this point I'm not able to help you, I simply don't know how to bypass the limit. Sorry. I didn't expected that... :/ That's kinda stupid, that game *by default* blocks your possibilities. :/ It perhaps could be done via events, but I didn't used that yet, so I don't know how to setup that properly. ~but I must admit, your idea is cool. Edited July 20, 2015 by Rikifive 1 Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 20, 2015 I had a feeling it was something along those lines but I don't really know what I'm doing with the formulas to actually implement it. Thanks for trying at least, you've got me closer than I'd managed to by myself so I'll adapt it in some way or, hopefully, find some way around it. I vaguely remember seeing someone ask about the limit in characters the formula box has and if there's a way to make it longer, I seem to remember there was, by script maybe? Honestly that may be wishful thinking but I'll see what I can find tomorrow, Either way thanks for the help, much appreciated! If anyone else out there is able to give any that would be awesome too. 1 Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 20, 2015 Yeah, I think I saw something about using scripts too, but I don't remember where, what is more I don't know how it works. =P Today I learned that there is a limit. (I seriously didn't realized that before) =P I'm really sorry, I hope somebody else will help you with that. 1 Share this post Link to post Share on other sites
Tarq 746 Posted July 20, 2015 (edited) Riki had the right idea, near enough Have the skill call a common event and in that common event have the conditional if Actor has state[x] inflicted then remove state[x] else add state[x]. Edit: On re-reading I'm actually a little confused, but if the only issues you guys are having is space then this should solve it. GL. Edited July 20, 2015 by Tarq 2 Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 20, 2015 Actually I'll try something (Tarq gave me an idea), but I'll do that tomorrow, because I'm kinda tired now (working ~13 hours already today - I'm going to sleep soon.) Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 21, 2015 No problem, I appreciate the effort you've made so far anyway. I'm still looking around to see if there are any alternative ways of doing this. Thanks Tarq, I gave it a go but unless I'm missing something (which I probably am) I still have the problem of both the spell effect and the upkeep cost being on the same actor. Honestly, I didn't think it would be this difficult to get it working, I'm clueless when it comes to this but I would have thought it relatively simple. Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 21, 2015 OK. Everything works: Make a skill with that formula: (same as before) if b.state?(3); b.remove_state(3); else; b.add_state(3); end replace "3" to ID of buff/debuff, that has to be inflicted to target. In Effects (below formula stuff) add: Common Event [something] And the common event should look like this: Sorry about PL language and pony stuff ~ Replace "Rainbow Dash" with user (Bard) and "Regeneracja zdrowia" with the debuff that drains MP. Basically it will do the same stuff as the formula ~more or less... I prefer to set Scope to "User"; "All Allies" or "All Enemies", because selecting target won't work properly - For example: Bard plays melody on second actor ACTOR2 : BUFF BARD: mp drain debuff --- NEXT TURN --- Bard plays melody on third actor ACTOR2: BUFF ACTOR3: BUFF BARD: no longer has the debuff ACOTR2 & ACTOR3: Woah! How did you do that?! BARD: I'm just too PRO! So.. Better set that to scopes I have mentioned to avoid situation like this. =P For MP drain debuff - draw a note icon and name that "playing melody" or something. =) Good luck! =) 2 Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 21, 2015 It took me a few reads of that and correcting a couple of silly mistakes along the way but it works! Seriously, many thanks for this, especially since it didn't work out at first but you still kept going. Far more effort than I would have thought but feeling extremely grateful! 1 Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 21, 2015 No problem, glad could help! =) Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 21, 2015 Ok so, found a bit of a problem! Something that I didn't say earlier but didn't even think about (seems very obvious now) is that if the Bard is dead or doesn't have enough MP then the states should be removed from the targets. I tried messing around with common events but to no avail. Any way around it? Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 21, 2015 Yeah, I didn't thought about that as well... There will be a problem with this... Common event will not work - It's a job for battle event, which is kinda problematic. You would need to make an event, that would look for his hp & mp and remove state if needed, but you would need to put that event in every "troops" or something like that. I think I saw a script for that, but I'm really not sure... Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 21, 2015 Yeah I tried a common event using a similar layout you'd shown me already but like you said, doesn't work. Checking out the battle events it's easy enough to make the effects be removed once the Bard is KO'd. There's no option to check for his MP though so that's the only issue. Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 21, 2015 (edited) I don't know how to bind actor.mp to a variable - that way you could make an event to look on his mp. ~ Damn my scripting skills. ~ I managed to find that: Active Cost - this removes state when actor's mp is 0 (I don't know how that works~i'm not using that, but description says that) Then you could make a battle event where it looks for actor's state. For example make an event that checks if bard has the melody debuff (mp drain), then: If his mp will drop to 0 - script will remove melody debuff; the event will notice, that the bard does not have melody debuff anymore; event removes states, that came with the melody. It's really complicated and I'm confused... and I'm not even sure if that would work. It's possible (?) to bind variables to something using scripts, but apparently I don't know what to do that. I tried something with $game_variables[25] = $game_party[2].mp but that was a total failure... And - I'm wondering about one more thing: What if bard plays one melody - giving buff(1) and debuff to himself, then using another melody giving buff(2) and removing debuff from himself? I was thinking about sealing skills when using a certain melody - for example seal melody 2,3,4,5,6,7 etc.. when having debuff from melody 1. * My head... hurts.. * HOLY BALLS! It's complicated! =S Edited July 21, 2015 by Rikifive Share this post Link to post Share on other sites
HeckHound 61 Posted July 21, 2015 Is this any good? 2 Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 22, 2015 Yes that works, I can't believe it was so easy and I overlooked that... Thanks! ------------------------------- So... You don't even need that script now, just make battle event like HeckHound made and set Span to Turn. Sadly, you need to put that event to every single troop. Well... Good luck! =) 1 Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 22, 2015 (edited) If it does work then that's awesome, and many thanks! Unfortunately I have no clue about how you've come up with the variables in that screen shot. Both the top one in red and the one in the second conditional branch don't mean much to me in truth. I tried hunting through the variable options to find out what I should be doing but I'm kind of lost to be honest. I'm not sure why or how "Eric"'s MP is relevant or coming from? I'm guessing that's just a sample name for the purpose of the screenshot but I'm not sure why it's listed separately from "Bard" if that's the case? I've got as far as getting the top conditional branch but nothing seems to happen even when the bard dies, not sure if that should be the case with what I've got down. Although I'm slightly confused by that as well since the screenshot references Eric having the death state. Edited July 22, 2015 by Cookie Holiday Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 22, 2015 (edited) It automatically picks actor's name. "Bard's MP" is just a name of variable - any name And second is picked from actor you choose, in my case it's a pony. Then you just need to make conditional branches. =) Edited July 22, 2015 by Rikifive 1 Share this post Link to post Share on other sites
Cookie Holiday 3 Posted July 22, 2015 Thanks for going to the effort to point that stuff out. It's pretty much what I had set up myself but nothing seems to be happening. Here's what I have in my battle event: Am I missing something obvious? Share this post Link to post Share on other sites
Rikifive 3,411 Posted July 22, 2015 Set Span to Turn. Battle -> Event occurs only once per battle Turn -> Event occurs after each turn and Moment -> This works all the time or something like that, I don't know how to use that properly, because it freezes my game. =P Share this post Link to post Share on other sites