hadoumastery Posted October 23, 2012 Share Posted October 23, 2012 Scriptname transmuteIronOreToSaltScript extends ActiveMagicEffect {script for spell to allow transmutation of ores} import game MiscObject Property Ore01 Auto {Lowest value ore}MiscObject Property Ore02 Auto {Salt}Sound Property FailureSFX Auto float property skillAdvancement = 15.0 auto{How much to advance the skill? Only works when spell actually transmutes something}message property failureMSG auto EVENT OnEffectStart(Actor akTarget, Actor akCaster)objectReference caster = akCasterif caster.getItemCount(Ore01) >= 1caster.removeItem(Ore01, 1, TRUE)caster.addItem(Ore02, 1, TRUE)advanceSkill("alteration",skillAdvancement)else; caster must have had no valid oreFailureSFX.play(caster)failureMSG.show()endifendEVENT This is what I've got so far. It's adapting the original script into a iron ore=salt pile generator. Link to comment Share on other sites More sharing options...
Ghaunadaur Posted October 23, 2012 Share Posted October 23, 2012 Ingredient Property Ore02 Auto {Salt} Besides that, I can't see anything wrong with the script. Link to comment Share on other sites More sharing options...
hadoumastery Posted October 23, 2012 Author Share Posted October 23, 2012 That's my point. I need help fixing that to accept salt. Link to comment Share on other sites More sharing options...
steve40 Posted October 24, 2012 Share Posted October 24, 2012 (edited) @hadoumastery: you haven't explained what the problem is. I haven't got the CK in front of me, but I think salt is a potion like most foods are? Also objectReference caster = akCaster should be ObjectReference caster = akCaster as ObjectReference But that is redundant anyway, I think, because Actor already extends ObjectReference So: Scriptname transmuteIronOreToSaltScript extends ActiveMagicEffect {script for spell to allow transmutation of ores} import game MiscObject Property Ore01 Auto {Lowest value ore} Potion Property salt Auto {Salt} Sound Property FailureSFX Auto float property skillAdvancement = 15.0 auto {How much to advance the skill? Only works when spell actually transmutes something} message property failureMSG auto EVENT OnEffectStart(Actor akTarget, Actor akCaster) if akCaster.getItemCount(Ore01) >= 1 akCaster.removeItem(Ore01, 1, TRUE) akCaster.addItem(salt, 1, TRUE) advanceSkill("alteration",skillAdvancement) else ; akCaster must have had no valid ore FailureSFX.play(akCaster) failureMSG.show() endif endEVENT Edited October 24, 2012 by steve40 Link to comment Share on other sites More sharing options...
Ghaunadaur Posted October 24, 2012 Share Posted October 24, 2012 Salt is an igredient. Changing the property from MiscObject to Ingredient (as I posted above) will solve the problem. Link to comment Share on other sites More sharing options...
steve40 Posted October 24, 2012 Share Posted October 24, 2012 ^^ oops, sorry G, I missed that you had corrected that. Link to comment Share on other sites More sharing options...
hadoumastery Posted October 24, 2012 Author Share Posted October 24, 2012 (edited) Ah, ok, thanks. This helps. Oh one other thing, how do I turn the script into a .pex format? Edited October 24, 2012 by hadoumastery Link to comment Share on other sites More sharing options...
Ghaunadaur Posted October 24, 2012 Share Posted October 24, 2012 Oh one other thing, how do I turn the script into a .pex format? To compile the script, right-click the script at the papyrus section of the magic effect (where you add the script) and select the option 'edit source'. Then you can either 'save' or 'compile' it. If the compiler doesn't find anything to complain about, it will produce a .pex file. Once the script is compiled you'll need to edit the properties (Properties -> Edit Value). Link to comment Share on other sites More sharing options...
hadoumastery Posted October 25, 2012 Author Share Posted October 25, 2012 (edited) I see, thanks again! -I ran into an error. The error reads... Starting 1 compile threads for 1 files...Compiling "transmuteMineralScript"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\transmuteMineralScript.psc(0,0): filename does not match script name: transmuteironoretosaltscriptNo output generated for transmuteMineralScript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on transmuteMineralScript Also, it seems to be replacing the original script. Any idea what to do to fix this? -Ok I fixed an invalid object reference to salt, because it's actually called SaltPile. After that it still persists to give me the error, anything you can think of? Edited October 25, 2012 by hadoumastery Link to comment Share on other sites More sharing options...
Ghaunadaur Posted October 25, 2012 Share Posted October 25, 2012 (edited) The error is self-explanatory: file name does not match script name. The name of the script inside the code (after ScriptName ...) must match the name of the .psc file. Make a new script. You can do this either from the papyrus section of the magic effect (Add -> New Script) or the Papyrus Script Manager (right-click -> New). Name it TransmuteIronOreToSaltScript, it extends ActiveMagicEffect -> OK. Copy-Paste your code to the script and make sure the name after ScriptName is the same. Now it should compile. Edited October 25, 2012 by Ghaunadaur Link to comment Share on other sites More sharing options...
Recommended Posts