Jump to content

How to use MoveContainerContents? (new EE action)


K4thos

Recommended Posts

I'm trying to figure out how to use MoveContainerContents properly. It's a new action added in EE patch 2.x used to transfer items between containers in different areas. In SoD it's used to move Imoen items as well as to provide CHARNAME personal stash that moves his equippment between different areas. Example scripts on SoD installation are: BD0103, BD1000, BD3000, BD7100. Using that as an example I'm trying to make it work elsewhere but for some reason in my case the command doesn't do anything.

 

Here is a test code that can be used on vanilla BG:EE installation - simply start a new game and after few seconds you will end up in AR2700 near empty stash that should have items moved by MoveContainerContents:

BACKUP ~test/backup~
AUTHOR ~asd~
VERSION ~asd~

BEGIN ~test~
//NO_LOG_RECORD

COPY_EXISTING ~AR2600.ARE~ ~override~
    ~AR2700.ARE~ ~override~
    LPF fj_are_structure
        INT_VAR
        fj_type        = 2 //chest 8 - nonvisible
        fj_loc_x       = 688
        fj_loc_y       = 876
        fj_box_left    = 672
        fj_box_top     = 826
        fj_box_right   = 720
        fj_box_bottom  = 858
        fj_trap_loc_x  = 680
        fj_trap_loc_y  = 870
        fj_vertex_0    = 711 + (858 << 16)
        fj_vertex_1    = 672 + (845 << 16)
        fj_vertex_2    = 682 + (826 << 16)
        fj_vertex_3    = 720 + (839 << 16)
        STR_VAR
        fj_structure_type = container
        fj_name           = ~PlayerChest00~
    END

<<<<<<<< .../AR2600-eb.baf
IF
  Global("TestPlayerChest","GLOBAL",0)
THEN
  RESPONSE #100
    SetGlobal("TestPlayerChest","GLOBAL",1)
    GiveItemCreate("AMUL01",Player1,0,0,0)
    GiveItemCreate("AMUL02",Player1,0,0,0)
    GiveItemCreate("AMUL03",Player1,0,0,0)
END

IF
  Global("TestPlayerChest","GLOBAL",1)
THEN
  RESPONSE #100
    SetGlobal("TestPlayerChest","GLOBAL",2)
    DisplayStringHead(Player1,1)
    ActionOverride("PlayerChest00",TakeCreatureItems(Player1,ALL))
END

IF
  Global("TestPlayerChest","GLOBAL",2)
THEN
  RESPONSE #100
    SetGlobal("TestPlayerChest","GLOBAL",3)
    LeaveAreaLUAPanic("AR2700","",[588.876],S)
    ActionOverride(Player1,LeaveAreaLUA("AR2700","",[588.876],S))
END
>>>>>>>>

EXTEND_BOTTOM ~AR2600.BCS~ ~.../AR2600-eb.baf~

//move items to AR2700
<<<<<<<< .../AR2700-eb.baf
IF
  GlobalLT("TestPlayerChest","GLOBAL",5)
THEN
  RESPONSE #100
    IncrementGlobal("TestPlayerChest","GLOBAL",1) //let's give it 2 loops before next block
END

IF
  Global("TestPlayerChest","GLOBAL",5)
THEN
  RESPONSE #100
    SetGlobal("TestPlayerChest","GLOBAL",6)
    DisplayStringHead(Player1,2)
    MoveContainerContents("*PlayerChest00","*PlayerChest00AR2600")
END
>>>>>>>>

EXTEND_BOTTOM ~AR2700.BCS~ ~.../AR2700-eb.baf~

It doesn't work. Container in AR2700 is empty :( Items are still in AR2600 container. Did anyone managed to figure out how exactly this action should be used? Maybe I'm missing something...

 

Thanks in advance.

Link to comment

It looks like NI doesn't decode this script action correctly. You should decompile the BCS into BAF with WeiDU to see the correctly decoded command.

 

In essence, you have to use the following syntax:

MoveContainerContents("FROMAREA*FromContainer", "TOAREA*ToContainer)

Example: Put something into the first container on the upper floor of the Candlekeep Inn ("Container 1" in AR2617). Go to the haystack where Phlydia lost her book ("Container 4" on AR2600). Execute the following command in the debug console:

C:Eval('MoveContainerContents("AR2617*Container1", "AR2600*Container4")')
It doesn't seem to matter on which map you're executing the command.
Link to comment

It looks like NI doesn't decode this script action correctly.

 

awesome, thanks! It was driving me literally insane (trying to implement item importation from SoD to BG2 with this method) :) I'm sure this will be it.

Link to comment

Archived

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

×
×
  • Create New...