• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Problem playing a created sound

Status
Not open for further replies.
Level 24
Joined
Jun 26, 2020
Messages
1,850
I made 2 triggers for a spell:
  • Custom script: set udg_Temp_Sound=CreateSound("Abilities\\Spells\\Undead\\Possession\\PossessionMissileLaunch1.wav", false, true, true, 10, 10, "DefaultEAXON")
  • Sound - Play Temp_Sound at 100.00% volume, attached to (Last created unit)
  • Sound - Destroy Temp_Sound
  • Custom script: set udg_Temp_Sound=CreateSound("Abilities\\Spells\\Undead\\Possession\\PossessionMissileHit1.wav", false, true, true, 10, 10, "DefaultEAXON")
  • Sound - Play Temp_Sound at 100.00% volume, attached to (Load Atemp_Int3 of 5 in Dark_Summoning_datos)
  • Sound - Destroy Temp_Sound
But only the second works, but the first for some reason didn't work, I'm sure I wrote correctly the path, If you need to see the triggers tell me, but they have some other things that I don't wanna explain, but I think it can't be neccesary.
In resume, what's wrong?
Edit, ok I think the problem is in the trigger, so I will share you, but is a disaster, I hope this won't be a problem for you.
  • Dark Summoning
    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
      • ((Ability being cast) Equal to Dark Summoning (mio)) or ((Ability being cast) Equal to Dark Summoning (Hero))
    • Actions
      • Custom script: local group g
      • Custom script: set g=CreateGroup()
      • -------- Select heros --------
      • Set Locacion_Variable[41] = (Target point of ability being cast)
      • Set Grupo_Unidad_Variable[21] = (Random 5 units from (Units within 700.00 of Locacion_Variable[41] matching ((((Matching unit) is A hero) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True))))
      • Custom script: loop
      • Custom script: set udg_Atemp_Unit2=FirstOfGroup(udg_Grupo_Unidad_Variable[21])
      • Custom script: exitwhen udg_Atemp_Unit2==null
      • Custom script: if (IsUnitInGroup(udg_Atemp_Unit2,udg_Dark_Summoning_Heros)==false) then
      • Custom script: set udg_Atemp_Int3=GetHandleIdBJ(udg_Atemp_Unit2)
      • Special Effect - Create a special effect attached to the origin of Atemp_Unit2 using Abilities\Spells\Undead\Darksummoning\DarkSummonTarget.mdl
      • Hashtable - Save Handle Of(Last created special effect) as Atemp_Int3 of 3 in Dark_Summoning_datos
      • Custom script: call GroupAddUnitSimple(udg_Atemp_Unit2,g)
      • Unit Group - Add Atemp_Unit2 to Dark_Summoning_Heros
      • Custom script: endif
      • Unit Group - Remove Atemp_Unit2 from Grupo_Unidad_Variable[21]
      • Custom script: endloop
      • Custom script: call DestroyGroup(udg_Grupo_Unidad_Variable[21])
      • Custom script: call RemoveLocation(udg_Locacion_Variable[41])
      • -------- Wait --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Dark Summoning (mio)
        • Then - Actions
          • Set Temp_Real = (7.00 - (2.00 x (Real((Level of Dark Summoning (mio) for (Triggering unit))))))
        • Else - Actions
          • Set Temp_Real = (6.00 - (Real((Level of Dark Summoning (Hero) for (Triggering unit)))))
      • Wait Temp_Real seconds
      • -------- Send Heros --------
      • Custom script: loop
      • Custom script: set udg_Atemp_Unit2=FirstOfGroup(g)
      • Custom script: exitwhen udg_Atemp_Unit2==null
      • Set Temp_Loc = (Position of Atemp_Unit2)
      • Unit - Create 1 Essence for (Owner of Atemp_Unit2) at Temp_Loc facing Temp_Loc2
      • Custom script: call RemoveLocation(udg_Temp_Loc)
      • Custom script: set udg_Temp_Sound=CreateSound("Abilities\\Spells\\Undead\\Possession\\PossessionMissileLaunch1.wav", false, true, true, 10, 10, "DefaultEAXON")
      • Sound - Play Temp_Sound at 100.00% volume, attached to (Last created unit)
      • Sound - Destroy Temp_Sound
      • Set Atemp_Int3 = (Key (Last created unit))
      • -------- Jump System --------
      • Set JDA_Unit = (Last created unit)
      • Custom script: call DestroyEffectBJ(LoadEffectHandleBJ(GetHandleIdBJ(udg_Atemp_Unit2),3, udg_Dark_Summoning_datos))
      • Custom script: call RemoveSavedHandle(udg_Dark_Summoning_datos,3,udg_Atemp_Int3)
      • If (((Owner of (Triggering unit)) is in Grupo_Draeneanos) Equal to True) then do (Set Temp_Loc2 = (Random point in Draeneanos)) else do (Set Temp_Loc2 = (Random point in Demonios))
      • Set JDA_TargetPoint = Temp_Loc2
      • Special Effect - Create a special effect at Temp_Loc2 using Abilities\Spells\Undead\Darksummoning\DarkSummonTarget.mdl
      • Hashtable - Save Handle Of(Last created special effect) as Atemp_Int3 of 3 in Dark_Summoning_datos
      • Set JDA_Speed = 30.00
      • Set JDA_SpecialEffect = <Cadena vacÃa>
      • Set JDA_Animation = <Cadena vacÃa>
      • Set JDA_AnimationSpeed = 1.00
      • Set JDA_JumpHigh_Distance = 0.00
      • Set JDA_DestroyTrees_Dash = False
      • Trigger - Run Jump System 1 <gen> (checking conditions)
      • Hashtable - Save Handle OfAtemp_Unit2 as Atemp_Int3 of 5 in Dark_Summoning_datos
      • Unit - Hide Atemp_Unit2
      • Unit - Pause Atemp_Unit2
      • Custom script: call GroupRemoveUnitSimple(udg_Atemp_Unit2,g)
      • Unit Group - Remove Atemp_Unit2 from Dark_Summoning_Heros
      • Custom script: endloop
      • Custom script: set udg_Temp_Loc2=null
      • Custom script: call DestroyGroup(g)
      • Custom script: set g=null
  • Dark Summoning llego
    • Events
      • Game - Nojump_event becomes Igual a 1.00
    • Conditions
      • (Unit-type of Nojump_Unit) Igual a Essence
    • Actions
      • Custom script: set udg_Atemp_Int3=GetHandleIdBJ(udg_Nojump_Unit)
      • Set Temp_Loc = (Position of Nojump_Unit)
      • Unit - Move (Load Atemp_Int3 of 5 in Dark_Summoning_datos) instantly to Temp_Loc
      • Custom script: call RemoveLocation(udg_Temp_Loc)
      • Unit - Remove Nojump_Unit from the game
      • Unit - Unhide (Load Atemp_Int3 of 5 in Dark_Summoning_datos)
      • Unit - Unpause (Load Atemp_Int3 of 5 in Dark_Summoning_datos)
      • Special Effect - Destroy (Load Atemp_Int3 of 3 in Dark_Summoning_datos)
      • Custom script: set udg_Temp_Sound=CreateSound("Abilities\\Spells\\Undead\\Possession\\PossessionMissileHit1.wav", false, true, true, 10, 10, "DefaultEAXON")
      • Sound - Play Temp_Sound at 100.00% volume, attached to (Load Atemp_Int3 of 5 in Dark_Summoning_datos)
      • Sound - Destroy Temp_Sound
      • Custom script: call RemoveSavedHandle(udg_Dark_Summoning_datos,3,udg_Atemp_Int3)
      • Custom script: call RemoveSavedHandle(udg_Dark_Summoning_datos,5,udg_Atemp_Int3)
 
Last edited:
Level 24
Joined
Jun 26, 2020
Messages
1,850
  • Dark Summoning
    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
      • ((Ability being cast) Equal to Dark Summoning (mio)) or ((Ability being cast) Equal to Dark Summoning (Hero))
    • Actions
      • Custom script: local group g
      • Custom script: set g=CreateGroup()
      • -------- Select heros --------
      • Set Locacion_Variable[41] = (Target point of ability being cast)
      • Set Grupo_Unidad_Variable[21] = (Random 5 units from (Units within 700.00 of Locacion_Variable[41] matching ((((Matching unit) is A hero) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True))))
      • Custom script: loop
      • Custom script: set udg_Atemp_Unit2=FirstOfGroup(udg_Grupo_Unidad_Variable[21])
      • Custom script: exitwhen udg_Atemp_Unit2==null
      • Custom script: if (IsUnitInGroup(udg_Atemp_Unit2,udg_Dark_Summoning_Heros)==false) then
      • Custom script: set udg_Atemp_Int3=GetHandleIdBJ(udg_Atemp_Unit2)
      • Special Effect - Create a special effect attached to the origin of Atemp_Unit2 using Abilities\Spells\Undead\Darksummoning\DarkSummonTarget.mdl
      • Hashtable - Save Handle Of(Last created special effect) as Atemp_Int3 of 3 in Dark_Summoning_datos
      • Custom script: call GroupAddUnitSimple(udg_Atemp_Unit2,g)
      • Unit Group - Add Atemp_Unit2 to Dark_Summoning_Heros
      • Custom script: endif
      • Unit Group - Remove Atemp_Unit2 from Grupo_Unidad_Variable[21]
      • Custom script: endloop
      • Custom script: call DestroyGroup(udg_Grupo_Unidad_Variable[21])
      • Custom script: call RemoveLocation(udg_Locacion_Variable[41])
      • -------- Wait --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Dark Summoning (mio)
        • Then - Actions
          • Set Temp_Real = (7.00 - (2.00 x (Real((Level of Dark Summoning (mio) for (Triggering unit))))))
        • Else - Actions
          • Set Temp_Real = (6.00 - (Real((Level of Dark Summoning (Hero) for (Triggering unit)))))
      • Wait Temp_Real seconds
      • -------- Send Heros --------
      • Custom script: loop
      • Custom script: set udg_Atemp_Unit2=FirstOfGroup(g)
      • Custom script: exitwhen udg_Atemp_Unit2==null
      • Set Temp_Loc = (Position of Atemp_Unit2)
      • Unit - Create 1 Essence for (Owner of Atemp_Unit2) at Temp_Loc facing Temp_Loc2
      • Custom script: call RemoveLocation(udg_Temp_Loc)
      • Custom script: set udg_Temp_Sound=CreateSound("Abilities\\Spells\\Undead\\Possession\\PossessionMissileLaunch1.wav", false, true, true, 10, 10, "DefaultEAXON")
      • Sound - Play Temp_Sound at 100.00% volume, attached to (Last created unit)
      • Sound - Destroy Temp_Sound
      • Set Atemp_Int3 = (Key (Last created unit))
      • -------- Jump System --------
      • Set JDA_Unit = (Last created unit)
      • Custom script: call DestroyEffectBJ(LoadEffectHandleBJ(GetHandleIdBJ(udg_Atemp_Unit2),3, udg_Dark_Summoning_datos))
      • Custom script: call RemoveSavedHandle(udg_Dark_Summoning_datos,3,udg_Atemp_Int3)
      • If (((Owner of (Triggering unit)) is in Grupo_Draeneanos) Equal to True) then do (Set Temp_Loc2 = (Random point in Draeneanos)) else do (Set Temp_Loc2 = (Random point in Demonios))
      • Set JDA_TargetPoint = Temp_Loc2
      • Special Effect - Create a special effect at Temp_Loc2 using Abilities\Spells\Undead\Darksummoning\DarkSummonTarget.mdl
      • Hashtable - Save Handle Of(Last created special effect) as Atemp_Int3 of 3 in Dark_Summoning_datos
      • Set JDA_Speed = 30.00
      • Set JDA_SpecialEffect = <Cadena vacÃa>
      • Set JDA_Animation = <Cadena vacÃa>
      • Set JDA_AnimationSpeed = 1.00
      • Set JDA_JumpHigh_Distance = 0.00
      • Set JDA_DestroyTrees_Dash = False
      • Trigger - Run Jump System 1 <gen> (checking conditions)
      • Hashtable - Save Handle OfAtemp_Unit2 as Atemp_Int3 of 5 in Dark_Summoning_datos
      • Unit - Hide Atemp_Unit2
      • Unit - Pause Atemp_Unit2
      • Custom script: call GroupRemoveUnitSimple(udg_Atemp_Unit2,g)
      • Unit Group - Remove Atemp_Unit2 from Dark_Summoning_Heros
      • Custom script: endloop
      • Custom script: set udg_Temp_Loc2=null
      • Custom script: call DestroyGroup(g)
      • Custom script: set g=null
