kreso Posted September 16, 2016 Share Posted September 16, 2016 0x8014202D STATE_OUT_OF_ACTIONFeeblemind & Charmed & Helpless & Stunned & Sleeping & Blind & Confused & Panic Does this state return true if a creature has either of these effects on themselves or it returns true only if they all affect the creature? Link to comment
K4thos Posted September 16, 2016 Share Posted September 16, 2016 either of these effects Link to comment
lynx Posted September 16, 2016 Share Posted September 16, 2016 yeah, the description is a bit confusing, since it could be read as binary AND (and it's actually a bitfield, so OR). Link to comment
kreso Posted September 17, 2016 Author Share Posted September 17, 2016 How do these "shortcut" states work? Should I append states.ids with their value? Example: STATE_CONFUSED works STATE_OUT_OF_ACTION - not present in states.ids, error reporting when compiling the script. Link to comment
kreso Posted September 17, 2016 Author Share Posted September 17, 2016 Thanks again,it's working now! Link to comment
kreso Posted September 17, 2016 Author Share Posted September 17, 2016 This won't be neccecary. Apperantly, SCS already uses APPEND: APPEND ~STATE.IDS~ ~0x8010202D STATE_DISABLED~ UNLESS ~0x8010202D STATE_DISABLED~ /// includes Helpless, Stunned, Panic, Sleeping, Charmed, Feebleminded, Confused This should work great I think... IESDP has no info on DISABLED state however. Link to comment
kreso Posted September 17, 2016 Author Share Posted September 17, 2016 One more question - does CHARM effect change Allegiance? I.e. is ENEMY turned into ALLY and viceversa if charmed? Link to comment
lynx Posted September 17, 2016 Share Posted September 17, 2016 these composite states are just shortcuts for cleaner code. charm changes the ea, but there are special values for it — it won't just switch 255 to 2: http://gemrb.org/iesdp/files/ids/bg2/ea.htm (5 and 6, domination and charm) Link to comment
Ardanis Posted September 17, 2016 Share Posted September 17, 2016 IESDP has no info on DISABLED state however. Because it's a custom value. You look at the basic states you want to be checked and add values together. Say, you want to detect if target's movement rate has been affected by a spell: 0x00008000 STATE_HASTED 0x00010000 STATE_SLOWED Which translates to: OR(2) StateCheck(Myself,STATE_HASTED) StateCheck(Myself,STATE_SLOWED) But you can't be bothered with that double OR(), so you go to state.ids, add together both states' values and give it a custom name: 0x00018000 KRESO_STATE_SPEED_CHANGE And now you can simplify your script to: StateCheck(Myself,KRESO_STATE_SPEED_CHANGE) Which will work fine even if somebody already added the 0x00018000 value under different name. One more question - does CHARM effect change Allegiance? I.e. is ENEMY turned into ALLY and viceversa if charmed? Use GOODCUTOFF / EVILCUTOFF if you want to match both ALLY / ENEMY and corresponding charm. Link to comment
kreso Posted September 17, 2016 Author Share Posted September 17, 2016 Aha, so these custom states are nothing but several states' value sumed up. Great. This means I can make my own (with whatever I want) and APPEND it to .ids table! Fantastic, thanks. One more question - does CHARM effect change Allegiance? I.e. is ENEMY turned into ALLY and viceversa if charmed? Use GOODCUTOFF / EVILCUTOFF if you want to match both ALLY / ENEMY and corresponding charm. I'm not sure I understand. Here's an example: StateCheck(LastSeenBy(Myself),STATE_CHARMED) Allegiance(LastSeenBy(Myself),ENEMY) THEN RESPONSE #100 SetGlobalTimer("castspell","LOCALS",ONE_ROUND) Spell(LastSeenBy(Myself),CLERIC_REMOVE_CURSE) // SPPR307.SPL (Break Enchantment) From your post above Allegiance(LastSeenBy(Myself),ENEMY) should be changed? Link to comment
Ardanis Posted September 17, 2016 Share Posted September 17, 2016 Use StateCheck(LastSeenBy(Myself),STATE_CHARMED) Allegiance(LastSeenBy(Myself),EVILCUTOFF) THEN RESPONSE #100 SetGlobalTimer("castspell","LOCALS",ONE_ROUND) Spell(LastSeenBy(Myself),CLERIC_REMOVE_CURSE) // SPPR307.SPL (Break Enchantment) Note that NearestEnemyOf() automatically return the script owner's relative enemy (EVILCUTOFF for allied, GOODCUTOFF for hostile). Link to comment
kreso Posted September 17, 2016 Author Share Posted September 17, 2016 Ardanis, have a beer.... Awesome... Link to comment
kreso Posted January 28, 2017 Author Share Posted January 28, 2017 I ran into an issue with this; and I wonder if it can be fixed. Now, the above works fine in combat and is very cute when you see it. The problem is in what happens when a member of your party gets charmed (red-circled). Clerics will cast Break Enchantment on him, curing him of charm which is a *very* stupid thing to do. Is it possible to exclude casting this (or anything else like Heal) on charmed party members? Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.