1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

Scripting to automatically put up Barkskin

Discussion in 'BG2: Throne of Bhaal (Classic)' started by OTG, Nov 4, 2006.

  1. OTG Gems: 3/31
    Latest gem: Lynx Eye


    Joined:
    Oct 6, 2006
    Messages:
    64
    Likes Received:
    0
    [​IMG] My scripts are getting more and more complicated, and I've been able to work out how to do most of the stuff I want within the constraints of the BG2 scripts, but I'm stumped.
    I want my clerics / druids to put up Barkskin when certain conditions are true. I've already got something similar for mages with Blur and Mirror Image, but there doesn't seem to be the same attributes for Barkskin as there are for the above-mentioned mage spells.

    For clarification, the mage spells (for a fighter/mage) are this:

    // * Keep up stoneskins
    IF
    ActionListEmpty()
    HaveSpell(WIZARD_STONE_SKIN)
    CheckStatLT(Myself,1,STONESKINS)
    THEN
    RESPONSE #100
    Spell(Myself,WIZARD_STONE_SKIN)
    END

    // * Blur if no Mirror Image
    IF
    ActionListEmpty()
    HaveSpell(WIZARD_BLUR)
    !StateCheck(Myself,STATE_BLUR)
    !StateCheck(Myself,STATE_MIRRORIMAGE)
    !StateCheck(Myself,STATE_INVISIBLE)
    !StateCheck(Myself,STATE_SILENCED)
    Range(NearestEnemyOf(Myself), 10)
    HPGT(NearestEnemyOf(Myself), 50)
    THEN
    RESPONSE #100
    Spell(Myself,WIZARD_BLUR)
    END

    // * Mirror Image if no Blur
    IF
    ActionListEmpty()
    HaveSpell(WIZARD_MIRROR_IMAGE)
    !StateCheck(Myself,STATE_BLUR)
    !StateCheck(Myself,STATE_MIRRORIMAGE)
    !StateCheck(Myself,STATE_INVISIBLE)
    !StateCheck(Myself,STATE_SILENCED)
    Range(NearestEnemyOf(Myself),10)
    HPGT(NearestEnemyOf(Myself),50)
    THEN
    RESPONSE #100
    Spell(Myself,WIZARD_MIRROR_IMAGE)
    END

    Druid Ironskins works off the same CheckStat (STONESKINS), so that bit's fine. Looking through the IDS files, I've found CLERIC_BARKSKIN in spells.ids, but not in stats.ids, so I take it I can't use 'CheckStatLT(Myself,1,xyz)' where xyz = the appropriate term for Barkskin (CLERIC_BARKSKIN? BARKSKIN?)... or can I?
     
  2. Shaitan

    Shaitan Always forgive your enemies; it annoys them so

    Joined:
    Jun 27, 2005
    Messages:
    1,323
    Likes Received:
    5
    Perhaps this is better suited for a modding forum like Gibberlings3?
     
  3. Razfallow Gems: 6/31
    Latest gem: Jasper


    Joined:
    Mar 9, 2005
    Messages:
    172
    Likes Received:
    2
  4. CamDawg

    CamDawg The gaze of the Wolf reaches into our soul Veteran

    Joined:
    Jun 10, 2003
    Messages:
    1,116
    Likes Received:
    11
    This is the whole reason why Detectable Spells was created; you can not detect the presence/effects of many spells by default. Many spells are modified to leave detectable stats on creatures (though they do not affect gameplay) so that scripts can react more intelligently to a creature's active protections.
     
  5. OTG Gems: 3/31
    Latest gem: Lynx Eye


    Joined:
    Oct 6, 2006
    Messages:
    64
    Likes Received:
    0
    Thanks people, I'll give Big Picture Detectable Stats a go...

    @Shaitan - I'm not modding, these are scripts for my party. I've not even completed the game once yet - first run through got as far as the dragon in Chapter 6 before deciding duelling a kensai to a thief at level 21 meant I was facing baddies too tough for a level 12 thief to handle, just exited the Underdark on my second character. I hate having to pause, cast the first set of buffing spells, pause, cast the second set of buffing spells, and so on - it's much easier if the script does the work for me and, in an RP sense, it's the party getting more experienced and knowing when to cast protective spells ;) If, however, there's a more appropriate forum, please post or PM me the URL.
     
  6. Shaitan

    Shaitan Always forgive your enemies; it annoys them so

    Joined:
    Jun 27, 2005
    Messages:
    1,323
    Likes Received:
    5
    Ay - I just thought that an answer was easylier acquired at a modding forum...

    You can google Gibberlings3.net :p

    I recommend a nerf of the skins, IMHO they are too much. But that's just me
     
  7. CamDawg

    CamDawg The gaze of the Wolf reaches into our soul Veteran

    Joined:
    Jun 10, 2003
    Messages:
    1,116
    Likes Received:
    11
    If you're looking for party scripts, you could give cirerrek's eSeries a spin (or alternatively, use large chunks of it for your own project).
     
  8. Taluntain

    Taluntain Resident Alpha and Omega Staff Member ★ SPS Account Holder Resourceful Adored Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) New Server Contributor [2012] (for helping Sorcerer's Place lease a new, more powerful server!) Torment: Tides of Numenera SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) BoM XenForo Migration Contributor [2015] (for helping support the migration to new forum software!)

    Joined:
    Jun 11, 2000
    Messages:
    23,635
    Media:
    494
    Likes Received:
    560
    Gender:
    Male
    [​IMG] Shaitan, there's little that he can't get an answer to on our forums, considering a number of experienced modders frequent them, so I'd reserve recommendations of other sites for when it's really clear than no one here has anything whatsoever to say on the matter. This means waiting more than 1 hour after the original post. I have no problems with giving out links to other sites when it's prudent, but I've noticed you doing it prematurely on several occasions.

    [ November 05, 2006, 01:44: Message edited by: Taluntain ]
     
  9. Tal Rasha

    Tal Rasha Eye of Vecna

    Joined:
    Aug 9, 2005
    Messages:
    168
    Likes Received:
    1
    Try SCRIPTINGSTATE5, but I am not very sure, because my BG2 hasn't been pure for a long time. Anyway, having a try does no bad.
     
  10. CamDawg

    CamDawg The gaze of the Wolf reaches into our soul Veteran

    Joined:
    Jun 10, 2003
    Messages:
    1,116
    Likes Received:
    11
    Barkskin won't set the SCRIPTINGSTATE5 variable without Detectable Spells, though.
     
  11. el M Gems: 3/31
    Latest gem: Lynx Eye


    Joined:
    Jun 6, 2006
    Messages:
    59
    Likes Received:
    0
    how about iwd2 ? - any detectable spells for it ?
    same problem with stats.ids ...


    solved the problem in IWD2

    !CheckSpellState(Myself,IRON_SKINS)


    Code:
     IWD2: Identifiers
    SPLSTATE.ids - plenty of states here 
    
    
    65
    0 HOPELESSNESS
    1 PROTECTION_FROM_EVIL
    2 ARMOR_OF_FAITH
    3 NAUSEA
    4 ENFEEBLED
    5 RED_FIRESHIELD
    6 BLUE_FIRESHIELD
    7 HELD
    8 DEATH_WARD
    9 HOLY_POWER
    10 BENEFICIAL_CHANT
    11 DETRIMENTAL_CHANT
    12 BENEFICIAL_PRAYER
    13 DETRIMENTAL_PRAYER
    14 BENEFICIAL_RECITATION
    15 DETRIMENTAL_RECITATION
    16 ALLIED_RIGHTEOUS_WRATH_OF_THE_FAITHFUL
    17 ALLIED_AND_SAME_ALIGNMENT_RIGHTEOUS_WRATH_OF_THE_FAITHFUL
    18 STONESKIN
    19 IRON_SKINS
    20 SANCTUARY
    21 OTILUKES_RESILIENT_SPHERE
    22 BLESS
    23 AID
    24 BARKSKIN
    25 DRAW_UPON_HOLY_MIGHT
    26 ENTANGLE
    27 WEB
    28 GREASE
    29 FREE_ACTION
    30 ENTROPY_SHIELD
    31 STORM_SHELL
    32 PROTECTION_FROM_THE_ELEMENTS
    33 BERSERK_ALWAYS_ACTIVE
    34 BLOOD_RAGE
    35 SUPPRESS_HP_INFO
    36 DOESNT_AWAKEN_ON_DAMAGE
    37 UNSTUN_ON_DAMAGE
    38 DEAFENED
    39 ANIMAL_RAGE
    40 SNEAK_ATTACK_IMMUNITY
    41 CHAOTIC_COMMANDS
    42 MISCAST_MAGIC
    43 PAIN
    44 MALISON
    45 CATS_GRACE
    46 MOLD_TOUCH
    47 SHROUD_OF_FLAME
    48 EYE_OF_THE_MIND
    49 EYE_OF_THE_SWORD
    50 EYE_OF_THE_MAGE
    51 EYE_OF_VENOM
    52 EYE_OF_THE_SPIRIT
    53 EYE_OF_FORTITUDE
    54 EYE_OF_STONE
    55 AEGIS
    56 EXECUTIONERS_EYES
    57 ENERGY_DRAINED
    58 TORTOISE_SHELL
    59 BLINK
    60 MINOR_GLOBE_OF_INVULNERABILITY
    61 PROTECTION_FROM_MISSILES
    62 GHOST_ARMOR
    63 REFLECTED_IMAGE
    64 KAI
    65 CALLED_SHOT
    66 MIRROR_IMAGE
    67 TURNED
    68 BLADE_BARRIER
    69 COAT_WEAPON_WITH_POISON
    70 STUNNING_BLOW
    71 QUIVERING_PALM
    72 MENTAL_DOMINATION
    73 GLOBE_OF_INVULNERABILITY
    74 SHIELD
    75 ANTIMAGIC_SHELL
    76 FEAT_POWER_ATTACK_1
    77 FEAT_POWER_ATTACK_2
    78 FEAT_POWER_ATTACK_3
    79 FEAT_POWER_ATTACK_4
    80 FEAT_POWER_ATTACK_5
    81 FEAT_EXPERTISE_1
    82 FEAT_EXPERTISE_2
    83 FEAT_EXPERTISE_3
    84 FEAT_EXPERTISE_4
    85 FEAT_EXPERTISE_5
    86 FEAT_ARTERIAL_STRIKE
    87 FEAT_HAMSTRING
    88 FEAT_RAPID_SHOT
    89 IRON_BODY
    90 TENSERS_TRANSFORMATION
    91 SMITE_EVIL
    92 ALICORN_LANCE
    93 CALL_LIGHTNING
    94 CHAMPIONS_STRENGTH
    95 CIRCLE_OF_BONES
    96 CLOAK_OF_FEAR
    97 CLOUD_OF_PESTILENCE
    98 CONTAGION
    99 BANE
    100 DEFENSIVE_HARMONY
    101 DESTRUCTION
    102 DOLOROUS_DECAY
    103 DOOM
    104 EXALTATION
    105 FAERIE_FIRE
    106 FIND_TRAPS
    107 GREATER_SHIELD_OF_LATHANDER
    108 MAGIC_RESISTANCE
    109 NEGATIVE_ENERGY_PROTECTION
    110 PROTECTION_FROM_FIRE
    111 PROTECTION_FROM_LIGHTNING
    112 MINOR_ELEMENTAL_BARRIER
    113 SHIELD_OF_LATHANDER
    114 SLOW_POISON
    115 SPELL_SHIELD
    116 STATIC_CHARGE
    117 STRENGTH_OF_ONE
    118 UNDEAD_WARD
    119 RESIST_FATIGUE
    120 WALL_OF_FIRE
    121 WALL_OF_MOONLIGHT
    122 CHAOS
    123 CHARMED
    124 DIRE_CHARMED
    125 CONTROLLED
    126 CONFUSION
    127 DOMINATED
    128 FEEBLEMIND
    129 MIND_BLANK
    130 RIGID_THINKING
    131 ARMOR
    132 BELTYNS_BURNING_BLOOD
    133 CLOUDKILL
    134 DEATH_ARMOR
    135 DISINTEGRATE
    136 FLESH_TO_STONE
    137 EAGLES_SPLENDOR
    138 IMPROVED_HASTE
    139 HASTE
    140 LOWER_RESISTANCE
    141 LUCK
    142 MELFS_ACID_ARROW
    143 OTILUKES_FREEZING_SPHERE
    144 PROTECTION_FROM_ACID
    145 PROTECTION_FROM_ELECTRICITY
    146 PROTECTION_FROM_NORMAL_MISSILES
    147 PROTECTION_FROM_PETRIFICATION
    148 RAY_OF_ENFEEBLEMENT
    149 SEVEN_EYES
    150 SOUL_EATER
    151 SPIRIT_ARMOR
    152 STRENGTH
    153 SUFFOCATE
    154 TROLLISH_FORTITUDE
    155 VIPERGOUT
    156 VITRIOLIC_SPHERE
    157 VOCALIZE
    158 ANIMAL_AFFINITY
    159 BARBARIAN_RAGE
    160 GREATER_BARBARIAN_RAGE
    161 KAI
    162 SHAPESHIFTS_WEREWOLF
    163 STUNNING_BLOW
    164 CANNOT_CAST
    165 CANNOT_FIGHT
    166 DRUID_SHAPESHIFT_ARCTIC_BOAR
    167 DRUID_SHAPESHIFT_BORING_BEETLE
    168 DRUID_SHAPESHIFT_POLAR_BEAR
    169 DRUID_SHAPESHIFT_DIRE_BEAR
    170 DRUID_SHAPESHIFT_BLACK_PANTHER
    171 DRUID_SHAPESHIFT_DIRE_PANTHER
    172 DRUID_SHAPESHIFT_EARTH_ELEMENTAL
    173 DRUID_SHAPESHIFT_AIR_ELEMENTAL
    174 DRUID_SHAPESHIFT_FIRE_ELEMENTAL
    175 DRUID_SHAPESHIFT_WATER_ELEMENTAL
    176 DRUID_SHAPESHIFT_SHAMBLING_MOUND
    177 DRUID_SHAPESHIFT_WINTER_WOLF  
    unfortunatly bg2 doesn't have SPLSTATE.ids

    [ December 05, 2006, 19:14: Message edited by: el M ]
     
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.