Force70 Posted February 11, 2014 Posted February 11, 2014 I'm working on a mod called Coins of Skyrim, and in this mod I replace all the gold septims with copper ones and then add in silver and gold septims. And I got the new coins to work like the coin purses to where if you pick them up they will disappear and then give you a set amount of copper septims, but I ran into a problem. The coins work, but not all the time. I don't know if the glitch is caused by the amount of coins you pick up or the value of the amount of coins you pick up, but sometimes when I pick up the new coins from a container or gain them as a quest reward most of the coins will go into my inventory instead of getting converted to copper septims. I'm thinking that the problem might be the script isn't running fast enough, but I'm no scripter so I don't know. I just used the script that was attached to the coin purses. Here is the script. Can anyone look it over and see what might be causing the problem? Scriptname newcoinscript extends ObjectReference Conditional import debug import utility MiscObject property coinObj auto {Should be set to Coin01} MiscObject property gold00 auto Int property coinMin auto {minimum amount of coins player receives} Int property coinMax auto {maximum amount of coins player receives} ;************************************ event OnLoad() BlockActivation() endEvent function CoinTake() ;player has activated int numOfCoins = randomInt(coinMin, coinMax) gotoState("done") game.getplayer().removeitem(gold00, abSilent = true) game.getPlayer().addItem(coinObj, numOfCoins,true) endFunction auto State Waiting Event OnActivate (objectReference triggerRef) Actor actorRef = triggerRef as Actor if(actorRef == game.getPlayer()) CoinTake() disable() delete() endif endEvent Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if akNewContainer == game.getplayer() CoinTake() endif endEvent endState ;************************************ State done ;do nothing endState ;************************************
Force70 Posted February 11, 2014 Author Posted February 11, 2014 No one? I'll try and better explain the problem then. I replaced the default gold coins (gold001) texture so that it will be a copper coin and then I added in two new coins, a silver and gold coin. valued at 50 and 100. Then I gave the new coins the above script, which is basically the same script that is attached to coin purses. So when you pick up one of the new coins, lets say silver, that coin is then deleted and replaced with a set amount of gold001 coins (which are copper). Now the problem accrues when you pick up more then one coin. Like if they are in a chest/body or as a quest reward.The script only seems to run for the first coin. After that, the rest of the coins go into my inventory. And if I were to drop the coins I won't be able to pick them back up, and if I put them into a chest/body I can pick them back up but the script won't run for them. So they just go straight back into my inventory. I would really appreciate some help here.
Recommended Posts