BlackZero500 Posted October 23, 2011 Share Posted October 23, 2011 Hi. Im working on a Weapon Leveling Mod, but it just wont work and i dont know why. Ok i have a pistol, and i want to level it trough a upgrade item. So far so good. So i have the weapon, i use the Upgrade item the menu comes up i chose upgrade Weapon but then nothing happens. The ingredients (in this case just tokens for a test) wont disappear, the old weapon wont disappear and the new weapon wont appear. but why?? Here is the code: SCN HadesUpgradeKitScript short buttonVar Begin ScriptEffectStart Player.AddItem HadesUpgradeKit 1,1 showmessage HadesUpgradeMessage set buttonVar to getbuttonpressed if buttonVar == 0 If player.getitemcount HadesUpgradeToken == 15 player.additem WeapHades02 1 player.equipitem WeapHades02 player.removeitem WeapHades01 1 player.removeitem HadesUpgradeToken 15 endif endif elseif buttonVar == 1 ; ammo elseif buttonVar == 2 ; abort endif endif endif end Please help Link to comment Share on other sites More sharing options...
caramellcube Posted October 23, 2011 Share Posted October 23, 2011 hmm, i don't see any problems in the lines that add and remove items, so I'd guess that one of the if statements isn't returning true. It might be worth narrowing down which one by temporarily changing the If player.getitemcount HadesUpgradeToken == 15 to If player.getitemcount HadesUpgradeToken > 14 or just leaving it out entirely and checking what happens. or, paste the code into the other 2 button choices. If it starts working then, there's a problem with the button numbering. Or you could put a message on each button press saying "this is button [number]" just to make sure they're numbered the way they should be. Link to comment Share on other sites More sharing options...
BlackZero500 Posted October 23, 2011 Author Share Posted October 23, 2011 Even if i throw out every condition, so i just have to use the Upgrade item it does not work. I just dont know why. the weapons wont change at all. Link to comment Share on other sites More sharing options...
moirai Posted October 24, 2011 Share Posted October 24, 2011 Even if i throw out every condition, so i just have to use the Upgrade item it does not work. I just dont know why. the weapons wont change at all. From what I can see, you have too many 'endif' statements in there. Try the following: SCN HadesUpgradeKitScript short buttonVar Begin ScriptEffectStart Player.AddItem HadesUpgradeKit 1,1 showmessage HadesUpgradeMessage set buttonVar to getbuttonpressed if buttonVar == 0 if player.getitemcount HadesUpgradeToken == 15 player.additem WeapHades02 1 player.equipitem WeapHades02 player.removeitem WeapHades01 1 player.removeitem HadesUpgradeToken 15 endif elseif buttonVar == 1 ; ammo elseif buttonVar == 2 ; abort endif end Link to comment Share on other sites More sharing options...
BlackZero500 Posted October 24, 2011 Author Share Posted October 24, 2011 Ok thats right, but not the problem. i just deletet some unneccesary lines. But even if i make it just so: begin scripteffectstart player.additem HadesUpgradeKit 1,1 player.additem WeapHades02 1 player.equipitem WeapHades02 player.removeitem WeapHades01 1 end Even so it just does nothing!!! Why? Link to comment Share on other sites More sharing options...
moirai Posted October 24, 2011 Share Posted October 24, 2011 Ok thats right, but not the problem. i just deletet some unneccesary lines. But even if i make it just so: begin scripteffectstart player.additem HadesUpgradeKit 1,1 player.additem WeapHades02 1 player.equipitem WeapHades02 player.removeitem WeapHades01 1 end Even so it just does nothing!!! Why? Okay. Let me ask you this then, because I think we're missing some relevant info here, What is actually calling this script, as in, what type of base object? I take it you have something in your inventory which, when you select it, you want it to bring up an 'upgrade menu', yes...? If 'yes', humour me and try the following as the script for that item: scn HadesUpgradeKitScript int KeyEquip int KeyPressedEquip Begin OnEquip Player.AddItem HadesUpgradeKit 1 1 ShowMessage HadesUpgradeMessage set KeyPressedEquip to 1 End Begin GameMode if KeyPressedEquip == 1 Set KeyEquip to GetButtonPressed endif if KeyPressedEquip == 1 && KeyEquip > -1 if KeyEquip == 0 if player.getitemcount HadesUpgradeToken == 15 player.additem WeapHades02 1 1 player.equipitem WeapHades02 0 1 player.removeitem WeapHades01 1 1 player.removeitem HadesUpgradeToken 15 1 endif set KeyEquip to -1 set KeyPressedEquip to -1 elseif KeyEquip == 1 ; ammo set KeyEquip to -1 set KeyPressedEquip to -1 else set KeyEquip to -1 set KeyPressedEquip to -1 endif endif End Link to comment Share on other sites More sharing options...
Recommended Posts