bencebence Posted July 8, 2011 Author Share Posted July 8, 2011 I've changed some things, but it still doesn't show up. It does nothing when I activate it.ScriptName RaivenSmelt Short copperorecount Short coalcount Short pureironorecount Short mithrilorecount Short ayliiteorecount Short dwarfiteorecount Short tinorecount Short ironorecount Short silverorecount Short goldorecount Short daedriteorecount Short crystaliteorecount Short ebonyorecount Short armorerskill Short apron Short chance Short menulevel Short button short crystalitebarsmade short crystaliteremoved short ebonybarsmade short ebonyremoved Short ironbarsmade Short ironremoved Short copperbarsmade Short copperremoved Short tinremoved Short mithrilbarsmade Short mithrilremoved Short bronzebarsmade Short bronzeremoved Short steelbarsmade Short coalremoved Short coalremoved1 Short coalremoved2 Short coalremoved3 Short coalremoved4 Short coalremoved5 Short coalremoved6 Short coalremoved7 Short coalremoved8 Short dwarvenbarsmade Short dwarvenremoved Short silverbarsmade Short silverremoved Short ayliitebarsmade Short ayliiteremoved Short pureironremoved Short daedricbarsmade Short daedriteremoved Begin OnActivate set apron to player.getequipped LowerShirt01 set armorerskill to player.getactorvalue armorer if apron == 1 && menulevel == 0 messagebox "What kind of bar would you like to create?", "Iron", "Copper", "Bronze", "Steel", "Ayliite", "Dwarven", "Mithril", "Crystalite", "Ebony", "Daedric" set menulevel to 1 else Message "You are not wearing suitable gear. Equip an apron." endif end Begin gamemode set ironorecount to player.getitemcount IroneOre set pureironorecount to player.getitemcount PureIronOre set mithrilorecount to player.getitemcount MithrilOre set ayliiteorecount to player.getitemcount AyliiteOre set tinorecount to player.getitemcount TinOre set daedriteorecount to player.getitemcount DaedriteOre set copperorecount to player.getitemcount CopperOre set coalcount to player.getitemcount Coal set silverorecount to player.getitemcount gem0silvernugget set goldorecount to player.getitemcount gem0goldnugget set crystaliteorecount to player.getitemcount crystaliteore set ebonyorecount to player.getitemcount EbonOre set chance to 1 + 0.3*getrandompercent set armorerskill to player.getactorvalue armorer + chance set copperbarsmade to copperorecount/2 && coalcount set copperremoved to copperbarsmade*2 set coalremoved to copperbarsmade set bronzebarsmade to copperorecount/2 && tinorecount/2 set copperremoved to copperbarsmade*2 set tinremoved to copperbarsmade set ironbarsmade to ironorecount/2 && coalcount/2 set ironremoved to ironbarsmade*2 set coalremoved1 to ironbarsmade*2 set steelbarsmade to pureironorecount/2 && coalcount/3 set pureironremoved to steelbarsmade*2 set coalremoved2 to steelbarsmade*3 set mithrilbarsmade to mithrilorecount/2 && coalcount/3 set mithrilremoved to mithrilbarsmade*2 set coalremoved3 to mithrilbarsmade*3 set crystalitebarsmade to crystaliteorecount/2 && coalcount/3 set crystaliteremoved to crystalitebarsmade*2 set coalremoved7 to crystalitebarsmade*3 set ebonybarsmade to ebonyorecount/2 && coalcount/3 set ebonyremoved to ebonybarsmade*2 set coalremoved3 to ebonybarsmade*3 set dwarvenbarsmade to dwarfiteorecount/2 && coalcount/3 set dwarvenremoved to dwarvenbarsmade*2 set coalremoved4 to dwarvenbarsmade*3 set ayliitebarsmade to ayliiteorecount*/2 && coalcount/3 set ayliiteremoved to ayliitebarsmade*2 set coalremoved5 to ayliitebarsmade*3 set daedricbarsmade to daedriteorecount/3 && coalcount/5 set daedriteremoved to daedricbarsmade*3 set coalremoved6 to daedricbarsmade*5 if (menulevel == 1) set menulevel to 0 set button to getbuttonpressed if (button > -1) if (button == 0 && ironbarsmade > 0) if (armorerskill >= 10) player.removeitem IroneOre ironremoved player.removeitem Coal coalremoved1 playsound splfireballfail player.additem IronBar ironbarsmade message "Smelting succeed." else player.removeitem IroneOre ironremoved player.removeitem Coal coalremoved1 playsound splpoisonhit message "Smelting failed." endif elseif (button == 1 && copperbarsmade > 0) if (armorerskill >= 1) player.removeitem CopperOre copperremoved player.removeitem Coal coalremoved playsound splfireballfail player.additem CopperBar copperbarsmade message "Smelting succeed." else player.removeitem CopperOre copperremoved player.removeitem Coal coalremoved playsound splpoisonhit message "Smelting failed." endif elseif (button == 2 && bronzebarsmade > 0) if (armorerskill >= 5) player.removeitem CopperOre copperremoved player.removeitem TinOre tinremoved playsound splfireballfail player.additem BronzeBar bronzebarsmade message "Smelting succeed." else player.removeitem CopperOre copperremoved player.removeitem TinOre tinremoved playsound splpoisonhit message "Smelting failed." endif elseif (button == 3 && steelbarsmade > 0) if (armorerskill >= 15) player.removeitem PureIronOre pureironremoved player.removeitem Coal coalremoved2 playsound splfireballfail player.additem SteelBar steelbarsmade message "Smelting succeed." else player.removeitem PureIronOre pureironremoved player.removeitem Coal coalremoved2 playsound splpoisonhit message "Smelting failed." endif elseif (button == 4 && ayliitebarsmade > 0) if (armorerskill >= 25) player.removeitem AyliiteOre ayliiteremoved player.removeitem Coal coalremoved5 playsound splfireballfail player.additem AyliiteBar ayliitebarsmade message "Smelting succeed." else player.removeitem AyliiteOre ayliiteremoved player.removeitem Coal coalremoved5 playsound splpoisonhit message "Smelting failed." endif elseif (button == 5 && dwarvenbarsmade > 0) if (armorerskill >= 30) player.removeitem DwarfiteOre dwarvenremoved player.removeitem Coal coalremoved4 playsound splfireballfail player.additem DwarvenBar dwarvenbarsmade message "Smelting succeed." else player.removeitem DwarfiteOre dwarvenremoved player.removeitem Coal coalremoved4 playsound splpoisonhit message "Smelting failed." endif elseif (button == 6 && mithrilbarsmade > 0) if (armorerskill >= 35) player.removeitem MithrilOre mithrilremoved player.removeitem Coal coalremoved3 playsound splfireballfail player.additem MithrilBar mithrilbarsmade message "Smelting succeed." else player.removeitem MithrilOre mithrilremoved player.removeitem Coal coalremoved3 playsound splpoisonhit message "Smelting failed." endif elseif (button == 7 && crystalitebarsmade > 0) if (armorerskill >= 45) player.removeitem CrystaliteOre crystaliteremoved player.removeitem Coal coalremoved7 playsound splfireballfail player.additem CrystaliteBar crystalitebarsmade message "Smelting succeed." else player.removeitem CrystaliteOre Crystaliteremoved player.removeitem Coal coalremoved7 playsound splpoisonhit message "Smelting failed." endif elseif (button == 8 && ebonybarsmade > 0) if (armorerskill >= 55) player.removeitem EbonOre ebonyremoved player.removeitem Coal coalremoved8 playsound splfireballfail player.additem EbonyBar Ebonybarsmade message "Smelting succeed." else player.removeitem EbonOre ebonyremoved player.removeitem Coal coalremoved8 playsound splpoisonhit message "Smelting failed." endif elseif (button == 9 && daedricbarsmade > 0) if (armorerskill >= 70) player.removeitem DaedriteOre daedriteremoved player.removeitem Coal coalremoved6 playsound splfireballfail player.additem DaedricBar daedricbarsmade message "Smelting succeed." else player.removeitem DaedriteOre daedriteremoved player.removeitem Coal coalremoved6 playsound splpoisonhit message "Smelting failed." endif else message "Smelting failed. Not enough raw materials." endif endif endif end Link to comment Share on other sites More sharing options...
fg109 Posted July 8, 2011 Share Posted July 8, 2011 (edited) I changed your script so that it would be shorter. It's not complete but you should be able to test it. Try it out: ScriptName RaivenSmelt ref material1 ref material2 ref product short smelt short menulevel short button short matcost1 short matcost2 short matcount1 short matcount2 short productcount short skillreq short armorerskill Begin OnActivate if (player.getequipped LowerShirt01) set menulevel to 1 else Message "Not wearing suitable gear." endif end Begin GameMode if (menulevel == 0) && (smelt == 0) Return elseif (menulevel == 1) set menulevel to -1 MessageBoxEX "What type of bar would you like to create?" "Iron" "Copper" "Bronze" "Steel" "Ayliite" "Dwarven" "Mithril" "Crystalite" "Next >" "Cancel" elseif (menulevel == 2) set menulevel to -2 MessageBoxEX "What type of bar would you like to create?" "Ebony" "Daedrite" "< Back" "Cancel" endif if (menulevel == -1) set button to GetButtonPressed if (button < 0) Return elseif (button == 8) set menulevel to 2 Return elseif (button == 9) Message "Smithing cancelled." set menulevel to 0 Return elseif (button == 0) set material1 to IronOre set material2 to Coal set matcost1 to 2 set matcost2 to 2 set product to IronBar set skillreq to 10 elseif (button == 1) set material1 to CopperOre set material2 to Coal set matcost1 to 2 set matcost2 to 1 set product to CopperBar set skillreq to 1 elseif (button == 2) set material1 to CopperOre set material2 to TinOre set matcost1 to 2 set matcost2 to 2 set product to BronzeBar set skillreq to 5 elseif (button == 3) ; ... endif set smelt to 1 set menulevel to 0 endif if (menulevel == -2) set button to GetButtonPressed if (button < 0) Return elseif (button == 2) set menulevel to 1 Return elseif (button == 3) Message "Smithing cancelled." set menulevel to 0 Return elseif (button == 0) set material1 to EbonOre set material2 to Coal set matcost1 to 2 set matcost2 to 3 set product to EbonyBar set skillreq to 55 elseif (button == 1) set material1 to DaedriteOre set material2 to Coal set matcost1 to 3 set matcost2 to 5 set product to DaedricBar set skillreq to 70 endif set smelt to 1 set menulevel to 0 endif if (smelt == 1) set armorerskill to player.getactorvalue armorer + (0.3 * GetRandomPercent) + 1 set matcount1 to Player.GetItemCount material1 set matcount2 to Player.GetItemCount material2 set productcount to (matcount1 / matcost1) if (productcount > (matcount2 / matcost2)) set productcount to (matcount2 / matcost2) endif set matcount1 to productcount * matcost1 set matcount2 to productcount * matcost2 if (productcount == 0) Message "Smelting failed. Not enough raw materials." elseif (armorerskill < skillreq) Player.RemoveItem material1 matcost1 Player.RemoveItem material2 matcost2 Message "Smelting failed." else Player.RemoveItem material1 matcost1 Player.RemoveItem material2 matcost2 Player.AddItem product productcount Message "Smelting succeeded." endif set smelt to 0 endif End If that still doesn't work... try this to see if you actually can activate it. ScriptName RaivenSmelt Begin OnActivate Message "I was activated!" end Edited July 8, 2011 by fg109 Link to comment Share on other sites More sharing options...
bencebence Posted July 8, 2011 Author Share Posted July 8, 2011 I can't save it. It tells me that "Unkown variable 'Iron' for parameter variable'." Link to comment Share on other sites More sharing options...
fg109 Posted July 8, 2011 Share Posted July 8, 2011 (edited) That's weird... "Iron" only shows up in 3 places in that script I posted. 1. The Message Box2. As part of "IronOre"3. As part of "IronBar" None of those should have caused that error. EDIT: Nevermind. I just noticed that I used MessageBoxEX instead of MessageBox. (I wrote it with OBSE functions and tried to change it back). Here, use this corrected one: ScriptName RaivenSmelt ref material1 ref material2 ref product short smelt short menulevel short button short matcost1 short matcost2 short matcount1 short matcount2 short productcount short skillreq short armorerskill Begin OnActivate if (player.getequipped LowerShirt01) set menulevel to 1 else Message "Not wearing suitable gear." endif end Begin GameMode if (menulevel == 0) && (smelt == 0) Return elseif (menulevel == 1) set menulevel to -1 MessageBox "What type of bar would you like to create?" "Iron" "Copper" "Bronze" "Steel" "Ayliite" "Dwarven" "Mithril" "Crystalite" "Next >" "Cancel" elseif (menulevel == 2) set menulevel to -2 MessageBox "What type of bar would you like to create?" "Ebony" "Daedrite" "< Back" "Cancel" endif if (menulevel == -1) set button to GetButtonPressed if (button < 0) Return elseif (button == 8) set menulevel to 2 Return elseif (button == 9) Message "Smithing cancelled." set menulevel to 0 Return elseif (button == 0) set material1 to IronOre set material2 to Coal set matcost1 to 2 set matcost2 to 2 set product to IronBar set skillreq to 10 elseif (button == 1) set material1 to CopperOre set material2 to Coal set matcost1 to 2 set matcost2 to 1 set product to CopperBar set skillreq to 1 elseif (button == 2) set material1 to CopperOre set material2 to TinOre set matcost1 to 2 set matcost2 to 2 set product to BronzeBar set skillreq to 5 elseif (button == 3) ; ... endif set smelt to 1 set menulevel to 0 endif if (menulevel == -2) set button to GetButtonPressed if (button < 0) Return elseif (button == 2) set menulevel to 1 Return elseif (button == 3) Message "Smithing cancelled." set menulevel to 0 Return elseif (button == 0) set material1 to EbonOre set material2 to Coal set matcost1 to 2 set matcost2 to 3 set product to EbonyBar set skillreq to 55 elseif (button == 1) set material1 to DaedriteOre set material2 to Coal set matcost1 to 3 set matcost2 to 5 set product to DaedricBar set skillreq to 70 endif set smelt to 1 set menulevel to 0 endif if (smelt == 1) set armorerskill to player.getactorvalue armorer + (0.3 * GetRandomPercent) + 1 set matcount1 to Player.GetItemCount material1 set matcount2 to Player.GetItemCount material2 set productcount to (matcount1 / matcost1) if (productcount > (matcount2 / matcost2)) set productcount to (matcount2 / matcost2) endif set matcost1 to productcount * matcost1 set matcost2 to productcount * matcost2 if (productcount == 0) Message "Smelting failed. Not enough raw materials." elseif (armorerskill < skillreq) Player.RemoveItem material1 matcost1 Player.RemoveItem material2 matcost2 Message "Smelting failed." else Player.RemoveItem material1 matcost1 Player.RemoveItem material2 matcost2 Player.AddItem product productcount Message "Smelting succeeded." endif set smelt to 0 endif End Edited July 8, 2011 by fg109 Link to comment Share on other sites More sharing options...
bencebence Posted July 8, 2011 Author Share Posted July 8, 2011 (edited) It tells me that the message box line is wrong.EDIT: I've removed the EX from the end of MessageBoy, and it could be saved. Edited July 8, 2011 by bencebence Link to comment Share on other sites More sharing options...
fg109 Posted July 8, 2011 Share Posted July 8, 2011 I made some mistakes in that script and I fixed them just now. Link to comment Share on other sites More sharing options...
bencebence Posted July 8, 2011 Author Share Posted July 8, 2011 Hey thanks man! It works like charm. I have to edit 2 small things (2 copper ore and 1 coal makes 3 copper bar and the other one is that steel has to use pure iron ore) but anyways it's cool! Thank you were much, you helped a lot with this. Link to comment Share on other sites More sharing options...
fg109 Posted July 8, 2011 Share Posted July 8, 2011 If steel only uses iron ore, then I guess you can set both material1 and material2 to iron ore, while setting matcost1 and matcost2 to half what you need. Link to comment Share on other sites More sharing options...
bencebence Posted July 8, 2011 Author Share Posted July 8, 2011 Steel uses 3 coal and 2 pure iron. But still, what shall I do with copper? It makes 3 bars from the normal ores. Link to comment Share on other sites More sharing options...
fg109 Posted July 8, 2011 Share Posted July 8, 2011 (edited) You might have to create a new variable. For example ... short productmult Begin OnActivate set productmult to 1 if (player.getequipped LowerShirt01) set menulevel to 1 else Message "Not wearing suitable gear." endif end Begin GameMode ... elseif (button == 1) set material1 to CopperOre set material2 to Coal set matcost1 to 2 set matcost2 to 1 set product to CopperBar set productmult to 3 set skillreq to 1 ... set matcost1 to productcount * matcost1 set matcost2 to productcount * matcost2 set productcount to productcount * productmult if (productcount == 0) Message "Smelting failed. Not enough raw materials." ... End So the default product multiplier is 1. Edited July 8, 2011 by fg109 Link to comment Share on other sites More sharing options...
Recommended Posts