Jump to content

Parse error when trying to install personal mod to BGEE


Recommended Posts

About 7 or 8 months ago I came here looking for advice on making my own mod. Eventually I figured it out and I have a mod for the shapeshifter druid kit!

...but I had only tested it for BG2EE and my modded BGTEE. And I never tried it on BGEE, assuming it would work. Well I tried it and it doesn't work and I have no idea why. 

I've attached it and I would appreciate any help that could be offered.

According to the installer, the issue is with line 77, but I know enough about coding to know that it might be completely unrelated:

Parse error (state 587) at LAUNCH_PATCH_FUNCTION

[SETUP-BALANCED_SHAPESHIFTER_KIT.TP2] PARSE ERROR at line 77 column 1-21
Near Text: LAUNCH_PATCH_FUNCTION
        GLR parse error

[SETUP-BALANCED_SHAPESHIFTER_KIT.TP2]  ERROR at line 77 column 1-21
Near Text: LAUNCH_PATCH_FUNCTION
        Parsing.Parse_error
ERROR: parsing [SETUP-BALANCED_SHAPESHIFTER_KIT.TP2]: Parsing.Parse_error
ERROR: problem parsing TP file [SETUP-BALANCED_SHAPESHIFTER_KIT.TP2]: Parsing.Parse_error

FATAL ERROR: Parsing.Parse_error

Balanced_shapeshifter_Kit (2).zip

Link to comment
8 minutes ago, Jarno Mikkola said:

You have not copied any resource to patch...

I did, I uploaded the mod that has the .tp2 file.

 

if you meant just pasting the code itself, heres the beginning. The area that has the error is bold:

 

BEGIN ~Balanced_shapeshifter_Kit~  

DEFINE_ACTION_FUNCTION resolve_state INT_VAR index=0 delete=0 STR_VAR new_state_id = ~blah~ RET new_state_ind BEGIN
 OUTER_SET min_new=118
 COPY_EXISTING ~splstate.ids~ override
  new_state_ind=0
  found=0
  READ_2DA_ENTRIES_NOW stats 2
  FOR (row=0;row<stats;row+=1) BEGIN
    READ_2DA_ENTRY_FORMER stats row 0 ind
    READ_2DA_ENTRY_FORMER stats row 1 str
    SET $stat("%row%") = ind
    PATCH_IF index BEGIN
      PATCH_IF ind=index BEGIN
        REMOVE_2DA_ROW row 2
        found=1
        PATCH_IF delete=0 BEGIN
          INSERT_2DA_ROW row 2 ~%index% %new_state_id%~
        END
        row=stats
      END
    END ELSE BEGIN
      PATCH_IF ~%str%~ STRING_EQUAL_CASE ~%new_state_id%~ BEGIN
        new_state_ind=ind
        found=1
     /* row=stats */ // don't stop looking, the same ID may be assigned to a greater index, which takes priority when compiling
      END
    END
  END
  PATCH_IF found=0 BEGIN
    new_state_ind=min_new
    PHP_EACH stat AS row => ind BEGIN
      PATCH_IF found=0 && (row+1 < stats) BEGIN // not at the end of file
        next_row = row+1
        next_ind = EVAL $stat("%next_row%")
        PATCH_IF index BEGIN
          PATCH_IF index<next_ind && index>ind BEGIN
            INSERT_2DA_ROW next_row 2 ~%index% %new_state_id%~
            found=1
          END
        END ELSE BEGIN
          PATCH_IF new_state_ind<next_ind BEGIN
            PATCH_IF ind<new_state_ind BEGIN
              INSERT_2DA_ROW next_row 2 ~%new_state_ind% %new_state_id%~
              found=1
            END ELSE BEGIN
              new_state_ind+=1
              PATCH_IF new_state_ind<next_ind BEGIN
                INSERT_2DA_ROW next_row 2 ~%new_state_ind% %new_state_id%~
                found=1
              END
            END
          END
        END
      END ELSE BEGIN // at the end of file
        PATCH_IF found=0 BEGIN
          PATCH_IF index BEGIN
            INSERT_2DA_ROW stats 2 ~%index% %new_state_id%~
          END ELSE BEGIN
            PATCH_IF new_state_ind>ind BEGIN
              INSERT_2DA_ROW stats 2 ~%new_state_ind% %new_state_id%~
            END ELSE BEGIN
              new_state_ind+=1
              INSERT_2DA_ROW stats 2 ~%new_state_ind% %new_state_id%~
            END
          END
        END
      END
    END
  END
