Jump to content

Convert a base form to a persistent reference temporarily?


HerrBaron

Recommended Posts

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

I'll try it on my computer.

 

Also, I found something kind of dumb and embarassing about that script I posted - if the number for the Label/Goto is greater than 255, it won't loop !

Link to comment
Share on other sites

I'll try it on my computer.

 

Also, I found something kind of dumb and embarassing about that script I posted - if the number for the Label/Goto is greater than 255, it won't loop !

 

 

At the risk of being bitten again, I THINK I have this working. Here's where I call the quest script; it needed a guard condition around it to make sure it wasn't already running.

 

Begin GameMode

 

 

 

if ( bActivated )

set Button to GetButtonPressed;

 

if ( Button== 0 ) ; first option in menu is "Open it."

 

Activate;

elseif ( Button == 1 )

 

if ( WSTNHKExceptionListMgrQuest.bInitList || WSTNHKExceptionListMgrQuest.bMoveItems || WSTNHKExceptionListMgrQuest.bClearList )

;

else

ResetQuest WSTNHKExceptionListMgrQuest;

set WSTNHKExceptionListMgrQuest.bInitList to 1;

StartQuest WSTNHKExceptionListMgrQuest;

endif

endif ; ( Button == 1 )

set bActivated to 0;

endif ; ( bActivated )

End

 

 

 

Link to comment
Share on other sites

I'll try it on my computer.

 

Also, I found something kind of dumb and embarassing about that script I posted - if the number for the Label/Goto is greater than 255, it won't loop !

 

 

At the risk of being bitten again, I THINK I have this working. Here's where I call the quest script; it needed a guard condition around it to make sure it wasn't already running.

 

Begin GameMode

 

 

 

if ( bActivated )

set Button to GetButtonPressed;

 

if ( Button== 0 ) ; first option in menu is "Open it."

 

Activate;

elseif ( Button == 1 )

 

if ( WSTNHKExceptionListMgrQuest.bInitList || WSTNHKExceptionListMgrQuest.bMoveItems || WSTNHKExceptionListMgrQuest.bClearList )

;

else

ResetQuest WSTNHKExceptionListMgrQuest;

set WSTNHKExceptionListMgrQuest.bInitList to 1;

StartQuest WSTNHKExceptionListMgrQuest;

endif

endif ; ( Button == 1 )

set bActivated to 0;

endif ; ( bActivated )

End

 

 

 

 

Ahh ;)

It's not crashing for me. I have a companion dialog result script launching the quest and i've done it about 20 times and it works every time, removing the weapons that are not hotkeyed.

Link to comment
Share on other sites

:D With or without the guard condition I stuck in above? I'm cautiously optimistic here! Again, darn good you're around here, Ricker; wouldn't have gotten this far without your help!

 

I don't have the script in your last post - is that on another object, like an activator?

By the time my companion launches your quest and exits dialog, it's done, so there is no chance for a 'double activation' to break it.

Link to comment
Share on other sites

:D With or without the guard condition I stuck in above? I'm cautiously optimistic here! Again, darn good you're around here, Ricker; wouldn't have gotten this far without your help!

 

I don't have the script in your last post - is that on another object, like an activator?

By the time my companion launches your quest and exits dialog, it's done, so there is no chance for a 'double activation' to break it.

 

Yes; it's on a container. The OnActivate block sets a flag for the GameMode block and shows a message with some choices in it. The first is to open the container, the second is to move weapons to storage, and the third is to do nothing.

 

Begin OnActivate

set bActivated to 1;

ShowMessage WSTNMsgWeapons;

End

 

 

 

Link to comment
Share on other sites

Ricker, I'm at my wits end; it's back to crashing after a couple or three runs, always at the same place in NVSE_1_1.dll. I've attached the 2 scripts here; figured it'd be easier if you're still interested in looking at this.

 

I'm done for tonight.

 

 

 

 

Link to comment
Share on other sites

I made a new plugin, copied a new container RHKFootlocker01Empty. Put your script on it. Placed it in the world. Gave it the persistent ref of StgWeaponsREF.

Made the Formlist, quest, script, and messagebox.

Ran through it 5 or 6 times. Saved game exit, reload.

Run through another 6 times. Save, exit, reload.

Run through a bunch of times as fast as possible - sort-open-container-take all-sort-open-take-all, etc.

 

Never crashed.

 

The only thing I can think of at this point is a dirty save game issue with either the container Reference or the formlist. I would either do the same as I did with a new esp to prove you aren't crazy, or leave the cell you are testing in, save, exit, untick your mod, make a new save with your mod unloaded to purge all references to it, then re-tick it and try again. Make sure your Form list in the Geck has no items to start with.

 

 

Other things, not likely:

test with vanilla, unscripted weapons

Don't remove weapons that are quest items

The effects of AddFormToFormlist are preserved in the save game. If the list does not need to persist between saves, consider using ListAddForm instead to guarantee your list will always be empty on game reload.

 

In the activation block of the container, make it so only the player can activate it:

 

 

Begin OnActivate
if (IsActionRef Player == 1)
 if ( GetQuestRunning WSTNHKExceptionListMgrQuest )
 printc "Quest Busy...";
 else
  set bActivated to 1;
  ShowMessage WSTNMsgWeapons;
 endif
endif
End

 

 

Link to comment
Share on other sites

I made a new plugin, copied a new container RHKFootlocker01Empty. Put your script on it. Placed it in the world. Gave it the persistent ref of StgWeaponsREF.

Made the Formlist, quest, script, and messagebox.

Ran through it 5 or 6 times. Saved game exit, reload.

Run through another 6 times. Save, exit, reload.

Run through a bunch of times as fast as possible - sort-open-container-take all-sort-open-take-all, etc.

 

Never crashed.

 

The only thing I can think of at this point is a dirty save game issue with either the container Reference or the formlist. I would either do the same as I did with a new esp to prove you aren't crazy, or leave the cell you are testing in, save, exit, untick your mod, make a new save with your mod unloaded to purge all references to it, then re-tick it and try again. Make sure your Form list in the Geck has no items to start with.

 

 

Other things, not likely:

test with vanilla, unscripted weapons

Don't remove weapons that are quest items

The effects of AddFormToFormlist are preserved in the save game. If the list does not need to persist between saves, consider using ListAddForm instead to guarantee your list will always be empty on game reload.

 

In the activation block of the container, make it so only the player can activate it:

 

 

Begin OnActivate
if (IsActionRef Player == 1)
 if ( GetQuestRunning WSTNHKExceptionListMgrQuest )
 printc "Quest Busy...";
 else
  set bActivated to 1;
  ShowMessage WSTNMsgWeapons;
 endif
endif
End

 

 

 

 

Roger; will do, and report back.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...