• 🏆 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!

How to make unleak Speciel Effect?

Status
Not open for further replies.
Level 15
Joined
Dec 19, 2007
Messages
1,233
  • chained up
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Together
    • Actions
      • Trigger - Run Run Destroy chain <gen> (ignoring conditions)
      • Set A = (Player number of (Owner of (Triggering unit)))
      • Set p = (Position of (Triggering unit))
      • Set p2 = (Position of (Target unit of ability being cast))
      • Set playertarget[A] = (Target unit of ability being cast)
      • Lightning - Create a Magic Leash lightning effect from source p to target p2
      • Set Playerchain_Copy[A] = (Last created lightning effect)
      • Set keepchain[A] = True
      • Set KeepPLAYERCHAIN[A] = True
      • Custom script: call RemoveLocation (udg_p)
      • Custom script: call RemoveLocation (udg_p2)
      • Trigger - Turn on every second 1 time <gen>
      • Trigger - Turn on every second 4 times <gen>
  • every second 4 times
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set MAX = 0
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set A = (Integer A)
          • For each (Integer A) from 1 to 13, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KeepPLAYERCHAIN[A] Equal to True
                • Then - Actions
                  • Set MAX = (MAX + 1)
                  • Set p = (Position of playerhero[A])
                  • Set p2 = (Position of playertarget[A])
                  • Lightning - Move Playerchain_Copy[A] to source p and target p2
                  • Custom script: call RemoveLocation (udg_p)
                  • Custom script: call RemoveLocation (udg_p2)
                • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MAX Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • every second 1 time
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set MAX = 0
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set A = (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • keepchain[A] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (playerhero[A] is alive) Equal to True
                  • (playertarget[A] is alive) Equal to True
                • Then - Actions
                  • Set MAX = (MAX + 1)
                  • Set p = (Position of playerhero[A])
                  • Set p2 = (Position of playertarget[A])
                  • Set real = (Distance between p and p2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • real Greater than or equal to 700.00
                    • Then - Actions
                      • Unit - Move playerhero[A] instantly to p2
                      • Special Effect - Create a special effect at p2 using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Set ug = (Units within 200.00 of p2 matching ((((Matching unit) belongs to an enemy of (Player(A))) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) is alive) Equal to True))))
                      • Special Effect - Create a special effect at p using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Unit Group - Pick every unit in ug and do (Actions)
                        • Loop - Actions
                          • Unit - Cause playerhero[A] to damage (Picked unit), dealing ((Real((Level of Chain Together for playerhero[A]))) x 50.00) damage of attack type Spells and damage type Magic
                      • Unit - Order playerhero[A] to Attack playertarget[A]
                      • Set keepchain[A] = False
                      • Trigger - Run Run Destroy chain <gen> (ignoring conditions)
                    • Else - Actions
                  • Custom script: call RemoveLocation (udg_p)
                  • Custom script: call RemoveLocation (udg_p2)
                  • Custom script: call DestroyGroup (udg_ug)
                • Else - Actions
                  • Set keepchain[A] = False
                  • Trigger - Run Run Destroy chain <gen> (ignoring conditions)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MAX Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Run Destroy chain
    • Events
    • Conditions
    • Actions
      • Set KeepPLAYERCHAIN[A] = False
      • Lightning - Destroy Playerchain_Copy[A]
  • by purching
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Set A = (Player number of (Owner of (Sold unit)))
      • Set playerhero[A] = (Sold unit)
      • Game - Display to (All players) for 10.00 seconds the text: (((Player + (Name of (Player(A)))) + choosen ) + (Name of playerhero[A]))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player number of (Owner of (Sold unit))) Less than or equal to 5
        • Then - Actions
          • Set p = (Center of Region 016 <gen>)
        • Else - Actions
          • Set p = (Center of Region 017 <gen>)
      • Unit - Move playerhero[A] instantly to p
      • Custom script: call RemoveLocation (udg_p)
When I am using the lightning effect skill - it results in game crush, lags, and not responding in time game.
I need help only about the lightning effect, since it the only thing that cause this.
How to make unleak lightning effect? (miss write the title :goblin_boom:)
:ogre_haosis:
 
Last edited by a moderator:

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
There is an action: Destroy (Lightning effect).
Lol, double (Integer A) loop? I'll be reviewing your triggers now, trying to help you us much as I can :p

OMG the playerhero[A] isn't set!

First portion:
(Owner of (Trigger unit)) -> (Triggering player)
Replace p2 and playertarget[A] lines to get rid of double (Target unit of ability being cast) calling
  • chained up
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Together
    • Actions
      • Trigger - Run Run Destroy chain <gen> (ignoring conditions)
      • Set A = (Player number of (Triggering player))
      • Set playertarget[A] = (Triggering unit)
      • Set p = (Position of playertarget[A])
      • Set playertarget[A] = (Target unit of ability being cast)
      • Set p2 = (Position of playertarget[A])
      • Lightning - Create a Magic Leash lightning effect from source p to target p2
      • Set Playerchain_Copy[A] = (Last created lightning effect)
      • Set keepchain[A] = True
      • Set KeepPLAYERCHAIN[A] = True
      • Custom script: call RemoveLocation (udg_p)
      • Custom script: call RemoveLocation (udg_p2)
      • Trigger - Turn on every second 1 time <gen>
      • Trigger - Turn on every second 4 times <gen>
 
Level 15
Joined
Dec 19, 2007
Messages
1,233
Whats the point of nested loop within 'every second 4 times'? It does exactly the same each time.

Main problem here is probably playerhero[] variable. You set it only in 'by purching' trigger.

The game works perfectly untill the moment I use the spell, I tried to outpost "MAX" as a text on the screen, instead of "1" it is writing "13" - meaning each and every number in the loop to test about "PLAYERCHAIN" was true :vw_wtf::vw_wtf::vw_wtf::vw_wtf::vw_wtf::vw_wtf:
The thing that causes the lag is only this one, and because it has lightning effect in it, should I make the lightning effect removed any time I spawn it like special effect? or moving it was ok?

Edit: It is very odd case, but I think it has something to do with World Editor bug since now after i tried re-edit it 10000 times, it don't make the game fail, instead, it still count 1 player that IS in the "True" zone as 13 players instead of one -_- very odd, but atlist now it not interfear with my spell so I simply don't care, thanks for encouraging , dunno if I should count this as "solved" since I still have no idea why it count 13 Boolings that are false on default , as true.
 
Last edited by a moderator:
Status
Not open for further replies.
Top