END

LAUNCH_PATCH_FUNCTION ~resolve_state~ 
    STR_VAR 
        new_state_id = ~CAST_SHIFTED~ 
        RET new_state_ind 
END

Edited by gamemaster76
Link to comment
34 minutes ago, Jarno Mikkola said:

Eeerrm, the .tp2 code attached to the archive, and the above code have nothing to do with each others... screen shot from the archived file opened with Notepad++, near line 77:

kuva.thumb.png.e5891ff25b77a5223e7677c4fe792e25.png

.... what? Ok now I'm really confused. The archive was from my google drive but the code from my local copy... so I guess I somehow uploaded the wrong version to drive...

This is embarrassing..

And I can't get back on my computer until tomorrow..

Link to comment

 

11 hours ago, Jarno Mikkola said:

Eeerrm, the .tp2 code attached to the archive, and the above code have nothing to do with each others... screen shot from the archived file opened with Notepad++, near line 77:

kuva.thumb.png.e5891ff25b77a5223e7677c4fe792e25.png

heres the correct .tp2 file

 

Edit - I figured out how to make the rest of the code work on BG1EE but this part I don't know. If I remember correctly it was meant to make the mod work when there were other mods installed... but its been too long. Removing it and it installs perfectly. But I must have had a reason to put this code:

 

BEGIN ~Balanced_shapeshifter_Kit~  

DEFINE_ACTION_FUNCTION resolve_state INT_VAR index=0 delete=0 STR_VAR new_state_id = ~blah~ RET new_state_ind BEGIN
 OUTER_SET min_new=118
 COPY_EXISTING ~splstate.ids~ override
  new_state_ind=0
  found=0
  READ_2DA_ENTRIES_NOW stats 2
  FOR (row=0;row<stats;row+=1) BEGIN
    READ_2DA_ENTRY_FORMER stats row 0 ind
    READ_2DA_ENTRY_FORMER stats row 1 str
    SET $stat("%row%") = ind
    PATCH_IF index BEGIN
      PATCH_IF ind=index BEGIN
        REMOVE_2DA_ROW row 2
        found=1
        PATCH_IF delete=0 BEGIN
          INSERT_2DA_ROW row 2 ~%index% %new_state_id%~
        END
        row=stats
      END
    END ELSE BEGIN
      PATCH_IF ~%str%~ STRING_EQUAL_CASE ~%new_state_id%~ BEGIN
        new_state_ind=ind
        found=1
     /* row=stats */ // don't stop looking, the same ID may be assigned to a greater index, which takes priority when compiling
      END
    END
  END
  PATCH_IF found=0 BEGIN
    new_state_ind=min_new
    PHP_EACH stat AS row => ind BEGIN
      PATCH_IF found=0 && (row+1 < stats) BEGIN // not at the end of file
        next_row = row+1
        next_ind = EVAL $stat("%next_row%")
        PATCH_IF index BEGIN
          PATCH_IF index<next_ind && index>ind BEGIN
            INSERT_2DA_ROW next_row 2 ~%index% %new_state_id%~
            found=1
          END
        END ELSE BEGIN
          PATCH_IF new_state_ind<next_ind BEGIN
            PATCH_IF ind<new_state_ind BEGIN
              INSERT_2DA_ROW next_row 2 ~%new_state_ind% %new_state_id%~
              found=1
            END ELSE BEGIN
              new_state_ind+=1
              PATCH_IF new_state_ind<next_ind BEGIN
                INSERT_2DA_ROW next_row 2 ~%new_state_ind% %new_state_id%~
                found=1
              END
            END
          END
        END
      END ELSE BEGIN // at the end of file
        PATCH_IF found=0 BEGIN
          PATCH_IF index BEGIN
            INSERT_2DA_ROW stats 2 ~%index% %new_state_id%~
          END ELSE BEGIN
            PATCH_IF new_state_ind>ind BEGIN
              INSERT_2DA_ROW stats 2 ~%new_state_ind% %new_state_id%~
            END ELSE BEGIN
              new_state_ind+=1
              INSERT_2DA_ROW stats 2 ~%new_state_ind% %new_state_id%~
            END
          END
        END
      END
    END
  END
END

LAUNCH_PATCH_FUNCTION ~resolve_state~ 
    STR_VAR 
        new_state_id = ~CAST_SHIFTED~ 
        RET new_state_ind 
END

 

setup-Balanced_shapeshifter_Kit.tp2

Edited by gamemaster76
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...