Jump to content


Photo

Errors with states.ids


7 replies to this topic

#1 Saradas

Saradas
  • Member
  • 13 posts

Posted 28 January 2016 - 09:56 PM

Hello fellow modders,

today I'm experiencing a problem that is driving me crazy. The game handles the states in State.ids incorrectly...

 

For example, my enemy mage has 2 stunning spells, but I want her to cast the second spell in the chain only if the target is not stunned yet.

 

So, this is the code:

 

 

IF
    HPLT(Protagonist,90)
    HaveSpell(WIZARD_POWER_WORD_STUN)
    See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_POWER_WORD_STUN)
    Continue()
 END


 IF
    See(NearestEnemyOf(Myself))
    HaveSpell(WIZARD_BIGBYS_CLENCHED_FIST)
    !StateCheck(Player1,STATE_STUNNED)
THEN
RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_BIGBYS_CLENCHED_FIST)
    Continue()
 END

 

The problem is that even if the target gets stunned with the first spell (Power word stun), the game fails to recognize this state [ !StateCheck(Player1,STATE_STUNNED ] in the next script chain and reads TRUE even if it's not....

 

what is the problem? thanks



#2 The Imp

The Imp

    Not good, see EVIL is better. You LIVE.

  • Member
  • 3815 posts

Posted 29 January 2016 - 03:17 AM

what is the problem? thanks

Open the first spells all effects with Near Infinity and take screen captures with the Snipping tool and upload them to net and link directly to this thread. I would recommend the TinyPic site for this, but any site will do, free and all.

 

To go to the effects, just open the .spl file, double click the abilities, and then double click each of the effects. This will let me see among other things, the effects Dispel/Resistance type, Save throws, probability factor and other stuff that all kinda need to match with each others in the same effect.


Edited by The Imp, 29 January 2016 - 05:02 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#3 Saradas

Saradas
  • Member
  • 13 posts

Posted 29 January 2016 - 04:11 AM

I'm not sure if I screened the right part you wanted to see... 

 

http://i68.tinypic.com/jkbp21.png



#4 The Imp

The Imp

    Not good, see EVIL is better. You LIVE.

  • Member
  • 3815 posts

Posted 29 January 2016 - 04:55 AM

It's usually best to save the picture you take with the snipping tool as a .jpg, cause all sites usually like that format ... and nope, 503 error.


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#5 Argent77

Argent77
  • Member
  • 724 posts

Posted 29 January 2016 - 05:07 AM

In the second script block you should change
!StateCheck(Player1,STATE_STUNNED)
into
!StateCheck(LastSeenBy(Myself),STATE_STUNNED)
to make sure the right target is checked.
 
You should also remove the Continue() statements. Variables are not updated until the next script pass. This is most likely true for state changes as well.

Edited by Argent77, 29 January 2016 - 05:07 AM.


#6 Saradas

Saradas
  • Member
  • 13 posts

Posted 29 January 2016 - 05:50 AM

Thank you for your info, Argent77, I will try again tomorrow.

 

The Imp, sorry if it doesn't work but I see no point in uploading those infos as the spell is not custom-made and that is hardly the problem. Thanks anyway



#7 Saradas

Saradas
  • Member
  • 13 posts

Posted 29 January 2016 - 07:32 PM

Still not working......I think the states/stats entries are glitchy...

 

   IF
    See(Nearestenemyof(Myself))
    HPPercentLT(LastSeenBy(Myself),50)
    HaveSpell(ROGUE_ASSASINATION)
    OR(4)
    !CheckStat(LastSeenBy(Myself),3,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
    !CheckStat(LastSeenBy(Myself),4,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
    !CheckStat(LastSeenBy(Myself),5,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
    !CheckStat(LastSeenBy(Myself),6,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
    THEN
    RESPONSE #100
    EquipMostDamagingMelee()
    Spell(Myself,ROGUE_ASSASINATION)
    AttackReevaluate(Nearestenemyof(Myself),30)
  END

 

for example here I'm trying to make my enemy Assassin cast the assassination ability ONLY IF the last enemy he saw is not over 50% hp or protected from magical weapons +3 up to +6.

 

I cast protection from magic weapons on my cavy, but the assassin's script still reports TRUE and performs the action.


Edited by Saradas, 29 January 2016 - 07:33 PM.


#8 Saradas

Saradas
  • Member
  • 13 posts

Posted 29 January 2016 - 07:46 PM

alright he likes this one! it's working

 

    !CheckStatGT(LastSeenBy(Myself),1,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)




Reply to this topic