maxarturo Posted July 28, 2019 Share Posted July 28, 2019 This is exactly what this line does. The message needs to be a stand alone and not a part of a menu, this is common logic. If iButtonA == 0 If (Game.GetPlayer().GetEquippedItemType(0) != 11) LitFire() ; If Torch is equip, Now will go to execute the enable/disable - play - delete - etc.. "Function LitFire()" else EquipTorch.Show() ; If Torch is not equip, Player should Equip the Torch Message will show GoToState("Waiting") ; After the Message and If the torch is not eqipped will RETURN to be activated again EndIf EndIf Don't you read the descriptions beside them ?, Link to comment Share on other sites More sharing options...
antstubell Posted July 29, 2019 Author Share Posted July 29, 2019 Ok, made a few changes. I didn't explain something. Whichever source of ignition the player chooses, torch or flint, the script, in both cases, should go to the combustible items menu - Rage, Oil and Bristles. Logs won't spontaneously ignite by holding a torch to them (well they could but would take forever). I believe I fixed this by 'sending' the script to the correct function...MyRagIgnitesFire() instead ofLitFire()See attached scriptStill the fire lights if the player doesn't equip a torch.https://onedrive.live.com/?cid=B60C11D037429D8E&id=B60C11D037429D8E%2134445&parId=B60C11D037429D8E%21191&o=OneUp If iButtonA == 0If (Game.GetPlayer().GetEquippedItemType(0) != 11)EquipTorch.Show() ; If Torch is not equip, Player should Equip the Torch Message will showGoToState("Waiting") ; After the Message and If the torch is not equipped will RETURN to be activatedElseMyRagIgnitesFire() ; If Torch is equipped, now will show the combustible items (KindAccOptions) menuEndIfEndIf Link to comment Share on other sites More sharing options...
maxarturo Posted July 29, 2019 Share Posted July 29, 2019 (edited) All this could be avoided if you were more detailed from the beginning...When asking for assistance always keep in mind that only you are standing in front of your PC and only you actually knows what exactly your idea is suppose to do. I think this is what you wanted the script to do from the start.Changes has been made.READ THE NOTES BESIDE THEM GlobalVariable Property FlintUseCount Auto GlobalVariable Property FireULock Auto Light Property MyTorch Auto Sound Property MySFX Auto MiscObject Property Oil Auto MiscObject Property Rag Auto MiscObject Property Bristle Auto MiscObject Property Flint Auto Message Property EquipTorch Auto Message Property MyMenu Auto Message Property NeedKindAcc Auto Message Property NeedIgnite Auto Message Property FlintOrTorch Auto ObjectReference Property MyMarker Auto Auto State Waiting Event OnActivate(ObjectReference akActionRef) if (akActionRef == Game.GetPlayer()) if (Game.GetPlayer().GetItemCount(MyTorch) > 0) && (Game.GetPlayer().GetItemCount(Flint) > 0) MyIgnitesItem() ; If all items (more than one of each) are in the inventory will go to the CHOOSE item to lit fire "MyIgnitesItem()" else NeedIgnite.Show(); player has no ignite source EndIf If (Game.GetPlayer().GetItemCount(Rag) > 0) || (Game.GetPlayer().GetItemCount(Oil) > 0) || (Game.GetPlayer().GetItemCount(Bristle) > 0) MyIgnitesItem() ; If all items (more than one of each) are in the inventory will go to the CHOOSE item to lit fire "MyIgnitesItem()" else NeedKindAcc.Show() EndIf EndIf EndEvent EndState State Busy Event OnActivate(ObjectReference akActionRef) ;Do nothing. EndEvent EndState Function MyIgnitesItem() GoToState("Busy") Int iButtonA = FlintOrTorch.Show() If iButtonA == 0 If (Game.GetPlayer().GetEquippedItemType(0) != 11) MyCombustibleMenu() ; Goes to the choose combastion items MENU "MyCombustibleMenu()" else EquipTorch.Show() ; Player should Equip the Torch Message will show GoToState("Waiting") ; After the Message and If the torch is not eqipped will EXIT to be activated again EndIf EndIf If iButtonA == 1 Debug.Notification ("Flint Will Be Used To Light Fire") MyCombustibleMenu() ; Goes to the choose combastion items MENU "MyCombustibleMenu()" EndIf EndFunction Function MyCombustibleMenu() Int iButtonB = MyMenu.Show() If iButtonB == 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()" ElseIf iButtonB == 1 Game.GetPlayer().RemoveItem(Oil, 1) debug.notification("Option 1, 1 Oil Remove") LitFire() ; If this option is choose will go to execute the enable/disable - play - delete - etc.. "Function LitFire()" ElseIf iButtonB == 2 Game.GetPlayer().RemoveItem(Bristle, 1) debug.notification("Option 2, 1 Bristles Remove") LitFire() ; If this option is choose will go to execute the enable/disable - play - delete - etc.. "Function LitFire()" EndIf EndFunction Function LitFire() ; Do Stuff Here, ONE FUNCTION FOR ALL - enable/disable - play - delete - etc... GoToState("Waiting") ; This is only needed if multiple uses of the activator is meant to. If activator is disable > delete do not use it. EndFunction Edit : Typo... Edited July 29, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted July 29, 2019 Author Share Posted July 29, 2019 (edited) I removed...GoToState("Waiting").. as this is a single use activator. Haven't changed anything in the script and still no joy.Plus script repeats sections. Honest - I haven't changed anything.https://onedrive.live.com/?cid=B60C11D037429D8E&id=B60C11D037429D8E%2134447&parId=B60C11D037429D8E%21191&o=OneUp https://onedrive.live.com/?cid=B60C11D037429D8E&id=B60C11D037429D8E%2134446&parId=B60C11D037429D8E%21191&o=OneUp Edited July 29, 2019 by antstubell Link to comment Share on other sites More sharing options...
maxarturo Posted July 29, 2019 Share Posted July 29, 2019 (edited) Now that i had some free time and watch your videos, i understood.Should be working now how you want it to...READ THE NOTES BESIDE, IMPORTANT !. GlobalVariable Property FlintUseCount Auto GlobalVariable Property FireULock Auto Light Property MyTorch Auto Sound Property MySFX Auto MiscObject Property Oil Auto MiscObject Property Rag Auto MiscObject Property Bristle Auto MiscObject Property Flint Auto Message Property EquipTorch Auto Message Property MyMenu Auto Message Property NeedKindAcc Auto Message Property NeedIgnite Auto Message Property FlintOrTorch Auto ObjectReference Property MyMarker Auto Auto State Waiting Event OnActivate(ObjectReference akActionRef) if (akActionRef == Game.GetPlayer()) if (Game.GetPlayer().GetItemCount(MyTorch) > 0) && (Game.GetPlayer().GetItemCount(Flint) > 0) MyIgnitesItem() ; If all items (more than one of each) are in the inventory will go to the CHOOSE item to lit fire "MyIgnitesItem()" ElseIf (Game.GetPlayer().GetItemCount(Rag) > 0) && (Game.GetPlayer().GetItemCount(Oil) > 0) && (Game.GetPlayer().GetItemCount(Bristle) > 0) MyIgnitesItem() ; If all items (more than one of each) are in the inventory will go to the CHOOSE item to lit fire "MyIgnitesItem()" else NoRequiredIgniteItems.Show() ; ONE Message to show for both of the above, if NONE of them are in Player's inventory. EndIf EndIf EndEvent EndState State Busy Event OnActivate(ObjectReference akActionRef) ;Do nothing. EndEvent EndState Function MyIgnitesItem() GoToState("Busy") Int iButtonA = FlintOrTorch.Show() If iButtonA == 0 If (Game.GetPlayer().GetEquippedItemType(0) != 11) MyCombustibleMenu() ; Goes to the choose combastion items MENU if TORCH is equiped "MyCombustibleMenu()" else EquipTorch.Show() ; Player should "Equip the Torch" Message will show GoToState("Waiting") ; After the Message Above and If the torch is not eqipped will EXIT to be activated again EndIf EndIf If iButtonA == 1 If (Game.GetPlayer().GetItemCount(Rag) > 0) && (Game.GetPlayer().GetItemCount(Oil) > 0) && (Game.GetPlayer().GetItemCount(Bristle) > 0) Debug.Notification ("Flint Will Be Used To Light Fire") MyCombustibleMenu() ; Goes to the choose combastion items MENU ONLY IF all of the above items are in the inventory "MyCombustibleMenu()" else Debug.Notification ("No Items") ; If none of the items (or at least ONE is missing) from the inventory will show a "NO ITEMS Message". GoToState("Waiting") ; After the Message Above will EXIT to be activated again EndIf EndIf EndFunction Function MyCombustibleMenu() Int iButtonB = MyMenu.Show() If iButtonB == 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()" ElseIf iButtonB == 1 Game.GetPlayer().RemoveItem(Oil, 1) debug.notification("Option 1, 1 Oil Remove") LitFire() ; If this option is choose will go to execute the enable/disable - play - delete - etc.. "Function LitFire()" ElseIf iButtonB == 2 Game.GetPlayer().RemoveItem(Bristle, 1) debug.notification("Option 2, 1 Bristles Remove") LitFire() ; If this option is choose will go to execute the enable/disable - play - delete - etc.. "Function LitFire()" EndIf EndFunction Function LitFire() ; Do Stuff Here, ONE FUNCTION FOR ALL - enable/disable - play - delete - etc... GoToState("Waiting") ; This is only need if multiple uses of the activator is meant to. If activator is disable > delete do not use it. EndFunction EDIT : Forgot to change something ! Check it !.Change || to && Edited July 29, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted July 29, 2019 Author Share Posted July 29, 2019 Just got a lot of errors until I noticed that there was a : instead or ; so compiler tried to compile a comment. Fixed that but still getting... (63,0): mismatched input 'EndFunction' expecting ENDIF I attempted to fix this but cause more errors so I changed it back to the script you posted. Link to comment Share on other sites More sharing options...
maxarturo Posted July 29, 2019 Share Posted July 29, 2019 (edited) I'm making this in my tablet while looking at the beach and bitches.... difficult to concentrate with all those A**ES all around... Put in "Function MyIgnitesItem()" One moe "EndIf" at the end before "EndFunction" * Also i edit it a little after i posted it. It's been rectify. (don't put "EndIf" now if you will copy it from above). Edited July 29, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted July 29, 2019 Author Share Posted July 29, 2019 Sorry to interupt your down-time. I am going to leave it for today, just to say that this version compiles but is really messed up.Emjoy your break. Link to comment Share on other sites More sharing options...
maxarturo Posted July 30, 2019 Share Posted July 30, 2019 (edited) After having sex and clearing my head i Looked your videos once more and i realize that your idea has a problem from the beginning.The problem is ORDER OF HOW THINGS SHOULD TAKE PLACE, think carefully your idea before creating a Script. 1) OPTIONAL = On Activate the Player should be informed with message about the items required, otherwise will be a constant ENTER MENU - EXIT MENU if player dosen't have all items or takes the wrong options corresponding with what he has in his inventory. 2) On Activate the Script should check if at least ONE OF EACH (Ingnite Item + Combusible Item) are in the inventory:Torch & Flint & Rag & Oil & Bristle, otherwise will SHOW NO ITEMS Message and EXIT if NONE of them are in the inventory. 3) If the requirements above are meet will go to OPEN THE CHOOSE ITEMS MENU. * Having the option to fire the "Choose Item Menu" with at least ONLY ONE object will result in EXITING THE MENU if the item chosen is not in the inventory.(This is how i made the final script). GlobalVariable Property FlintUseCount Auto GlobalVariable Property FireULock Auto Light Property MyTorch Auto Sound Property MySFX Auto MiscObject Property Oil Auto MiscObject Property Rag Auto MiscObject Property Bristle Auto MiscObject Property Flint Auto Message Property EquipTorch Auto Message Property MyMenu Auto Message Property NeedKindAcc Auto Message Property NeedIgnite Auto Message Property FlintOrTorch Auto ObjectReference Property MyMarker Auto Auto State Waiting Event OnActivate(ObjectReference akActionRef) if (akActionRef == Game.GetPlayer()) RequiredItemsMESSAGE.Show() ; OPTIONAL - but Neccesary MESSAGE if (Game.GetPlayer().GetItemCount(MyTorch) > 0) || (Game.GetPlayer().GetItemCount(Flint) > 0) If (Game.GetPlayer().GetItemCount(Rag) > 0) || (Game.GetPlayer().GetItemCount(Oil) > 0) || (Game.GetPlayer().GetItemCount(Bristle) > 0) MyIgnitesItem() ; If at least ONE of all items of the two upper "IF" are in the inventory will go to the CHOOSE item to lit fire "MyIgnitesItem()" else NoRequiredIgniteItems.Show() ; ONE Message to show for both of the above, if the requirements are not meet. EndIf EndIf EndIF EndEvent EndState State Busy Event OnActivate(ObjectReference akActionRef) ;Do nothing. EndEvent EndState Function MyIgnitesItem() GoToState("Busy") Int iButtonA = FlintOrTorch.Show() If iButtonA == 0 If Game.GetPlayer().GetEquippedItemType(0) != 11 MyCombustibleMenu() ; Goes to the choose combastion items MENU if TORCH is equiped "MyCombustibleMenu()" else EquipTorch.Show() ; If Torch is NOT ALREADY EQUIPED, Player should "Equip the Torch" Message will show GoToState("Waiting") ; After the Message Above will EXIT to be activated again EndIf EndIf If iButtonA == 1 If Game.GetPlayer().GetItemCount(Flint) > 0 Debug.Notification ("Flint Will Be Used To Light Fire") MyCombustibleMenu() ; Goes to the choose combastion items MENU ONLY IF FLINT is in the inventory "MyCombustibleMenu()" else Debug.Notification ("No Flint Message") ; If NO FLINT is in the inventory will show a "NO FLINT Message". GoToState("Waiting") ; After the Message Above will EXIT to be activated again EndIf EndIf EndFunction Function MyCombustibleMenu() Int iButtonB = MyMenu.Show() If iButtonB == 0 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") EndIf EndIf If iButtonB == 1 If Game.GetPlayer().GetItemCount(Oil) > 0 Game.GetPlayer().RemoveItem(Oil, 1) debug.notification("Option 1, 1 Oil 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 Oil") GoToState("Waiting") EndIf EndIf If iButtonB == 2 If Game.GetPlayer().GetItemCount(Bristle) > 0 Game.GetPlayer().RemoveItem(Bristle, 1) debug.notification("Option 2, 1 Bristles 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 Bristle") GoToState("Waiting") EndIf EndIf EndFunction Function LitFire() ; Do Stuff Here, ONE FUNCTION FOR ALL - enable/disable - play - delete - etc... GoToState("Waiting") ; This is only need if multiple uses of the activator is meant to. If activator is disable > delete do not use it. EndFunction EDIT : I was creating the Script based on yours and trying to understand what you want it to do through it.I tested this and compare it with one of mine and it's working flawlessly. Edited July 30, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted July 30, 2019 Author Share Posted July 30, 2019 (edited) Spent all morning on this and cracked it. Couldn't have done it without your help. 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 future 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()EndFunctionEvent 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)iButtonA = EquipTorch.Show(); show equip torch messageelseIf 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()EndIfEndIfEndEvent Now, I am at peace... for a while.EDIT: Just noticed...iButtonA = EquipTorch.Show(); show equip torch messagecan be changed to...EquipTorch.Show(); show equip torch message EDIT, EDIT: I think. Edited July 30, 2019 by antstubell Link to comment Share on other sites More sharing options...
Recommended Posts