KatAngel Posted March 14, 2009 Share Posted March 14, 2009 I'm trying to make some multiple ammunition type deals here. I'm using a pretty heavily modified version of Balor's multiple weapon ammunition types script, but the thing that's baffling me is that the part that's causing the problem is in part of the code I didn't change. Here's the code that's causing the problem (it's in a begin MenuMode block): {SNIP} if button == 0 player.AddItemHealthPercent Weap10mmPistol1 1 weaponCondition 1 player.EquipItem Weap10mmPistol1 0 1 removeme {SNIP} It's not a problem with the way the menu has been set up, so I'm not bothering to put that part of the code here. All variables referenced in the above snippet are properly initialized and set, etc. It runs properly, adds the item, and equips it. The problem is in removeme. I have multiple copies of the same item in my inventory that I'm replacing (the 10mm pistol), and if I choose one of them in particular, removeme simply fails silently. Nothing happens at all. I get the new item, and keep the old one, so it ends up making copies of it - which is not what I want. If I pick any of the others (which are all in stacks) then the game completely crashes, with a "memory could not be read" error. This is baffling me to no end, because if I use any of the other scripts that use this same code that have already been released, they work perfectly. What the hell is wrong with my script that's causing it to crash?! Link to comment Share on other sites More sharing options...
KatAngel Posted March 14, 2009 Author Share Posted March 14, 2009 Hmm. I would realize this AFTER posting, but it seems to work just fine if I give myself a new pistol with player.additem. So maybe it's just because they were created before I put in the mod? In that case, my question is whether or not anyone knows any way around this so that people won't have to start a new game to use my mod. Link to comment Share on other sites More sharing options...
Cipscis Posted March 15, 2009 Share Posted March 15, 2009 I'm a little unsure when it comes to what exactly you're trying to use RemoveMe for here. It looks like you're trying to use it to close the menu by removing the item with the menu script attached from the player's inventory, but it sounds to me like you're trying to use it to remove a specific instance of a weapon from the player's inventory? RemoveMe can't be used to remove a specific inventory item other than the scripted item, as inventory items not assigned RefIDs so there is no way to refer to a specific inventory item. Cipscis Link to comment Share on other sites More sharing options...
KatAngel Posted March 15, 2009 Author Share Posted March 15, 2009 I'm trying to remove the item that the script is attached to, after the player has already closed the window. The player equips the item, is presented with the menu to select the ammunition they want to use, and then another weapon with that ammunition is spawned and equipped, and the original item is removed. Link to comment Share on other sites More sharing options...
Stewb Posted March 15, 2009 Share Posted March 15, 2009 try using a misc item to add the new weap with additem, removeitem to take away the old item and it should be fine, just call the misc item something like "weapon selector". no need to use removeme then as misc item will stay with you to change items. Hope this helps Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.