Ironworks Gaming Forum

Ironworks Gaming Forum (http://www.ironworksforum.com/forum/index.php)
-   Miscellaneous Games (RPG or not) (http://www.ironworksforum.com/forum/forumdisplay.php?f=27)
-   -   TES scripting, the pocket chest (http://www.ironworksforum.com/forum/showthread.php?t=63598)

Radek 03-01-2004 06:30 AM

The problem described here relates to mod writing.

As perhaps all mod writers know, the "Activate" function has a hidden parameter that allows us to create a "pocket chest", i.e., a chest which opens and allow you to exchange items with the chest, no matter where we are. Make the chest persistent and attach the following script to a ring in your inventory:

<pre>
short OnPCEquip
;
if( OnPCEquip == 1 )
set OnPCEquip to 0
MyPocketChest->Activate, player
endif
</pre>

This will not work. Among others, we are trying to open the chest while the inventory menu is active. Therefore:

<pre>
short OnPCEquip
short ChestTrigger
;
if( OnPCEquip == 1 )
set OnPCEuip to 0
set ChestTrigger to 1
MenuTest
return
endif
;
if( MenuMode == 1 )
return
endif
;
if( ChestTrigger == 1 )
set ChestTrigger to 0
MyPocketChest->Activate, player
endif
</pre>

This should work but it doesn't. Nevertheless, we can notify with some luck, that the pocket chest gets the "On_Activate" signal (ignore the underscore in the name - problems with html parser). Let us attach to the chest the following script:

<pre>
if( On_Activate == 1 )
Activate
endif
</pre>

Now, the pocket chest seems to work! You can open the chest no matter where you are! But it's only a hallucination.
1. The chest will not work until you open it "regularly" by means of the spacebar at least once. Once the chest has been opened by the spacebar, it can be opened by the ring whenever you want. Weird, but acceptable.
2. But it is worse. Once you restart or reload the game, the chest stops working. You must go to the chest and open it by means of the spacebar again. Then, the chest will continue working - until you restart or reload the game again. Naturally, the problem must relate to the weird behaviour described above. Most likely, some kind of link is broken until you fix it using the spacebar. The link isn't saved in your saved game file and is broken again, when you restart or reload the game.

Does anybody know how to fix the chest? Let us note that the game crashes constantly so that the flawed chest is almost worthless. I have already experimented with the "Activate" and "Activate, player" in the scripts but without success. All three possibilities give the same result. I have tried to command the chest by means of the console but without success again.


All times are GMT -4. The time now is 01:03 AM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved