stonefisher Posted July 4, 2017 Share Posted July 4, 2017 I wanted to continue working on the script anyway. Even if it changes and adds an animation still needs the triggers to work. I was thinking arnt the draw animations tied to the weapon because they do fancy things when you draw weapons. So shouldnt we be running the event check against the equipped weapon and not the player? Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 4, 2017 Share Posted July 4, 2017 (edited) No they aren't. As I already said, have used them many times. I'm also using them for animation play script and they fire without problems . Edited July 4, 2017 by shavkacagarikia Link to comment Share on other sites More sharing options...
stonefisher Posted July 4, 2017 Share Posted July 4, 2017 oh ok. I am at a loss then as to why it isnt working. Link to comment Share on other sites More sharing options...
stonefisher Posted July 7, 2017 Share Posted July 7, 2017 (edited) Well,Decided to come back to this. Turns out the animations part was fine. Just the object ref the script is attached to is not available in the onanimationevent section. Could someone please tell me how to fix this? @r00stafarian had an idea, what if instead of zipping the suit up at night and unzipping during the day, how about we tie it to light levels? So if its bright its probably a warm place so unzip, if its dark probably a cold place so zip up. Scriptname CGXAM_GhostGoggles extends ObjectReference Armor Property CGXAM_CourserGhostX92Goggles Auto Keyword property CGXAMGhostX92GogglesDown auto Keyword property CGXAMGhostX92GogglesUp auto Keyword property CGXAMGhostX92GogglesPulsingDown auto Keyword property CGXAMGhostX92GogglesPulsingUp auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesDown Auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesUp Auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesPulsingDown Auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesPulsingUp Auto Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() ObjectReference GoggleRef = self. RegisterForAnimationEvent(game.getplayer(), "WeaponDraw") RegisterForAnimationEvent(game.getplayer(), "WeaponSheathe") Debug.MessageBox("animations regeisterd") if (Game.getplayer().IsWeaponDrawn() == true) If (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesUp)) GoggleRef.AttachMod(CGXAM_mod_CourserGhostX92GogglesDown) ElseIF (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingUp)) GoggleRef.AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingDown) EndIf ElseIF (Game.getplayer().IsWeaponDrawn() == false) If (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesDown)) GoggleRef.AttachMod(CGXAM_mod_CourserGhostX92GogglesUp) ElseIF (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingDown)) GoggleRef.AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingDown) EndIf EndIf EndIf EndEvent Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (akSource == Game.GetPlayer()) && (asEventName == "WeaponDraw") If (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesUp)) GoggleRef.AttachMod(CGXAM_mod_CourserGhostX92GogglesDown) ElseIF (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingUp)) GoggleRef.AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingDown) EndIf ElseIf (akSource == Game.GetPlayer()) && (asEventName == "WeaponSheathe") If (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesDown)) GoggleRef.AttachMod(CGXAM_mod_CourserGhostX92GogglesUp) ElseIF (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingDown)) GoggleRef.AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingUp) EndIf EndIf endEvent Event OnUnequipped(Actor akActor) if akActor == Game.GetPlayer() UnregisterForAnimationEvent(game.getplayer(), "WeaponDraw") UnregisterForAnimationEvent(game.getplayer(), "WeaponSheathe") EndIf EndEvent Edited July 7, 2017 by stonefisher Link to comment Share on other sites More sharing options...
Reneer Posted July 7, 2017 Share Posted July 7, 2017 (edited) Basically your problem was that you are creating the GoggleRef in your OnEquipped function, so it is a "local" variable to that function that can't be used outside of it. But since your GoggleRef is set to Self, you don't need it at all. Scriptname CGXAM_GhostGoggles extends ObjectReference Armor Property CGXAM_CourserGhostX92Goggles Auto Keyword property CGXAMGhostX92GogglesDown auto Keyword property CGXAMGhostX92GogglesUp auto Keyword property CGXAMGhostX92GogglesPulsingDown auto Keyword property CGXAMGhostX92GogglesPulsingUp auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesDown Auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesUp Auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesPulsingDown Auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesPulsingUp Auto Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() RegisterForAnimationEvent(game.getplayer(), "WeaponDraw") RegisterForAnimationEvent(game.getplayer(), "WeaponSheathe") Debug.MessageBox("animations regeisterd") if (Game.getplayer().IsWeaponDrawn() == true) If (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesUp)) AttachMod(CGXAM_mod_CourserGhostX92GogglesDown) ElseIF (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingUp)) AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingDown) EndIf ElseIF (Game.getplayer().IsWeaponDrawn() == false) If (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesDown)) AttachMod(CGXAM_mod_CourserGhostX92GogglesUp) ElseIF (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingDown)) AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingDown) EndIf EndIf EndIf EndEvent Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (akSource == Game.GetPlayer()) && (asEventName == "WeaponDraw") If (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesUp)) AttachMod(CGXAM_mod_CourserGhostX92GogglesDown) ElseIF (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingUp)) AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingDown) EndIf ElseIf (akSource == Game.GetPlayer()) && (asEventName == "WeaponSheathe") If (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesDown)) AttachMod(CGXAM_mod_CourserGhostX92GogglesUp) ElseIF (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingDown)) AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingUp) EndIf EndIf endEvent Event OnUnequipped(Actor akActor) if akActor == Game.GetPlayer() UnregisterForAnimationEvent(game.getplayer(), "WeaponDraw") UnregisterForAnimationEvent(game.getplayer(), "WeaponSheathe") EndIf EndEvent Edited July 7, 2017 by Reneer Link to comment Share on other sites More sharing options...
r00stafarian Posted July 7, 2017 Author Share Posted July 7, 2017 @r00stafarian had an idea, what if instead of zipping the suit up at night and unzipping during the day, how about we tie it to light levels? So if its bright its probably a warm place so unzip, if its dark probably a cold place so zip up. I think that is an acceptable compromise. Working on a 3.0 of the mod (added one more suit variation). Almost done. Link to comment Share on other sites More sharing options...
stonefisher Posted July 7, 2017 Share Posted July 7, 2017 I can do a day night cycle just fine, I just thought light level would be more interesting. Link to comment Share on other sites More sharing options...
stonefisher Posted July 7, 2017 Share Posted July 7, 2017 @reneer Heres the old script I was trying to fix with the goggleref. The "self" in the onanimate section did not attach mod to the goggles while the onequip section the self worked for attaching the mods. I did stick message boxs everywhere and everything was working except the attach mod lines section was triggered but no mods were added. Scriptname CGXAM_GhostGoggles extends ObjectReference Armor Property CGXAM_CourserGhostX92Goggles Auto Keyword property CGXAMGhostX92GogglesDown auto Keyword property CGXAMGhostX92GogglesUp auto Keyword property CGXAMGhostX92GogglesPulsingDown auto Keyword property CGXAMGhostX92GogglesPulsingUp auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesDown Auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesUp Auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesPulsingDown Auto ObjectMod Property CGXAM_mod_CourserGhostX92GogglesPulsingUp Auto Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() RegisterForAnimationEvent(game.getplayer(), "WeaponDraw") RegisterForAnimationEvent(game.getplayer(), "WeaponSheathe") if (Game.getplayer().IsWeaponDrawn() == true) If (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesUp)) Self.AttachMod(CGXAM_mod_CourserGhostX92GogglesDown) ElseIF (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingUp)) Self.AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingDown) EndIf ElseIF (Game.getplayer().IsWeaponDrawn() == false) If (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesDown)) Self.AttachMod(CGXAM_mod_CourserGhostX92GogglesUp) ElseIF (Game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingDown)) Self.AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingDown) EndIf EndIf EndIf EndEvent Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (akSource == Game.GetPlayer()) && (asEventName == "WeaponDraw") If (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesUp)) Self.AttachMod(CGXAM_mod_CourserGhostX92GogglesDown) ElseIF (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingUp)) Self.AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingDown) EndIf ElseIf (akSource == Game.GetPlayer()) && (asEventName == "WeaponSheathe") If (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesDown)) Self.AttachMod(CGXAM_mod_CourserGhostX92GogglesUp) ElseIF (game.getplayer().wornhaskeyword(CGXAMGhostX92GogglesPulsingDown)) Self.AttachMod(CGXAM_mod_CourserGhostX92GogglesPulsingUp) EndIf EndIf endEvent Event OnUnequipped(Actor akActor) if akActor == Game.GetPlayer() UnregisterForAnimationEvent(game.getplayer(), "WeaponDraw") UnregisterForAnimationEvent(game.getplayer(), "WeaponSheathe") EndIf EndEvent Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 7, 2017 Share Posted July 7, 2017 Has author fixed the invisible mesh problem for goggles which were holding gamebryo animations? Link to comment Share on other sites More sharing options...
stonefisher Posted July 7, 2017 Share Posted July 7, 2017 No idea. So why is self not the same in Event OnEquipped(Actor akActor) and Event OnAnimationEvent(ObjectReference akSource, string asEventName)? I must learn. Link to comment Share on other sites More sharing options...
Recommended Posts