• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Very lag after choosing hero

Status
Not open for further replies.
Level 5
Joined
May 17, 2007
Messages
106
Hi, there
I've some problem when choosing hero after choose it's hell lag for short time, is (Owner of (Buying unit)) leaks? Thanks

  • Special Operator
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Special Operator
    • Actions
      • Set Sniper = (Sold unit)
      • Camera - Set the camera bounds for (Owner of (Buying unit)) to (Playable map area)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Buying unit)) Equal to Player 1 (Red)
              • (Owner of (Buying unit)) Equal to Player 2 (Blue)
              • (Owner of (Buying unit)) Equal to Player 4 (Purple)
              • (Owner of (Buying unit)) Equal to Player 5 (Yellow)
        • Then - Actions
          • Set ABTempRevivePoint = (Random point in Hero Spawn T1 <gen>)
          • Unit - Move (Buying unit) instantly to ABTempRevivePoint
          • Unit - Move (Sold unit) instantly to ABTempRevivePoint, facing Default building facing degrees
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (No Tower Mode Check <gen> is on) Equal to False
            • Then - Actions
              • Unit - Create 1 Peasant for (Owner of (Buying unit)) at ABTempRevivePoint facing Default building facing degrees
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Buying unit)) Equal to Player 6 (Orange)
              • (Owner of (Buying unit)) Equal to Player 7 (Green)
              • (Owner of (Buying unit)) Equal to Player 10 (Light Blue)
              • (Owner of (Buying unit)) Equal to Player 12 (Brown)
        • Then - Actions
          • Set ABTempRevivePoint = (Random point in Hero Spawn T2 <gen>)
          • Unit - Move (Buying unit) instantly to ABTempRevivePoint
          • Unit - Move (Sold unit) instantly to ABTempRevivePoint, facing Default building facing degrees
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (No Tower Mode Check <gen> is on) Equal to False
            • Then - Actions
              • Unit - Create 1 Peasant for (Owner of (Buying unit)) at ABTempRevivePoint facing Default building facing degrees
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Buying unit)) Equal to Player 3 (Teal)
        • Then - Actions
          • Set ABTempRevivePoint = (Random point in Region 034 <gen>)
          • Unit - Move (Buying unit) instantly to ABTempRevivePoint
          • Unit - Move (Sold unit) instantly to ABTempRevivePoint, facing Default building facing degrees
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (No Tower Mode Check <gen> is on) Equal to False
            • Then - Actions
              • Unit - Create 1 Peasant for (Owner of (Buying unit)) at ABTempRevivePoint facing Default building facing degrees
            • Else - Actions
          • Player - Set the max research level of Legendary Creature Power to 1 for (Owner of (Buying unit))
        • Else - Actions
      • Unit Group - Add Sniper to ItemPickerGroup
      • Set ABTempRevivePoint = (Position of (Sold unit))
      • Camera - Pan camera for (Owner of (Buying unit)) to ABTempRevivePoint over 0.00 seconds
      • Selection - Select (Sold unit) for (Owner of (Buying unit))
      • Custom script: call RemoveLocation(udg_ABTempRevivePoint)
      • Player - Set the max research level of Life Bonus to 10 for (Owner of (Buying unit))
      • Player - Set the max research level of Life Regeneration to 5 for (Owner of (Buying unit))
      • Player - Set the max research level of Mana Regeneration to 10 for (Owner of (Buying unit))
 
Mainly its not the unit which causes the lag . The custom abilitys do so
I tested it once - after adding the abilitys to a dummy placed on the map it was solved ( same as the hero ) .The lag depends on the level of the custom abilities. for example 3 skills with 3 levels + ultimate will not really cause an lag but a spell with 100 levels will be insane :bored:
 
units do need preloading too, trust me, i know when training custom unit, it had no abilities, but it lagged for like second and half, and others were trained fine. Models need preloading.
JASS:
call Preload("YOURMODELFILE.mdx")

note that if modelname includes "\" you must write "\\" instead, for example
JASS:
call Preload("Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl")

Just make a custom script, and paste lines i wrote, and use models you need.
 
Status
Not open for further replies.
Top