I'm working on a modified atronach forge that takes Azura's Star/The Black Star as sigil-esque upgrades with their own recipes. Fortunately, the forge side of things work.
I modified the sigil stone script to pull up a message box whenever the player has the sigil stone and one or both of the stars in their inventory. Should the player only have one of them in their inventory, that stone is placed automatically (a la the paragon portal script).
I have two problems:
1. The "automatically place one stone" portion doesn't work, and once I try to activate the pedestal with only one stone, the pedestal is unusable.
2. Should I have multiple stones in my inventory, placing either Azura's Star or the Black Star results in me being unable to retrive them (they are not removed from my inventory, either). The sigil stone works fine.
I've been through both scripts and all the properties multiple times... I just can't figure out the issue. Any help would be appreciated.
The first script is the problem script. The second script, the forge script, works fine. At the bottom I've included a link to the mod in its current state with scripts, in case that's easier to look at for anyone.
Thank you for any help!
Sigil Stone Script
Scriptname AtrFrgSigilStoneScript extends ObjectReference Hidden objectReference property sigilStoneREF autoObjectReference Property azuradarkref Auto ObjectReference Property azuraliteref Auto AtronachForgeSCRIPT property Forge auto ; List of stones the player can place in the slotForm Property sigilstone AutoForm Property DA01SoulGemAzurasStar AutoForm Property DA01SoulGemBlackStar Auto FormList Property AtrFrgStoneList Auto{Contains all the possible stones so we can easily count them on the player.} Message Property AtrFrgStonePlaceMessage Auto{Message containing the options for the player to place whichever stone he wants.}Message Property AtrFrgStonePlaceMessageDENIED Auto{Message telling the player he doesn't have any stones... haha} Form CurrentlyPlacedAtrFrgStone Int MessageOption auto State WaitingForPlacementEvent OnActivate(ObjectReference akActionRef)if akActionRef == Game.GetPlayer() GoToState("BusyState") ; Player has no stones, let him knowif (Game.GetPlayer().GetItemCount(AtrFrgStoneList) == 0)AtrFrgStonePlaceMessageDENIED.Show()GoToState("WaitingForPlacement") ; Player has only one stone, just put it in the slotelseif (Game.GetPlayer().GetItemCount(AtrFrgStoneList) == 1) if (Game.GetPlayer().GetItemCount(DA01SoulGemAzurasStar) == 1)Game.GetPlayer().RemoveItem(DA01SoulGemAzurasStar, 1)Forge.DA01SoulGemAzurasStarInstalled = TRUEazuraliteref.enable()CurrentlyPlacedAtrFrgStone = DA01SoulGemAzurasStarGoToState("WaitingForPickup") elseif (Game.GetPlayer().GetItemCount(DA01SoulGemBlackStar) == 1)Game.GetPlayer().RemoveItem(DA01SoulGemBlackStar, 1)Forge.DA01SoulGemBlackStarInstalled = TRUEazuradarkref.enable()CurrentlyPlacedAtrFrgStone = DA01SoulGemBlackStarGoToState("WaitingForPickup") elseif (Game.GetPlayer().GetItemCount(sigilStone) == 1)Game.GetPlayer().RemoveItem(sigilStone, 1)Forge.sigilStoneInstalled = TRUEsigilStoneREF.enable()CurrentlyPlacedAtrFrgStone = sigilStoneGoToState("WaitingForPickup")endif ; Player has more than one stone, ask him which he wants to placeelseif (Game.GetPlayer().GetItemCount(AtrFrgStoneList) > 1) MessageOption = AtrFrgStonePlaceMessage.Show() ; SigilStoneif (MessageOption == 0)Game.GetPlayer().RemoveItem(SigilStone, 1)Forge.sigilStoneInstalled = TRUEsigilStoneREF.enable()CurrentlyPlacedAtrFrgStone = SigilStoneGoToState("WaitingForPickup") ; Azura's Starelseif (MessageOption == 1)Game.GetPlayer().RemoveItem(DA01SoulGemAzurasStar, 1)Forge.DA01SoulGemAzurasStarInstalled = TRUEazuraliteref.enable()CurrentlyPlacedAtrFrgStone = DA01SoulGemAzurasStarGoToState("WaitingForPickup") ; Black Starelseif (MessageOption == 2)Game.GetPlayer().RemoveItem(DA01SoulGemBlackStar, 1)Forge.DA01SoulGemBlackStarInstalled = TRUEazuradarkref.enable()CurrentlyPlacedAtrFrgStone = DA01SoulGemBlackStarGoToState("WaitingForPickup") ; Do Nothingelseif (MessageOption == 3)GoToState("WaitingForPlacement") endif endif endifEndEventEndState State WaitingForPickupEvent OnActivate(ObjectReference akActionRef)if akActionRef == Game.GetPlayer() GoToState("BusyState") if (CurrentlyPlacedAtrFrgStone == SigilStone)Forge.sigilStoneInstalled = FALSE sigilStoneREF.disable()Game.GetPlayer().AddItem(SigilStone, 1)CurrentlyPlacedAtrFrgStone = NONEGoToState("WaitingForPlacement") elseif (CurrentlyPlacedAtrFrgStone == DA01SoulGemAzurasStar)Forge.DA01SoulGemAzurasStarInstalled = FALSEazuraliteref.disable()Game.GetPlayer().AddItem(DA01SoulGemAzurasStar, 1)CurrentlyPlacedAtrFrgStone = NONEGoToState("WaitingForPlacement") elseif (CurrentlyPlacedAtrFrgStone == DA01SoulGemBlackStar)Forge.DA01SoulGemBlackStarInstalled = FALSEazuradarkref.disable()Game.GetPlayer().AddItem(DA01SoulGemBlackStar, 1)CurrentlyPlacedAtrFrgStone = NONEGoToState("WaitingForPlacement")endif endifEndEventEndState ; State we put ourselves in when we're busy (animationing and whatnot)State BusyStateEvent OnActivate(ObjectReference akActionRef)if akActionRef == Game.GetPlayer(); Do NothingendifEndEventEndState
scriptname AtronachForgeSCRIPT extends objectReference formlist property RecipeList auto{Master list of valid recipes. Most Complex should be first}formlist property ResultList auto{Master list of recipe results. Indices of Rewards MUST MATCH those of the recipe list}formlist property SigilRecipeList auto{Recipes that are only available when sigil stone is installed}formlist property SigilResultList auto{Items attainable only with sigil stone installed}formlist property AzuraLiteRecipeList auto{Recipes that are only available when Azura's Star is installed}formlist property AzuraLiteResultList auto{Items attainable only with Azura's Star installed}formlist property AzuraDarkRecipeList auto{Recipes that are only available when Dark Star is installed}formlist property AzuraDarkResultList auto{Items attainable only with Dark Star installed}objectReference property createPoint auto{Marker where we place created items}objectReference property DropBox auto{where the player places items to be crafted}activator property summonFX auto{Point to a fake summoning cloud activator}objectReference property summonFXpoint auto{Where we place the summoning FX cloud}bool property sigilStoneInstalled auto hidden{has the sigil stone been installed?}bool property DA01SoulGemAzurasStarInstalled auto hidden{has azura's star been installed?}bool property DA01SoulGemBlackStarInstalled auto hidden{has the dark star been installed?}objectReference property lastSummonedObject auto hidden; store whatever we summoned last time to help clean up dead references. STATE busyEVENT onActivate(objectReference actronaut); debug.trace("Atronach Forge is currently busy. Try again later")endEVENTendSTATE auto STATE readyEVENT onActivate(objectReference actronaut) gotoState("busy")bool DaedricItemCrafted ; first attempt to craft Daedric items if the Sigil Stone is installed; debug.trace("Atronach Forge checking for Sigil Stone")if sigilStoneInstalled == TRUE; debug.trace("Atronach Forge detected Sigil Stone, attempt Daedric Combines first")DaedricItemCrafted = scanForRecipes(SigilRecipeList, SigilResultList)utility.wait(0.1)endif ; if no sigil stone, or if we checked and found no valid Daedric recipes, but Azura's Star is installed...if DA01SoulGemAzurasStarInstalled == TRUE; debug.trace("Atronach Forge Either did not detect Sigil Stone, Dark Star, or no deadric combines were found. Did detect Azura's Star")ScanForRecipes(AzuraLiteRecipeList, AzuraLiteResultList)endif ; if no sigil stone, or if we checked and found no valid Daedric recipes, but Dark Star is installed...if DA01SoulGemBlackStarInstalled == TRUE; debug.trace("Atronach Forge Either did not detect Sigil Stone, Dark Star, or no deadric combines were found. Did detect Dark Star")ScanForRecipes(AzuraDarkRecipeList, AzuraDarkResultList)endif ; if no sigil stone, Azura's Star, Dark Star, or if we checked and found no valid Daedric recipes...if sigilStoneInstalled == FALSE || DaedricItemCrafted == FALSE || DA01SoulGemAzurasStarInstalled == FALSE || DA01SoulGemBlackStarInstalled == FALSE; debug.trace("Atronach Forge Either did not detect Sigil Stone, Azura's Star, Dark Star, or no deadric combines were found")ScanForRecipes(RecipeList, ResultList)endif gotoState("ready") endEVENTendSTATE bool FUNCTION ScanForRecipes(formlist Recipes, formList Results) ; set up our counter varsint i = 0int t = Recipes.getSize()bool foundCombine = FALSEbool checking = TRUE ;======================================================== While checking == TRUE && i < tformlist currentRecipe = (Recipes.getAt(i)) as formListif currentRecipe == NONE; debug.trace("ERROR: Atronach Forge trying to check a NONE recipe")elseif scanSubList(currentRecipe) == TRUE; I have found a valid recipe; debug.trace("Atronach Forge found ingredients for "+currentRecipe)removeIngredients(currentRecipe)foundCombine = TRUEchecking = FALSEelse; found nothingendifendif if foundCombine == FALSE; only increment if we are continuing to loopi += 1endif endWhile if foundCombine == TRUE; we found a valid item, so create it!; debug.trace("Attempting to spawn a "+Results.getAt(i))summonFXpoint.placeatme(summonFX);summonFX.playGamebryoAnimation("mIdle")utility.wait(0.33)objectReference newREF = createPoint.placeAtMe(Results.getAt(i)) ; if the last thing I summoned is a dead actor, just get rid of it.if (lastSummonedObject)if ((lastSummonedObject as actor).isDead()); transfer any items to the offering box (just in case I had anything valuable on me!)lastSummonedObject.RemoveAllItems(DropBox, FALSE, TRUE)lastSummonedObject.disable()lastSummonedObject.delete()endifendif ; now store whatever we just created as the current/last summoned objectlastSummonedObject = newREF if (newREF as actor) != NONE(newREF as actor).startCombat(game.getPlayer())endif return TRUEelse; did not find any valid combines - choose a "failure" scenarioreturn FALSEendif endFUNCTION;========================================================;========================================================;========================================================bool FUNCTION scanSubList(formList recipe)int size = recipe.getSize()int cnt = 0while cnt < sizeform toCheck = recipe.getAt(cnt)if dropBox.getItemCount(toCheck) < 1; ;debug.trace("Did not have item "+toCheck+" ("+cnt+") for recipe #"+recipe)return FALSEelse; ;debug.trace("I Have item "+toCheck+" ("+cnt+") for recipe #"+recipe); we have the item in cntendifcnt += 1endWhile return TRUE endFUNCTION FUNCTION removeIngredients(formlist recipe)int size = recipe.getSize()int cnt = 0while cnt < sizeform toCheck = recipe.getAt(cnt)dropBox.removeItem(toCheck, 1); debug.trace("Atronach Forge is consuming "+toCheck)cnt += 1endWhileendFUNCTION
http://www.mediafire.com/?r71mxbiw11h1x5o