Announcement

Collapse
No announcement yet.

how to disable volume trigger in game ???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to disable volume trigger in game ???

    hello i have a volume trigger that let me get a treasure in my level, when the trigger is activate i adds points to the player score, take the treasure and show it to the inventory of the player.

    now when o try to load the game i will check the store data, and if the treasure is already picked up i will hide the treasure, but the trigger is still there, this mean that the player can go to the treasure position again and he can activated the trigger because the trigger has never been used.

    i need to disable the volume trigger when the loaded data is true, can somebody know a way to disable the volume trigger in game ?

    thanks in advance for the help.

    #2
    You can disable any event by using the Toggle function. Just create a toggle node and connect the Event output to the top of the event you wish to disable. Then just wire the Event output to the Toggle's Off input. Or you could make it so that the event will only occur one time by adjusting the Trigger Count option in the Trigger properties, though for this scenario, the former seems more appropriate.

    Regarding the reloaded map, you could use the Has Inventory condition. If it's true and the player has that inventory item, then you can disable the trigger, and all should be good. As for the actual saving and loading of the inventory, I am unsure but your post sounds as though that isn't the problem.

    Comment


      #3
      I don't really like the toggle node, so the way I would do it is by setting up bools.

      Here's the snippet, just copy everything and paste into your kismet, adjust your variables as well.
      How to do the check save data, I don't know.

      Code:
      Begin Object Class=SeqEvent_Touch Name=SeqEvent_Touch_0
         Originator=Trigger'Trigger_0'
         MaxTriggerCount=0
         MaxWidth=118
         OutputLinks(0)=(Links=((LinkedOp=SeqCond_CompareBool'SeqCond_CompareBool_0')),DrawY=293)
         OutputLinks(1)=(DrawY=314)
         OutputLinks(2)=(DrawY=335)
         VariableLinks(0)=(DrawX=227)
         ObjInstanceVersion=2
         ParentSequence=Sequence'Main_Sequence'
         ObjPosX=168
         ObjPosY=224
         ObjName="Trigger_0 Touch"
         DrawWidth=104
         DrawHeight=176
         Name="SeqEvent_Touch_0"
         ObjectArchetype=SeqEvent_Touch'Engine.Default__SeqEvent_Touch'
      End Object
      Begin Object Class=SeqAct_SetBool Name=SeqAct_SetBool_0
         InputLinks(0)=(DrawY=314)
         OutputLinks(0)=(DrawY=314)
         VariableLinks(0)=(LinkedVariables=(SeqVar_Bool'SeqVar_Bool_1'),DrawX=1418)
         VariableLinks(1)=(LinkedVariables=(SeqVar_Bool'SeqVar_Bool_0'),DrawX=1474)
         ObjInstanceVersion=1
         ParentSequence=Sequence'Main_Sequence'
         ObjPosX=1384
         ObjPosY=280
         ObjComment="The Treasure has been opened"
         DrawWidth=128
         DrawHeight=61
         Name="SeqAct_SetBool_0"
         ObjectArchetype=SeqAct_SetBool'Engine.Default__SeqAct_SetBool'
      End Object
      Begin Object Class=SeqCond_CompareBool Name=SeqCond_CompareBool_0
         InputLinks(0)=(DrawY=334)
         OutputLinks(0)=(DrawY=324)
         OutputLinks(1)=(Links=((LinkedOp=SeqAct_Interp'SeqAct_Interp_0')),DrawY=344)
         VariableLinks(0)=(LinkedVariables=(SeqVar_Bool'SeqVar_Bool_0'),DrawX=525)
         VariableLinks(1)=(DrawX=575)
         ObjInstanceVersion=2
         ParentSequence=Sequence'Main_Sequence'
         ObjPosX=496
         ObjPosY=288
         ObjComment="Has the treasure been opened yet?"
         DrawWidth=115
         DrawHeight=85
         Name="SeqCond_CompareBool_0"
         ObjectArchetype=SeqCond_CompareBool'Engine.Default__SeqCond_CompareBool'
      End Object
      Begin Object Class=SeqVar_Bool Name=SeqVar_Bool_0
         ObjInstanceVersion=1
         ParentSequence=Sequence'Main_Sequence'
         ObjPosX=528
         ObjPosY=576
         DrawWidth=32
         DrawHeight=32
         Name="SeqVar_Bool_0"
         ObjectArchetype=SeqVar_Bool'Engine.Default__SeqVar_Bool'
      End Object
      Begin Object Class=SeqVar_Bool Name=SeqVar_Bool_1
         bValue=1
         ObjInstanceVersion=1
         ParentSequence=Sequence'Main_Sequence'
         ObjPosX=1336
         ObjPosY=456
         DrawWidth=32
         DrawHeight=32
         Name="SeqVar_Bool_1"
         ObjectArchetype=SeqVar_Bool'Engine.Default__SeqVar_Bool'
      End Object
      Begin Object Class=SeqAct_Interp Name=SeqAct_Interp_0
         Begin Object Class=InterpGroupInst Name=InterpGroupInst_0
            Begin Object Class=InterpTrackInstMove Name=InterpTrackInstMove_0
               InitialTM=(XPlane=(W=0.000000,X=1.000000,Y=0.000000,Z=0.000000),YPlane=(W=0.000000,X=0.000000,Y=1.000000,Z=-0.000000),ZPlane=(W=0.000000,X=0.000000,Y=0.000000,Z=1.000000),WPlane=(W=1.000000,X=-1008.000000,Y=-16.000000,Z=512.000000))
               InitialQuat=(X=-0.000000,Y=0.000000,Z=0.000000,W=1.000000)
               Name="InterpTrackInstMove_0"
               ObjectArchetype=InterpTrackInstMove'Engine.Default__InterpTrackInstMove'
            End Object
            Group=InterpGroup'InterpGroup_0'
            GroupActor=InterpActor'InterpActor_0'
            Name="InterpGroupInst_0"
            ObjectArchetype=InterpGroupInst'Engine.Default__InterpGroupInst'
         End Object
         InputLinks(0)=(DrawY=254)
         InputLinks(1)=(DrawY=276)
         InputLinks(2)=(DrawY=298)
         InputLinks(3)=(DrawY=320)
         InputLinks(4)=(DrawY=342)
         OutputLinks(0)=(Links=((LinkedOp=SeqAct_ToggleHidden'SeqAct_ToggleHidden_0')),DrawY=270,OverrideDelta=31)
         OutputLinks(1)=(DrawY=326,OverrideDelta=87)
         VariableLinks(0)=(LinkedVariables=(InterpData'InterpData_0'),DrawX=843,OverrideDelta=20)
         VariableLinks(1)=(ExpectedType=Class'Engine.SeqVar_Object',LinkedVariables=(SeqVar_Object'SeqVar_Object_1'),LinkDesc="NewGroup",MinVars=0,DrawX=908,OverrideDelta=67)
         ObjInstanceVersion=2
         ParentSequence=Sequence'Main_Sequence'
         ObjPosX=808
         ObjPosY=216
         ObjComment="Open Chest"
         DrawWidth=154
         DrawHeight=157
         Name="SeqAct_Interp_0"
         ObjectArchetype=SeqAct_Interp'Engine.Default__SeqAct_Interp'
      End Object
      Begin Object Class=InterpData Name=InterpData_0
         Begin Object Class=InterpGroup Name=InterpGroup_0
            Begin Object Class=InterpTrackMove Name=InterpTrackMove_0
               PosTrack=(Points=((InterpMode=CIM_CurveAutoClamped)))
               EulerTrack=(Points=((InterpMode=CIM_CurveAutoClamped)))
               LookupTrack=(Points=())
               MoveFrame=IMF_RelativeToInitial
               Name="InterpTrackMove_0"
               ObjectArchetype=InterpTrackMove'Engine.Default__InterpTrackMove'
            End Object
            InterpTracks(0)=InterpTrackMove'InterpTrackMove_0'
            GroupName="NewGroup"
            GroupColor=(B=0,G=159,R=179,A=255)
            Name="InterpGroup_0"
            ObjectArchetype=InterpGroup'Engine.Default__InterpGroup'
         End Object
         Begin Object Class=InterpCurveEdSetup Name=InterpCurveEdSetup_0
            Name="InterpCurveEdSetup_0"
            ObjectArchetype=InterpCurveEdSetup'Engine.Default__InterpCurveEdSetup'
         End Object
         InterpGroups(0)=InterpGroup'InterpGroup_0'
         CurveEdSetup=InterpCurveEdSetup'InterpCurveEdSetup_0'
         SelectedFilter=InterpFilter'Engine.Default__InterpData:FilterAll'
         ObjInstanceVersion=1
         ParentSequence=Sequence'Main_Sequence'
         ObjPosX=808
         ObjPosY=408
         DrawWidth=32
         DrawHeight=32
         Name="InterpData_0"
         ObjectArchetype=InterpData'Engine.Default__InterpData'
      End Object
      Begin Object Class=SeqAct_ToggleHidden Name=SeqAct_ToggleHidden_0
         InputLinks(0)=(DrawY=301)
         InputLinks(1)=(DrawY=322)
         InputLinks(2)=(DrawY=343)
         OutputLinks(0)=(Links=((LinkedOp=SeqAct_SetBool'SeqAct_SetBool_0')),DrawY=322)
         VariableLinks(0)=(LinkedVariables=(SeqVar_Object'SeqVar_Object_1'),DrawX=1118)
         VariableLinks(1)=(DrawX=1169)
         EventLinks(0)=(DrawX=1218)
         ObjInstanceVersion=1
         ParentSequence=Sequence'Main_Sequence'
         ObjPosX=1080
         ObjPosY=264
         ObjComment="Hide Treasure"
         DrawWidth=173
         DrawHeight=109
         Name="SeqAct_ToggleHidden_0"
         ObjectArchetype=SeqAct_ToggleHidden'Engine.Default__SeqAct_ToggleHidden'
      End Object
      Begin Object Class=SeqVar_Object Name=SeqVar_Object_1
         ObjValue=InterpActor'InterpActor_0'
         ObjInstanceVersion=1
         ParentSequence=Sequence'Main_Sequence'
         ObjPosX=1008
         ObjPosY=400
         DrawWidth=32
         DrawHeight=32
         Name="SeqVar_Object_1"
         ObjectArchetype=SeqVar_Object'Engine.Default__SeqVar_Object'
      End Object

      Comment


        #4
        Yes, comparing bool could work too, and I tend to prefer using bool in most situations. However, in this situation it is the difference between two nodes (Event and Toggle) and five nodes (Event, Bool Comparison, Bool Comparison's Variable, Set Bool, and Set Bool's Variable). If you only need this sequence for this one situation, or for a few situations, use whichever you prefer. But, if you are using this sequence regularly, the Toggle approach will save more time. Being able to create a Toggle with a quick T+left click in kismet saves more time yet.

        Of course, by the time you'll have read through this post, you will probably have lost as much time as you might have gained. So whichever.

        Comment


          #5
          thanks you for the answers, they will be very usefull for me, thanks again ....

          Comment


            #6
            Funny, i posted how to enable a trigger with kismet. I heard about using a toggle function, but that didn't work for me. Maybe, it'll work for you.

            Comment


              #7
              Are you sure the TriggerOnlyOnce stuff works with savegames? I could imagine that it won't re-trigger in the same game, but once you loaded it, the TriggerCount will go back to it's default value.

              While we're at it: Does something like global saveable Kismet variables, i.e. a variable in Kismet that gets it's value written to an INI when it changes and uses the value from that INI when the level/savegame is loaded again?

              That would be pretty useful if you want to make a RPG and want to save the progress of quests that don't rely on Inventory. (You could probably add a whole bunch of invisbile Inventory to the player, but.. seriously. )


              And the "global" means that the variable shouldn't only exist in one map but are also accessible in other maps, for example if you have to go into a cave to slay a monster, then go back into town (aka another map) and there the quest giver would check this global variable to see if the monster is dead.

              Comment

              Working...
              X