@GIMLI_2 Really? and that's not even the problem.
 
Level 19
Joined
Feb 27, 2019
Messages
577
SimError talks about a bug with sounds played for the first time. That bug should be fixed from version 1.22 and later though.
 
Level 8
Joined
Jan 28, 2016
Messages
486
SimError talks about a bug with sounds played for the first time. That bug should be fixed from version 1.22 and later though.
I do recall SimError stating that it was resolved with v1.22 but as far as I know, that bug still exists. This thread had a similar issue and resolves the issue by preloading" the sound at the start of the map, which is what I used to do with my maps back in the day.

I'm almost certain this bug is the reason why your sound won't play the first time @HerlySQR.
 
Level 24
Joined
Jun 26, 2020
Messages
1,850
I do recall SimError stating that it was resolved with v1.22 but as far as I know, that bug still exists. This thread had a similar issue and resolves the issue by preloading" the sound at the start of the map, which is what I used to do with my maps back in the day.

I'm almost certain this bug is the reason why your sound won't play the first time @HerlySQR.
Well, at the end I did the same thing.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
WC3 cannot play the sound initially as it has not not loaded. It plays it the second time as it loaded the sound in response to the first time so it is not available to be played back.

Games usually have some tolerance for this sort of thing, allowing a sound to playback up to X seconds late before playback is outright skipped. I am guessing that either trigger played sounds have no tolerance, or the tolerance is so small it is not practical for the sound to get loaded during that time.
 
Status
Not open for further replies.
Top