Jump to content

Help with personal Shapeshifter mod for Baldurs Gate EE 1&2


Recommended Posts

3 hours ago, gamemaster76 said:

STR_VAR
            resource = ~WEREWODR.CRE~

... I got confused because the opcode page didnt mentioned anything about needing a line like that.

Sorry, but this: opcode 135:

Description:
Polymorphs the targeted creature(s) into the creature specified by the resource key, in the style specified by the Type field.
 
You might have used a translator that mangled the language or, I don't know what.
Link to comment
18 minutes ago, Jarno Mikkola said:

Sorry, but this: opcode 135:

Description:
Polymorphs the targeted creature(s) into the creature specified by the resource key, in the style specified by the Type field.
 
You might have used a translator that mangled the language or, I don't know what.

I didn't use a translator, English is my mother tongue.

Yes it says resource key but didn't explain WHAT the key should be. If its the creature file, they should have just said that.

Resource key = creature file, there, wasn't so hard.

and I figured it couldn't be "resource = ~WEREWODR.CRE~" because they didn't put it in the example code:

Parameter #1: Irrelevant
Parameter #2: Type

 

I figured it cant be code, otherwise they would have put it there. Its just unnecessarily confusing.

 

Edited by gamemaster76
Link to comment

Ok I think I found the problem. I have no idea why its happening but I found it. 


In Near Infinity,  the shapeshift ability for Lesser Werewolf "spcl645.spl",  under Spell Ability 0, in the list of effects, there's 2 polymorphs, effect 4 and effect 10.

Effect 10 is the original polymorph from when I copied the Normal werewolf transformation,  effect 4 is the new one I put meant to override the old.

For some reason,  the transformation is still drawing from effect 10 and not effect 4. When I manually changed effect 10 resource to the Lesser werewolf It worked as intended. 

So is there a code that will directly edit the existing polymorph code instead of just writing a second one? Or will at least erase it, forcing the game to effect 4?

I tried  ~ALTER_SPELL_EFFECT~ but that didn't work.

Edited by gamemaster76
Link to comment
9 minutes ago, gamemaster76 said:

So is there a code that will directly edit the existing polymorph code instead of just writing a second one?

Yes, deletes are LPF's that can be found here: DELETE_SPELL_EFFECT, DELETE_ITEM_EFFECT, DELETE_ITEM_EQEFFECT, and DELETE_CRE_EFFECT.

And then there's the CLONE_EFFECT and ALTER_EFFECT, which are more complicated, but more useful.

And by the way, the

Quote

resource = ~WEREWODR.CRE~

...  doesn't actually take the .cre into account...

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

I tried again with ALTER_SPELL_EFFECT and for BG1 it works! now to figure out how to get it to work for BG2.

I mean it worked either way, but alright, I removed .cre from the code

It worked because WEREWODR is already 8 characters, which is the field size.  Were it fewer, part or all of the extension would be included as the resource, and it would not work (and likely crash).

Link to comment

Ok, so now when I use the Lesser transformation, instead of saying "Lesser Werewolf: <charname>", it instead says "INVALIDE: <charname>". so for some reason the right text isn't found,

Also I see an instance of the game ignoring the code. I have this line:

 

        LAUNCH_PATCH_FUNCTION ~ALTER_ITEM_EFFECT~ 
          INT_VAR
            match_opcode = 135                         
            target = 1 
            timing = 2          
            resistance = 0
            parameter1 = 0                                                                 
            parameter2 = 1   // 1 = Appearance only, 0 = normal morphing
            probability1 = 100                                                             
            insert_point = 0    
            
          STR_VAR 
            resource = ~WERELEDR~        
        END

 

Among other things, this is suppose to change the resource from the Normal wolf to the Lesser. According to Near Infinity, it completely ignores this section of code. 

item cdbrbrp3.ITM, 12th effect - polymorph. 

 

Im able to add a new polymorph effect but I need to delete the old one. If I use DELETE_ITEM_EFFECT, how can I make it so that it deletes the original and not also the new one?

Also whats the correct syntax for it? so far I have 

        LAUNCH_PATCH_FUNCTION ~DELETE_ITEM_EFFECT~
          SET
            opcode_to_delete = 135
         END

and it gives a Parse error

 

updated link

Edited by gamemaster76
Link to comment
38 minutes ago, gamemaster76 said:

Im able to add a new polymorph effect but I need to delete the old one. If I use DELETE_ITEM_EFFECT, how can I make it so that it deletes the original and not also the new one?

You simply remove the old effects before adding the new ones. Yes, the commands are processed simularly like commands to the command prompt in dos.

 

40 minutes ago, gamemaster76 said:

 LAUNCH_PATCH_FUNCTION ~DELETE_ITEM_EFFECT~
          SET
            opcode_to_delete = 135
         END

Yes... but this needs to be after the copy action, but lets assume you knew that.

