[Trigger] custom script causes desync

Status
Not open for further replies.
Level 12
Joined
Jan 13, 2008
Messages
559
  • eat mushroom
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Mushroom
      • ((Triggering unit) is A Hero) Equal to True
      • (Unit-type of (Triggering unit)) Not equal to Backpack
    • Actions
      • Set temp_player = (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Intelligence of (Triggering unit) (Exclude bonuses)) Less than 86
        • Then - Actions
          • Hero - Modify Intelligence of (Triggering unit): Add 15
        • Else - Actions
          • Hero - Modify Intelligence of (Triggering unit): Set to 100
      • Custom script: if GetLocalPlayer() == udg_temp_player then
      • Cinematic - Fade out and back in over 5.00 seconds using texture Dream and color (0.00%, 100.00%, 50.00%) with 10.00% transparency
      • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Less than 21.00
        • Then - Actions
          • Unit - Set life of (Triggering unit) to 1.00
        • Else - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 20.00)
I only want it to fade for the player who ate the mushroom and after some googling i found the solution (putting it between those 2 custom script lines) but it always causes a desync..hm

/e: it only desyncs when i host on ENT..not in singleplayer
 
Last edited:
Level 12
Joined
Jan 13, 2008
Messages
559
thanks..like this?
  • eat mushroom
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Mushroom
      • ((Triggering unit) is A Hero) Equal to True
      • (Unit-type of (Triggering unit)) Not equal to Backpack
      • ((Triggering unit) is A structure) Not equal to True
    • Actions
      • Set temp_player = (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Intelligence of (Triggering unit) (Exclude bonuses)) Less than 86
        • Then - Actions
          • Hero - Modify Intelligence of (Triggering unit): Add 15
        • Else - Actions
          • Hero - Modify Intelligence of (Triggering unit): Set to 100
          • Cinematic - Fade out and back in over 5.00 seconds using texture Dream and color (0.00%, 100.00%, 50.00%) with 10.00% transparency
          • Cinematic - Hide filter
          • Custom script: if GetLocalPlayer() == udg_temp_player then
          • Cinematic - Show filter
          • Custom script: endif
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of (Triggering unit)) Less than 21.00
            • Then - Actions
              • Unit - Set life of (Triggering unit) to 1.00
            • Else - Actions
              • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 20.00)
 
Level 12
Joined
Jan 13, 2008
Messages
559
  • eat mushroom
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Mushroom
      • ((Triggering unit) is A Hero) Equal to True
      • (Unit-type of (Triggering unit)) Not equal to Backpack
    • Actions
      • Set temp_player = (Owner of (Triggering unit))
      • Cinematic - Fade out and back in over 5.00 seconds using texture Dream and color (0.00%, 100.00%, 50.00%) with 10.00% transparency
      • Cinematic - Hide filter
      • Custom script: if GetLocalPlayer() == udg_temp_player then
      • Cinematic - Show filter
      • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Intelligence of (Triggering unit) (Exclude bonuses)) Less than 86
        • Then - Actions
          • Hero - Modify Intelligence of (Triggering unit): Add 15
        • Else - Actions
          • Hero - Modify Intelligence of (Triggering unit): Set to 100
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Less than 21.00
        • Then - Actions
          • Unit - Set life of (Triggering unit) to 1.00
        • Else - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 20.00)
just tested, it shows it for all players in the game.
 
Level 7
Joined
Jan 23, 2011
Messages
350
Welp, the action itself is the problem, the BJ calls the "Cinematic - Show filter" and the second player only see half the fade
Also, the action itself (Cinematic - Fade out and back in over 5.00 seconds using texture Dream and color (0.00%, 100.00%, 50.00%) with 10.00% transparency) is a non-MUI actions, as it uses global variables
set bj_cineFadeContinueRed = red
set bj_cineFadeContinueGreen = green
set bj_cineFadeContinueBlue = blue
set bj_cineFadeContinueTrans = trans
set bj_cineFadeContinueDuration = duration
set bj_cineFadeContinueTex = tex

// Create a timer to continue the cinematic fade.
set bj_cineFadeContinueTimer = CreateTimer()

Here's a solution using MUI

  • Filter start
    • Acontecimientos
    • Condiciones
    • Acciones
      • Set set_player[1] = temp_player
      • Set used_players = 1
      • -------- ------------------------------------------------------------------------------------------ --------
      • -------- Fading out --------
      • Secuencia cinematográfica - Apply a filter over 2.50 seconds using Mezcla normal on texture Máscara blanca, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (0.00%, 0.00%, 0.00%) and 100.00% transparency
      • Secuencia cinematográfica - Ocultar filter
      • Custom script: if GetLocalPlayer() == udg_temp_player then
      • Secuencia cinematográfica - Mostrar filter
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------ --------
      • Set trigger = FilterPeriodic <gen>
      • Set timeout = 2.50
  • FilterPeriodic
    • Acontecimientos
    • Condiciones
    • Acciones
      • -------- Fading in --------
      • Secuencia cinematográfica - Apply a filter over 2.50 seconds using Mezcla normal on texture Máscara blanca, starting with color (100.00%, 100.00%, 100.00%) and 100.00% transparency and ending with color (0.00%, 0.00%, 0.00%) and 0.00% transparency
      • Secuencia cinematográfica - Ocultar filter
      • Custom script: if GetLocalPlayer() == udg_get_player[1] then
      • Secuencia cinematográfica - Mostrar filter
      • Custom script: endif
      • Set automaticClean = True
      • Set finish = True
 
Status
Not open for further replies.
Top