'State Resist' not preventing state infliction

Status
Not open for further replies.

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
For some skills I am using the default state 'Stun'.  However, I don't want all enemies to be stunned, so I have tried preventing that by using 'State Resist'.  However, although the skill only has a 50% chance of inflicting Stun, enemies continue to get it.  I have also tried setting the 'State Rate' to 0% but they still get stunned anyway.  The same also appears to be true for Paralysis.


Any ideas about why this might be?


Thanks.
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,268
Reaction score
1,422
First Language
English
Primarily Uses
RMXP
Hmm... I would track down the code where skill cause effects and then follow the logic using shotgun debug to find the cause. (No debugger is available ;_;)
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Zeriab Err, how would I do that?  (sadly I don't even know what shotgun debugger means.)
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,268
Reaction score
1,422
First Language
English
Primarily Uses
RMXP
Erhm... being able to script helps > _ >


With Indi he would give me what's needed to recreate the issue and I would debug it.


Shotgun debugger = when you put a bunch of p something in your code hoping to hit something right.


A good debugger allows you to step through the code while presenting the state changes as they occur. I.e. what the values of the variables are.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
is that skill set to "certain hit"? If I remember correctly, any skill set to that option overrides all possibilities of evading the effects.


If that's not it, it would help to see screenshots of both skill and enemy...
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Zeriab This isn't using 'code' as such, just the usual stuff in the data base i.e.


for the skill inflicting the state: in the Effects box, use the command Add State [Stun]


for the resistance, in the Enemy's slot, in the Features box, select State Resist [Stun]


That's why I can't see what could possibly go wrong - but something has.  Running the console during battle doesn't bring up any commands, so I have no clue what might do this.  Maybe I shall have to try and do a work around (e.g. put a command in each turn on the troop page to remove State Stun or Paralysis, so that at least it only inhibits the enemy for one turn.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Zeriab is referring to editing the scripts that run when a skill inflicts a state, to print stuff out to the console and see exactly what's going on. 


Can you disable all your custom scripts temporarily and test to see if the problem still happens?  If you have a lot, the quickest way to disable them all is to copy the Main slot and insert/paste it above the custom scripts.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
State rate 0% actually does not totally stop state infliction. What it does is it will multiply the state rate by 0 on physical and magical attacks, but certain hit skills and troop events ignore it. If you want absolute immunity to states you have to use state resist to make them totally immune to the state.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Shaz Unfortunately, if I disable everything then all I can get is 'New Game' as it is not able to access any of my save files or battle commands.  I did, however, disable all the skill related scripts, and that made no difference.


@Andar It's not set to certain hit.  Here are the screenies for the skill and the enemy.  As you can see, in this particular iteration of the enemy features I'm trying state resist for one and state rate for the other, and both are being applied.


skill.png


enemy.png
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Do a Ctrl+Shift+F and look for item_effect_add_state_normal. That's the code where state rates are computed. Make sure it is still being called when states are added (I do this by adding a line to have it print a line every time it comes there, though I can't recall how to do that. Maybe I need more caffeine?)


The key code you want is


change *= state_rate(effect.data_id) if opposite?(user)


if that code is not running then your state rates will always be ignored.


As for the scripts, yep, for reasons I cannot understand if you disable Effectus it will no longer load your save games. Maybe you can try disabling all but that one?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@bgillisp item_effect_add_state_normal occurs twice, both in Game_Battler.


change *= state_rate(effect.data_id) if opposite?(user) is not brought up anywhere with Ctrl+F


EDIT


You have a typo, it's not change but chance.  That comes up once in Game_Battler.


I, too, have no idea what to add to make that print out in the console work.


On the scripts thing, I need to have all my battle and menu scripts enabled, not just Effectus, and that still only gives me New Game, but at least I have all my battle commands.  Stun is still applied.
 
Last edited by a moderator:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Yep, I do. That's called I need more caffeine.


As for the printout, I looked it up. msgbox_p() will print a message via windows, though it will take all focus away from the game until you close the message. Still could work for a test. I think there's a way to print it to the console instead, but I don't know it.


So maybe try, right below all the lines involving chance *= (stuff) add the following line:


msgbox_p(chance)


This will print out (in decimal form) what the chance is to apply a status aliment. Though, fair warning, it will do this for every single status aliment, which will get annoying fast, so remember where you put the code so you can delete it later!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@bgillisp I did the msgbox_p(chance)  thingy and it came up - but what it seems to show is the chance as per the skill tab.  I used a wide range of skills from all actors, which utilize a range of status effects, and every one printed out the data base rate.  I then tried it just on an ordinary troop with no particular resistances or anything, and again it printed out at the data base rate.  So either that is all that is being captured, or stun is simply not affected by the state resist setting.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Did you put it at the bottom? As in after the line that reads:


chance *= luk_effect_rate(user)      if opposite?(user)


If it is still the same as in the skill, then that means for some reason you have no luck affecting your stats (possible), and you have no state rates affecting your states. Not sure how to fix that though, as this should be just drawing it from the database.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@bgillisp My bad.  I put it under the line above.  However, when I put it under the luck line, that changed Stun from 0.5 in the original test to 0.4985.  Other status effects also varied a little, but roughly by the same margin as this one. 


I am convinced that I have not changed the application of luck to skills anywhere in the default scripts, and I don't have any custom scripts to do that.  In case my memory is at fault, where would I find the luck application?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Actually, that means the luck line is working, as it is really tiny by default (like 0.01% per point of difference in luck). But it does mean the state rate is not applying somehow. Though do you still have it as state rate resist Stun, or state resist * 0%? If the first I think it will not show up here, as the code for that is I think under how states are applied. Will have to dig more on that.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
It is probably completely unrelated - but you never know:


Is it correct that you have an unnamed (empty) element selected? Is it perhaps possible that you have several elements without names and selected the wrong one, causing some other rates to apply?


Can you test if anything changes if you select "none" instead of that unnamed element?


And can you test out what happens with a regular damage number? I don't know which script defined that base array, but code in the damage formula is one thing that can throw off the engine if there is a mistake in it.


And now it would be better to remove anything else while searching for the cause of the problem...
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
It was on State Resist.  So I changed it to State Rate to test - still printing out the same.  But your question prompted a thought.  There is a skill on another actor which I have not been using because I know that the enemy is resistant to that element.  So I've just played it using that skill.  This time the printout did not occur.  Instead I got on screen the 'Resist' pop up.  So it's working as one would expect for element rate, just not the state rate. 


EDIT


@Andar sorry didn't see your post.


That blank was probably just when I was checking everything to see what was what.  I have no unnamed elements.  I changed it back to None and removed the base number, it still inflicted Stun.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
You probably have a script that modifies how state rates and resist work then... I've been trying them out in vanilla ace and they seem to work nicely.. Even with my full custom battle scene, the rates and resist work nicely..

 I think there's a way to print it to the console instead, but I don't know it.
There is, that is 


p "your message"


maybe try searching for state_rate  instead of chance
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Engr. Adiktuzmiko Using state_rate pulls up the additional default script Game_BattlerBase, which I have never modified. 


The only custom script which comes up is Shaz's Dynamic Features script which permits state_rates for actors, gear, etc. (but not, as far as I can see, enemies) to be modified.  However, I have not used it for states, only for other features, so it can't be that.


I have no scripts which directly affect state rates.  The only scripts which affect states at all are Yanfly's Passive States, and Iavra's Auto-States.  I have not used either of those for the actor with this particular skill.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top