Link to comment
17 minutes ago, Jarno Mikkola said:

You simply remove the old effects before adding the new ones. Yes, the commands are processed simularly like commands to the command prompt in dos.

 

Yes... but this needs to be after the copy action, but lets assume you knew that.

Yeah I figured that much. Its after the copy action.

Link to comment

I put right after the copy action but still gives a parse error.  Not at LAUNCH_PATCH_FUNCTION ~DELETE_ITEM_EFFECT~     but at SET

 

COPY_EXISTING ~cdbrbrp.ITM~ ~override/cdbrbrp3.ITM~ // adds paw attack for Lesser Werewolf form
        
        LAUNCH_PATCH_FUNCTION ~DELETE_ITEM_EFFECT~
          SET
            opcode_to_delete = 135
         END
        

Edited by gamemaster76
Link to comment

So basically parts of my Lesser Werewolf code are being ignored and not being properly implemented... for some reason. I assume its a syntax issue but I cant figure it out:

 

    COPY_EXISTING ~WEREWODR.CRE~ ~override/WERELEDR.CRE~ // adds the Lesser Werewolf creature
            SAY NAME1 ~Lesser Werewolf~
            SAY NAME2 ~Lesser Werewolf~
            WRITE_BYTE  0x5d ~10~ // Magic Resistance
            WRITE_BYTE  0x46 ~4~ // Natural AC
            WRITE_BYTE  0x48 ~4~ // Effective AC
            WRITE_BYTE  0x53 ~1~ // APR
            WRITE_BYTE  0x238 ~18~ //STR
            WRITE_BYTE  0x23c ~15~ // DEX
            WRITE_BYTE  0x23d ~15~ // CON

    COPY_EXISTING ~spcl643.spl~ ~override/spcl645.spl~  // adds the Shapeshift: Lesser Werewolf transformation
            SAY NAME1 ~Shapeshift: Lesser Werewolf~
            SAY NAME2 ~Shapeshift: Lesser Werewolf~
            SAY 0x50 ~Shapeshift: Lesser Werewolf

                    Strength: 18 
                    Dexterity: 15
                    Constitution: 15
                    
                    Base Armor Class: 4
                    Number of Attacks: 1
                    Attack Damage: 1d6 (slashing), strikes as +1 weapon

                    Special Abilities:
                    – Magic Resistance: 10% ~
 

 

[......]

 

        LAUNCH_PATCH_FUNCTION ~ALTER_ITEM_EFFECT~ // Makes polymorph cosmetic only
          INT_VAR
            match_opcode = 135                         
            target = 1 
            timing = 2          
            resistance = 0
            parameter1 = 0                                                                 
            parameter2 = 1   // 1 = Appearance only, 0 = normal morphing
            probability1 = 100                                                             
            insert_point = 0    
            
          STR_VAR 
            resource = ~WERELEDR~        
        END

 

 

these are the codes being ignored. 

COPY_EXISTING works but the further operations do nothing. 

ALTER_ITEM_EFFECT just refuses to do anything, and changing it to a ADD_ITEM_EQEFFECT works... but it still defaults to the first polymorph ability.... and DELETE_ITEM_EFFECT causes a Parse error when I try to run the installer....

For the record, BG1EE works with this code. I'm checking  the documentation:https://weidu.org/~thebigg/README-WeiDU.html

And I can't find anything to indicate what I'm doing wrong.

Edited by gamemaster76
Link to comment

ALTER_ITEM_EFFECT and ALTER_SPELL_EFFECT require setting check_globals and/or check_headers, they default to 0 (ignore).

ALTER_EFFECT defaults both of them to 1 (check).

This:

        LAUNCH_PATCH_FUNCTION ~DELETE_ITEM_EFFECT~
          SET
            opcode_to_delete = 135
         END

should be:

        LAUNCH_PATCH_FUNCTION ~DELETE_ITEM_EFFECT~
          INT_VAR
            opcode_to_delete = 135
         END

 

Link to comment
11 minutes ago, kjeron said:

ALTER_ITEM_EFFECT and ALTER_SPELL_EFFECT require setting check_globals and/or check_headers, they default to 0 (ignore).

ALTER_EFFECT defaults both of them to 1 (check).

This:


        LAUNCH_PATCH_FUNCTION ~DELETE_ITEM_EFFECT~
          SET
            opcode_to_delete = 135
         END

should be:


        LAUNCH_PATCH_FUNCTION ~DELETE_ITEM_EFFECT~
          INT_VAR
            opcode_to_delete = 135
         END

 

DELETE_ITEM_EFFECT finally didnt give a parse error! according to the Weido docs it should have been SET..I guess its just outdated.

Unfortunately it is also ignored and did nothing... but the check_globals made ALTER_ITEM_EFFECT work! Thanks!! With that, I dont need DELETE_ITEM_EFFECT anymore.

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...