antstubell Posted July 30, 2019 Author Share Posted July 30, 2019 (edited) And EDIT:Nope got issues. Your script...(66,0): mismatched input 'EndEvent' expecting ENDFUNCTION Edited July 30, 2019 by antstubell Link to comment Share on other sites More sharing options...
antstubell Posted July 30, 2019 Author Share Posted July 30, 2019 I am testing your script and mine, I noted an error in yours in previous post.Mine is like this.... GlobalVariable Property FlintUseCount AutoGlobalVariable Property FlintInUse AutoGlobalVariable Property FireULock AutoLight Property MyTorch AutoSound Property MySFX AutoMiscObject Property EmptyBottle AutoMiscObject Property Oil AutoMiscObject Property Rag AutoMiscObject Property Bristle AutoMiscObject Property Flint AutoMessage Property EquipTorch AutoMessage Property KindAccList AutoMessage Property NeedKindAcc AutoMessage Property NeedIgnite AutoMessage Property FlintOrTorch AutoObjectReference Property MyMarker AutoFunction CombustibleList(); inventory check to see if player has NONE of the required items – add to as neededif (Game.GetPlayer().GetItemCount(Rag) < 1) && (Game.GetPlayer().GetItemCount(Oil) < 1) && (Game.GetPlayer().GetItemCount(Bristle) < 1)NeedKindAcc.Show(); inventory check to see if player has at least 1 of any combustible itemelseIf (Game.GetPlayer().GetItemCount(Rag) >= 1) || (Game.GetPlayer().GetItemCount(Oil) >= 1) || (Game.GetPlayer().GetItemCount(Bristle) >= 1)Int iButtonB = KindAccList.Show(); show combustible items menuIf iButtonB == 0Game.GetPlayer().RemoveItem(Rag, 1) ; remove 1 dry ragEndIfIf iButtonB == 1Game.GetPlayer().RemoveItem(Oil, 1, TRUE) ; silently remove 1 oilGame.GetPlayer().AddItem(EmptyBottle, 1, TRUE) ; silently add empty bottledebug.notification("Oil Removed")EndIfIf iButtonB == 2Game.GetPlayer().RemoveItem(Bristle, 1) ; remove 1 bristleEndIfEndifEndFunctionFunction LightFire()If FlintInUse.GetValue() == 1MySFX.Play(Self) ; if player chose flint then play flint ignition soundFlintInUse.SetValue(0); resets variable for futire useEndifFireULock.SetValue(1); sets value for next part of the puzzle i.e. “the fire is lit, what is next?”Utility.Wait(1.5); allow time for sfx to finishMyMarker.Disable() ; actually show fire lightSelf.Disable()Utility.Wait(0.5)Self.Delete()EndFunctionAuto State WaitingEvent OnActivate(ObjectReference akActionRef)if (Game.GetPlayer().GetItemCount(MyTorch) < 1) && (Game.GetPlayer().GetItemCount(Flint) < 1)NeedIgnite.Show(); player has no ignite sourceelseInt iButtonA = FlintOrTorch.Show(); show ignition source menu; menu is shown with available ignite sources based on conditions set in message formIf iButtonA == 0 && (Game.GetPlayer().GetEquippedItemType(0) != 11)EquipTorch.Show(); show equip torch messageGoToState("Waiting") ; After the Message Above will EXIT to be activated againelseIf iButtonA == 0 && (Game.GetPlayer().GetEquippedItemType(0) == 11)CombustibleList()LightFire()elseIf iButtonA == 1 && (Game.GetPlayer().GetItemCount(Flint) > 0)FlintUseCount.Mod(1); counts how many times this piece of flint has been usedFlintInUse.SetValue(1); flint is GOING TO BE USED – needed for condition later onCombustibleList()LightFire()EndIfEndIfEndEventEndState Has issue that if player has no combustible items lights fire anyway. Link to comment Share on other sites More sharing options...
maxarturo Posted July 30, 2019 Share Posted July 30, 2019 (edited) Glad you could made it work by yourself !, and sorry for taking me so much time to actually understand what you wanted the script to do... * The last script i posted is been rectified. Typo double written. * "Has issue that if player has no combustible items lights fire anyway." That's impossible, if no item WILL EXIT. If Game.GetPlayer().GetItemCount(Rag) > 0 Game.GetPlayer().RemoveItem(Rag, 1) Debug.Notification ("Option 0, 1 Dry Rag remove") LitFire() ; If this option is choose will go to execute the enable/disable - play - delete - etc.. "Function LitFire()" Else Debug.Notification ("You don't have Rag") GoToState("Waiting") ; Will EXIT if there is no item EndIf Edited July 30, 2019 by maxarturo Link to comment Share on other sites More sharing options...
maxarturo Posted July 30, 2019 Share Posted July 30, 2019 (edited) The Script has been compiled and tested. - I made 2 "Message MENUS". One for "Torch or Flint" and One for the 3 "Combastable Items". - 3 Messages for when items are remove. - And 5 "No Item in Inventory" messages. One for each ITEM. And is doing exactly what you want it to do. * I did not use your properties, but i made my own PROPERTIES to match everything as the script is made. * In the posted version i use " Debug.Notification () " so you can arrange your own messages. Edited July 30, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted July 31, 2019 Author Share Posted July 31, 2019 Does not show "Equip Torch" message and continues without MAKING the player equip a torch.This line... If Game.GetPlayer().GetEquippedItemType(0) != 11 MyCombustibleMenu() ; Goes to the choose combastion items MENU if TORCH is equiped "MyCombustibleMenu()" Does the opposite of the description. It says 'If torch is NOT equipped then continue.Should be... If Game.GetPlayer().GetEquippedItemType(0) == 11 MyCombustibleMenu() ; Goes to the choose combastion items MENU if TORCH is equiped "MyCombustibleMenu()" If torch IS equipped then continue. ANYWAY.....This is the definitive version of the script, trimmed off 'the fat', tested it quite a bit and every possible option (has no ignite source, has torch, has flint, has torch and flint, has no combustibles, has some combustibles, has all available combustibles) are covered.Thanks a million for your help, I couldn't have done it without you, plus it helped me write 2 or 3 other similar scripts while we were battling this one. GlobalVariable Property FlintUseCount AutoGlobalVariable Property FireULock AutoGlobalVariable Property FlintInUse AutoLight Property MyTorch AutoSound Property MySFX AutoMiscObject Property Oil AutoMiscObject Property EmptyBottle AutoMiscObject Property Rag AutoMiscObject Property Bristle AutoMiscObject Property Flint AutoMessage Property EquipTorch AutoMessage Property CombustMenu AutoMessage Property NeedKindAcc AutoMessage Property NeedIgnite AutoMessage Property FlintOrTorch AutoMessage Property ReqItemsMsg AutoMessage Property NoReqIgniteItems AutoObjectReference Property MyMarker AutoAuto State WaitingEvent OnActivate(ObjectReference akActionRef)if (akActionRef == Game.GetPlayer())if (Game.GetPlayer().GetItemCount(MyTorch) > 0) || (Game.GetPlayer().GetItemCount(Flint) > 0)MyIgnitesItem() ; If player has ignition source will go to "MyIgnitesItem()"elseNoReqIgniteItems.Show() ; no ignition sourceGoToState("Waiting")EndifEndifEndEventEndStateState BusyEvent OnActivate(ObjectReference akActionRef);Do nothing.EndEventEndStateFunction MyIgnitesItem()GoToState("Busy")Int iButtonA = FlintOrTorch.Show()If iButtonA == 0If Game.GetPlayer().GetEquippedItemType(0) == 11MyCombustibleMenu() ; Goes to the choose combustion items MENU if TORCH is equipped "MyCombustibleMenu()"elseEquipTorch.Show(); If Torch is NOT EQUIPED, Player should "Equip the Torch" Message will showGoToState("Waiting"); After the Message Above will EXIT to be activated againEndIfEndIfIf iButtonA == 1If Game.GetPlayer().GetItemCount(Flint) > 0FlintInUse.SetValue(1); sets variable for Flint sfx to play IF lighting fire succeedsDebug.Notification ("Using Flint To Light Fire")MyCombustibleMenu() ; player chose flint and has flint so goes to combustible items menuEndIfEndIfEndFunctionFunction MyCombustibleMenu()Int iButtonB = CombustMenu.Show()If iButtonB == 0Game.GetPlayer().RemoveItem(Rag, 1, TRUE)debug.notification("Rag Used As Kindling")LitFire() ; If this option is choose will go to "Function LitFire()"EndIfIf iButtonB == 1Game.GetPlayer().RemoveItem(Oil, 1, TRUE)Game.GetPlayer().AddItem(EmptyBottle, 1, TRUE)debug.notification("Oil used as accelerant")LitFire() ; If this option is choose will go to "Function LitFire()"EndIfIf iButtonB == 2Game.GetPlayer().RemoveItem(Bristle, 1, TRUE)debug.notification("Bristles Used As Kindling")LitFire() ; If this option is choose will go to "Function LitFire()"EndIfif (Game.GetPlayer().GetItemCount(Rag) < 1) && (Game.GetPlayer().GetItemCount(Oil) < 1) &&(Game.GetPlayer().GetItemCount(Bristle) < 1)FlintInUse.SetValue(0); resets variable for Flint sfx to play because lighting fire was unsuccessfulNeedKindAcc.show()EndifGoToState("Waiting")EndFunctionFunction LitFire(); Do Stuff HereIf FlintInUse.GetValue() == 1MySFX.Play(Self) ; if player chose flint then play flint ignition soundFlintInUse.SetValue(0); resets variable for future useFlintUseCount.Mod(1) ; counting how many times this piece of flint has been usedEndifFireULock.SetValue(1); sets value for next part of the puzzle i.e. “the fire is lit, what is next?”Utility.Wait(1.5); allow time for sfx to finishMyMarker.Disable() ; actually show fire lightSelf.Disable()Utility.Wait(0.5)Self.Delete()EndFunction Link to comment Share on other sites More sharing options...
maxarturo Posted July 31, 2019 Share Posted July 31, 2019 (edited) Congrats !. But now that you are done with it i have a confession to make that you'll hate me or curse me for it. In the Final Script i intentionally threw in 2 mistakes an "EndState" intead of "EndEvent" and i didn't change one operator (my initial thought was to change all operators but i didn't, cause i didn't want to make your head explode), just to force you to search for it and give your best to try and make it work. I really hope that all of this helped you advance - level up your Scripting abilitys and that you now have a better and deeper understanding of how scripts works and are made. (remember ORDER). Please don't hate me for it... and keep on pressing forwards !. Have a happy modding !. Edited July 31, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted July 31, 2019 Author Share Posted July 31, 2019 I don't hate you for it, I just thought you were pretty dumb. LOLSeriously, I thought at times "There's some s**t here that has no reason being here.". Hence my quote in my previous post "trimmed off the fat."Sifting through the script took me back to, wait for it - this will show my age now, when I used to program in BASIC (Beginners All-Purpose Symbolic Instruction Code). This was the language used by Atari Pcs. Yes Atari PCs, I had the 800XL with a whopping 64k, that's K not MB or GB of ram. I programmed the hell out of it until I repeatedly got the message 'Out of system memory' for what I was doing. The 'function' in papyrus is the same as 'gosub' (go sub-routine) in BASIC.So it has been a re-learning curve, you ain't as dumb as I thought you were and neither am I. :thumbsup: Link to comment Share on other sites More sharing options...
maxarturo Posted July 31, 2019 Share Posted July 31, 2019 Flashback... i'm also a Spectrum child, 16 kb memory... that's sounds now so unreal !. Link to comment Share on other sites More sharing options...
antstubell Posted July 31, 2019 Author Share Posted July 31, 2019 Unreal? Programs/games were saved/loaded on audio cassettes. Floppy disc drive was WAY too expensive. Link to comment Share on other sites More sharing options...
Evangela Posted August 1, 2019 Share Posted August 1, 2019 I ain't that old but I remember having those discs was something to brag about with the 1.44mb space. Now a 50gig Blueray isn't enough lol. Link to comment Share on other sites More sharing options...
Recommended Posts