Jump to content

Replace a weapon with another


Salk

Recommended Posts

Hello!

I have read SimDing0's scripting tutorial but I fear I don't know how to apply what I learned yet.

 

In my specific case, I have a weapon equipped both as Weapon1 and Weapon2 (claws). I created the same version of the weapon but with a +1, +2 and +3 enchantment level.

 

I plan to change Claw with Claw +1 then with Claw +2 and finally with Claw +3 but I don't seem I can do it using the TakeItemReplace action. When I do it, I find two more duplicates of my original weapon, with the original weapon still occupying the Weapon1 slot, the first duplicate occupying Weapon2 and the second duplicate sent to the Inventory.

 

TakeItemReplace("WTPFE","WTPFEA",Myself)

 

WTPFE is the original equipped weapon in the Weapon1 and Weapon2 slots. WTPFEA never even appears.

 

Any help?

 

UPDATE1: I think I've been messing things, as usual. The above line should probably be: TakeItemReplace("WTPFEA","WTPFE",Myself) - doing that, the swapping is right but since I have the same weapon in both Weapon1 and Weapon2 slots I guess I need to have that line of code twice. I'll go test... :)

 

UPDATE2: Okay, it seems the trick worked. Excuse the commotion.

Link to comment

Salk, I had the exact same problem for my dog NPC here: http://forums.gibberlings3.net/index.php?showtopic=26072

 

No solution, I am afraid. Unless you are modding for BG(II):EE only, I think.

 

EDIT: I "solved" the problem in my case the way that I defined the hand weapon to be a "tooth" (playing the fist symbol) - the slots are empty because there will be boosting items to be found throughout the game the player can chose from.

The offhand weapon is a paw where the problem doesn't exist.

 

In case you find a solution for the "leave the same wepon but make it better by increasing it's damage or whatever upon levelling up", let me know...

Link to comment

I tried pretty much everything I could think of. FillSlot, EquipMostDamagingMelee, TakeItemReplace and combination of these. No luck.

 

I found a workaround to this but it's not really ideal... but it seems to be working.

I used opcode143 "CreateItemInSlot" here too for both weapon0 and weapon1 and the deed was done.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...