Jump to content

I need to add a line to SPLPROT. How?


temnix

Recommended Posts

I have a spell which is not supposed to work on creatures with any amount of resistance to cold. On top of those effects sits Protection from spell, opcode 318, but I need to add a custom line for protection from cold (stat 15) > 0. I try this code but get wrong results:

COPY_EXISTING    ~SPLPROT.2DA~    override    COUNT_2DA_ROWS 4 newrow BUT_ONLY
APPEND ~SPLPROT.2DA~ ~%newrow% 15 0 3~ OUTER_SET newrow = newrow + 1

Weidu is not my specialty. Either I'm doing something wrong here or a bit of code higher up in the tp2 is to blame. It is used for another spell and reads:

COPY_EXISTING    ~SPLPROT.2DA~    override    COUNT_2DA_ROWS 4 row    BUT_ONLY
APPEND ~SPLPROT.2DA~ ~%row% 15 50 2~    OUTER_SET    one = row + 1
APPEND ~SPLPROT.2DA~ ~%one% 15 127 3~    OUTER_SET    two = one + 1
APPEND ~SPLPROT.2DA~ ~%two% 260 %row% %one%~

I don't know why this code would cause problems for what goes below, but the spell in question instead of a new row gets pointed to the created "cold resistance > 127." Help would be appreciated. I'll credit you in the mod this is for when it comes out.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...