Search the Community
Showing results for tags 'removeme'.
-
I am trying to temporarily exchange all items of Player and any NPC (including, or rather: especially companions). Soon after, I perform the exchange again to give all the items back to the original owner. I tried a few ways to do this, but so far only RemoveAllItems worked for me. (Of course, I had to make use of a persistent container to perform the exchange.) I tried using manual iteration in different ways but nothing worked for me. (Possibly, I was doing something wrong.) Anyway, it all looks good so far, but I am wondering about quest items or scripted items from various mods. The wiki page mentions some issues with quest items. Actually, I don't care about quest items much. I totally wouldn't mind leaving them where they are. Is there a chance that there could be bugs or stability issues caused by using RemoveAllItems (for transfer) on player or NPCs?
-
My goal with this script is to allow a one-size-fits-all leveled list to work for both Capital Wasteland and Mojave Wasteland NPCs in Tale of Two Wastelands without either using incorrect weapons for the locale. Here's the script I'm using: scn CYCWCChineseAssaultRifleWasterSCRIPT ref rHolder begin GameMode if (rHolder != GetContainer) ; Set the reference so we can add the item. set rHolder to GetContainer else if (rHolder != 0) ; Ensure the item is in a container before proceeding. if (bInDCWasteland == 1) || (GetRandomPercent == 1) rHolder.AddItem WithAmmoChineseAssaultRifleNPC 1 1 else rHolder.AddItem WithAmmoAssaultRifleNPC 1 1 endif endif RemoveMe ; Remove the misc item as it's done its job. endif EndThis runs on a misc item that, as the code might suggest, is intended to transform into the appropriate weapon. When added to the player or an NPC via the AddItem command, this works just fine and it functions correctly. I've ensured that leveled lists inside the script exist and I know that the global exists, so I don't think they're the problems. On NPCs that are just spawning into the world, however (in my case, a test NPC spawned with the PlaceAtMe command), the game locks up and has to be ended with the task manager. I've tried adding a timer to the script to give the NPC time to load in, but that only delayed the crash until after the timer expired. This script has to function with an item that has to be part of a leveled list. If it can't, it's entirely useless and I'll be forced to juggle even more leveled lists for the Mojave (which is a problem as I've got way too many for just D.C.). What am I doing wrong and how can I fix it?