antstubell Posted October 22, 2019 Share Posted October 22, 2019 ... explained more here by looking at the script.Objective - STOP THE DAMN SOUND. Angry because it is probably very obvious but can't see it. When player unequips the weapon stop the looping sound. import soundActor Property PlayerREF AutoGlobalVariable Property FirstEquip AutoMessage Property WeapInfo AutoSpell Property MySpell AutoSound Property My_Heartbeat_ Autoint instanceID ;used to store sound refEvent OnEquipped(Actor akActor)if (akActor == PlayerRef)PlayerREF.AddSpell(MySpell)If FirstEquip.GetValue() == 0WeapInfo.show()instanceID = My_Heartbeat_.Play(PlayerRef)FirstEquip.SetValue(1)EndifEndIfEndEvent;-------------------------------------------------------------------Event OnUnequipped(Actor akActor)if (akActor == PlayerRef)PlayerREF.RemoveSpell(MySpell)instanceID = My_Heartbeat_.Stop(PlayerRef)EndIfEndEvent (26,27): Stop is not a function or does not exist(26,0): type mismatch while assigning to a int (cast missing or types unrelated) Link to comment Share on other sites More sharing options...
maxarturo Posted October 22, 2019 Share Posted October 22, 2019 (edited) I don't mean to criticize in any way !, but... please... pay a little more attention to what's written in "creationkit.com". Event OnUnequipped(Actor akActor) if (akActor == PlayerRef) PlayerREF.RemoveSpell(MySpell) StopInstance(instanceID) EndIf EndEvent ............................................................................................................... If "import sound" is not used then : Event OnUnequipped(Actor akActor) if (akActor == PlayerRef) PlayerREF.RemoveSpell(MySpell) Sound.StopInstance(instanceID) EndIf EndEvent * This stuff is for beginners... and not for the level that you are right now... Edit : Typo... Stupid keyboard is full with bread and cookie crumbs ! Edited October 22, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted October 22, 2019 Author Share Posted October 22, 2019 One of those days. Don't script when angry.Do you know how to stop this... PlayerRef.PlayIdle(MyIdle) Wiki says calling the same idle on an actor a 2nd time stops the idle... not all idles. Link to comment Share on other sites More sharing options...
maxarturo Posted October 22, 2019 Share Posted October 22, 2019 (edited) You can stop / interrupt an animation that's been send or an idle (that's on LOOP) by forcing the player to do something else, like equiping a weapon.I haven't try this (the bellow) because i mainly use "Debug.SendAnimationEvent" or Furnitures Markers for idle (enter furniture > exit furniture). idle property IdleStop_Loose auto PlayerRef.PlayIdle(IdleStop_Loose) * (IdleStop_Loose is located in the animations window under ActionIdleStop --> IdleStopRoot) Edited October 22, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted October 22, 2019 Author Share Posted October 22, 2019 Yep.IdleStop_LooseDoes stop the idle.Equipping the weapon starts the idle, which in IdleInjured, but if player shifts to 1st person they can in fact move. Third person disables controls. Also swinging the weapon in either 1st or 3rd person stops the idle as you mentioned. This is not an issue as the Spell still effects the player regardless.Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts