Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,133
Reaction score
15,531
First Language
English
Primarily Uses
RMMV
I have fixed the issue. Please download the script again, or just make these simple changes:


find the two lines that have this:

Code:
[\r\n+]
and change them to this:
Code:
[\r\n]+
 

IceSage

Sage of Ice
Member
Joined
Jul 18, 2013
Messages
29
Reaction score
3
First Language
English
Primarily Uses
So, someone suggested this script to me for something I'm attempting to do as a fix. It LOOKS like it will perform the way I want it to, but I'm confused on the instructions of it.

What I'm trying to accomplish in my game is that I'd like the enemy to be able to attack after a "Stun" (Frozen in my case) state has been removed. I'm using "Yanfly's Freeturn Battle" - which makes it so each party member attacks individuals per "turn." (Before all battlers have executed their attacks.)

Without FTB, everything operates as normal. When the state is removed, the enemy has a chance to attack, as it's no longer Frozen.

With FTB, the monster doesn't attempt to attack during it's turn, because the "Frozen" state told it not to, even though the Frozen state has been removed during the hero's turn.

Thus, I need a way to let the enemy attack after the state has been removed. (Usually done by damage.)

The person who recommended the script told me I should use this:

onremove: add_state(X) add feature immune to the stun state for X turnsThough they weren't clear so I don't know which over those are commands and which was pointing out where i should place what. I'm not even sure if their suggestion would help?

If you need clarification, I can post a video example.

But basically, I need to avoid the fact that my party can infinitely stun a character without giving it a chance to attack after the state is removed.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
212
First Language
English
Primarily Uses
This is a pretty cool script, don't know I would have a use for this in my current project, but neverless, awesome work.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,133
Reaction score
15,531
First Language
English
Primarily Uses
RMMV
only the

onremove: add_state(X)is useful from that little snippet. It looks like the rest is just a bit of a comment or something, but it's certainly not a script command.
To be honest, I'd be more inclined to start a new thread in RGSSx Script Support with a link to the freeturn battle script, and explain what's happening and what you expect it to do, rather than trying to compensate for it with yet another script that may or may not work. If actions happen immediately, you expect the results to take effect immediately, and it sounds like that's not happening. But without a link to the script, it's hard to tell. If you do that, make sure you also explain why the person who suggested THIS script thought it would be a solution, because I really don't see it.
 

IceSage

Sage of Ice
Member
Joined
Jul 18, 2013
Messages
29
Reaction score
3
First Language
English
Primarily Uses
Their logic was most likely the fact that this script does actions on the removal of a state. They probably thought I could apply a command to force and "free" the enemy allowing it to attack after the state was removed. I'm guessing there are no commands available to use with this script that could allow an enemy to attack on it's turn when it was previously stunned? (IE. Cancelling the stun effect / ignoring it.)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,133
Reaction score
15,531
First Language
English
Primarily Uses
RMMV
But if the state was truly removed by the other script, the issue shouldn't exist at all. Which leads me to think that maybe the state really wasn't removed at that specific moment.
 

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
702
Reaction score
103
First Language
French
Primarily Uses
RMMV
two bugs encountered

adding a state with "onremove:" will make the state not getting removing if the turns duration is 2+

if you obtain a state with parameters that will resist states that have the "onremove:" command on them, you will receive all those states.
 

x5zero5x

The Confused Creator
Member
Joined
Jun 22, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
Hi there, Shaz? I've recently happened upon your script to resolve an issue with a character concept. The idea is a gunmage. Rather than casting spells, he will instead switch ammo types to different elements, and of course I've set up four elemental states ( so far ) towards this end. The hitch I'm catching, and still can't seem to conquer, is that I want, when a skill is used to 'switch ammo', for it to remove the previous elemental ammo and apply the current one. I tried, perhaps foolishly to reverse the instructions of your script and went with onadd: remove_state(#) , which doesn't seem to be working for me. Lend me a reply if you find the time?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,133
Reaction score
15,531
First Language
English
Primarily Uses
RMMV
If your skill adds the new state, and on the new state you have an onadd: remove_state(id), it should work. Can you post screenshots of your skill and the new state?
 

x5zero5x

The Confused Creator
Member
Joined
Jun 22, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
I would be happy to, thanks for taking the time to reply.

[IMG]http://i.imgur.com/aGmaiZG.png[/IMG]

The rest of the other 3 look the same, with fitting changes to the IDs. When one type of bullets is used in the skills list, I would ideally like it to remove any of the others that currently exist. If that makes sense.

Edit:

[IMG]http://i.imgur.com/lk5Cdj6.png[/IMG]

See how both states have applied? Only one should exist at any given time.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,133
Reaction score
15,531
First Language
English
Primarily Uses
RMMV
And can you show me the skill please? I'll see if I can have a look at this tomorrow.


There is already an issue listed a few posts up where the script isn't quite working properly. This may be something that's somewhat related.
 

x5zero5x

The Confused Creator
Member
Joined
Jun 22, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
Sure! No rush, either. It isn't like there aren't a million other things to work on at any given time. ^_^

[IMG]http://i.imgur.com/iBAls2p.png[/IMG]
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
608
Reaction score
320
First Language
German
Primarily Uses
Hi,

I can't test it myself right now but I wonder if one could provoke a SystemStackError by trying this:

- Add a state with  onremove: self.mp = 0  in its note (or anything else that invokes refresh)
- Remove the state by "State Resist"-ing it

(Since the state still remains when the expression is executed, the refresh process might try to erase the state again)
 
Last edited by a moderator:

x5zero5x

The Confused Creator
Member
Joined
Jun 22, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
I'm still too green to know what any of that means. Mostly. x3
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,133
Reaction score
15,531
First Language
English
Primarily Uses
RMMV
There is a bug with the way the script handles state_resist (ie - it doesn't!) that could cause the type of recursion you're talking about.


@x5zero5x, try taking the notes out of the skill. I don't even think they DO anything (the script runs commands when a STATE is added or removed, not when a skill is used) - unless you've got them there just for documentation purposes. Because they're ignored, I doubt they're interfering with anything.


It appears to be set up correctly. Do you use State Resist anywhere in relation to these states? If you change the skill so it can be used from the menu, does it work properly when you use it from the menu? I'd like to know if it's a battle-specific issue.
 
Last edited by a moderator:

x5zero5x

The Confused Creator
Member
Joined
Jun 22, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
I will test that, and get back to you in a few.

Edit: I've tested them in the menu with identical results. Note tags were removed from the skills ( they weren't there during the initial testing anyway, but I'm desperate here! ). Still stacking up and not removing. ~
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,837
Reaction score
984
First Language
Chinese
Primarily Uses
N/A
Maybe an implementation like this can solve the recursion problem:

Code:
  #--------------------------------------------------------------------------  # * Clear State Information  #--------------------------------------------------------------------------  alias shaz_state_commands_clear_states clear_states  def clear_states    last_states = @states    shaz_state_commands_clear_states    last_states.each {|state_id| state_remove_command(state_id) } if last_states  end
Code:
  #--------------------------------------------------------------------------  # * Erase State  #--------------------------------------------------------------------------  def erase_state(state_id)    remove = state?(state_id)    super    state_remove_command(state_id) if remove  end
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,133
Reaction score
15,531
First Language
English
Primarily Uses
RMMV
That code seems VERY familiar to me. It may be that I came up with something similar when starting to look at the previous bug. Thanks :)
 

Anruth

Villager
Member
Joined
Jan 19, 2014
Messages
17
Reaction score
0
First Language
English
Primarily Uses
First off ... I love what this script can do.

Sadly, I can't get it to work.

I'm currently using the Luna/Yanfly engine and related scripts as sold on steam.

Not sure if that could be the problem or not.

I have tried putting the script in several places under Materials but haven't been able to get it to run.

The state is applied but the note tags don't seem to trigger.

I've included to screen shots to help you guys, help me. 

Thanks in advance for your effort.

https://www.facebook.com/JOMLgames/photos/pb.913760338704065.-2207520000.1436034284./914600771953355/?type=3&theater

https://www.facebook.com/JOMLgames/photos/pb.913760338704065.-2207520000.1436034284./914600765286689/?type=3&theater
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,133
Reaction score
15,531
First Language
English
Primarily Uses
RMMV
Can you see the printout to the console? Have you placed a manual line break after that first line?


Common events don't run in battle. So if someone gets that state during a battle, the common event will only run after the battle ends and you return to the map - IF no other stage in the battle causes the common event id to be changed (you can only queue one, so if another is queued, it'll replace the first one).
 

Latest Threads

Latest Profile Posts

ready to fall into another development hell...
Mega has been giving me a lot of problems as of late, so I think I'll need to switch to another cloud service. I'm considering Dropbox.
Rough week, but in the end there's light in the darkness.
Mental health is an issue I wish was taken more seriously.
Take care.
1638421271905.jpeg
By the power of timezones! This picture shall still be posted on december 1st!!!
7xI2Gc2.jpg

This is not something I'd ever even considered but wow! What a way to use music in a game.

Forum statistics

Threads
117,122
Messages
1,104,755
Members
153,163
Latest member
tgjtjtjt
Top