Battlecharge Wont Work!? Its Perfect!?

TPOX

New Member
Reaction score
10
Heres my battlecharge triggers, from all i see it should work. What this trigger does is when u cast ability on someone distance variable is the distance u were from them and you when u casted ability. And Distance2 is the distance u are after the 2 seconds and when ur speed goes back to normal. But after u get to the target no dmg is inflicted but the DMG indicator shows up as its supposed to and appropriate distance.

Code:
Battle Charge TEST
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Battle Charge 
    Actions
        Wait 0.00 seconds
        Set TempReal = 0.00
        Set Distance = (Integer((Distance between (Position of (Casting unit)) and (Position of (Target unit of ability being cast)))))
        Unit - Order (Casting unit) to Attack (Target unit of ability being cast)
        Unit - Set (Casting unit) movement speed to 800.00
        Wait 2.00 seconds
        Unit - Set (Casting unit) movement speed to (Default movement speed of (Triggering unit))
        Set Distance2 = (Integer((Distance between (Position of (Casting unit)) and (Position of (Target unit of ability being cast)))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Distance2 Less than 2000
            Then - Actions
                Unit - Order (Casting unit) to damage (Target unit of ability being cast) for (1.00 x (Real(Distance))) using attack type Normal and damage type Universal.
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Distance2 Greater than 2000
            Then - Actions
                Unit - Order (Casting unit) to Stop
            Else - Actions
                Do nothing
        Set TempReal = (Real((1 x Distance)))
        Floating Text - Create floating text that reads ((|cffff0000 + (String((Integer(TempReal))))) + ( Damage + <Empty String>)) at (Position of (Casting unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        Set TempFloatText = (Last created floating text)
 
Well, you can get rid of the second if/then/else. Just put its "then" action into the "else" area of the first if/then/else.
 
Your problem is probably that (Target unit of ability being cast) is reset after a wait (a bug). Set a variable to it at the beginning of the trigger.

(As a side note, you do know that it won't be possible to cast this multiple times at the same time, right?)
 
ah ya i see what u mean for the if then else lol

ill try making a variable for the casted unit but what did u mean

(As a side note, you do know that it won't be possible to cast this multiple times at the same time, right?)
 
TPOX said:
...but what did u mean
Okay, here's the first part of your trigger:
Code:
Battle Charge TEST
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Battle Charge 
    Actions
        Wait 0.00 seconds
        Set TempReal = 0.00
        [i]{A}[/i] [b]Set [u]Distance[/u] = (Integer((Distance between (Position of (Casting unit)) and (Position of (Target unit of ability being cast)))))[/b]
        Unit - Order (Casting unit) to Attack (Target unit of ability being cast)
        Unit - Set (Casting unit) movement speed to 800.00
        [i]{B}[/i] [b]Wait 2.00 seconds[/b]
        Unit - Set (Casting unit) movement speed to (Default movement speed of (Triggering unit))
        Set Distance2 = (Integer((Distance between (Position of (Casting unit)) and (Position of (Target unit of ability being cast)))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Distance2 Less than 2000
            Then - Actions
                [i]{C}[/i] [b]Unit - Order (Casting unit) to damage (Target unit of ability being cast) for (1.00 x (Real([u]Distance[/u]))) using attack type Normal and damage type Universal.[/b]
            Else - Actions
        [i]<...>[/i]
The Distance variable, for example. Let's say some casts Battle Charge and activates this trigger. At line A, we set our variable Distance to a value. Then we get to B, which waits for two seconds. Now say that in these two seconds someone casts Battle Charge again. The second time it runs, we go to line A, which replaces the value of the Distance variable... then we go to B, which waits for two seconds. Now the wait in the first time through is done, so we proceed foward... when we get to line C it uses the value of Distance set by the second time through, not the first. So it messes up if cast multiple times all at once.
 
BTW, set the speed b4 you order the unit to atk.
It just cleans things up and makes it more perfect :)

just if you want another confirmation, yes hepta speaks true.
You could make it work if you used arrays
 
well make the index the number of players there is going to be playing.

And make an action IF/then/else

and at the IF, and if another player is doing the spell, assign a new index.

just do that around 10 times over and you're good..

You would set a player array with <number of players> for index and you would set it..
im talking too much..
Its hard to explain but I could probably come with the trigger. But since I am planning to wipe out my hard drive and instal tiger for my mac os x. I already uninstalled Wc3 to be ready. ( i saved my maps to a flashdrive)
 
Ah, well, that'd work if you were only casting it once per player. Which isn't always the case.
 
You may be able to find some info off of my CoH triggers (will post later today if you're still having trouble).
 
Why everybody is afraid of locals?
You only need to declare a real variable at the trigger beginning
Then use it every time you need the Distance
It's thread safe, trigger safe and some-other-things safe
Also WEU has lots of stuff to use locals without going into pure JASS

Locals are your best friends
They're not like your girlfriend, but like a good friend :D
 
the cooldown is 15 seconds or so, so casting it more then once at once isnt a problem.

Heres what i did instead:

Code:
Battle Charge
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Battle Charge 
    Actions
        Set TempReal = 0.00
        Set TargetUnitOfAbilityBeingCast = (Target unit of ability being cast)
        Set Distance = (Integer((Distance between (Position of (Casting unit)) and (Position of TargetUnitOfAbilityBeingCast))))
        Unit - Order (Casting unit) to Attack TargetUnitOfAbilityBeingCast
        Unit - Set (Casting unit) movement speed to 800.00
        Set Wait = (Create a periodic One-shot timer lasting 7.00)
        Wait until (((Integer((Distance between (Position of (Casting unit)) and (Position of TargetUnitOfAbilityBeingCast)))) Less than or equal to 200) or (((Current order of (Casting unit)) Equal to (Order(smart))) or ((Integer((Remaining time for Wait))) Equal to 0))), checking every 1.00 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Integer((Distance between (Position of (Casting unit)) and (Position of TargetUnitOfAbilityBeingCast)))) Less than or equal to 200
            Then - Actions
                Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + (10.00 x (Real((Level of Battle Charge  for (Casting unit))))))
                Unit - Set (Casting unit) movement speed to (Default movement speed of (Casting unit))
                Unit - Order (Casting unit) to damage TargetUnitOfAbilityBeingCast for (1.00 x (Real(Distance))) using attack type Normal and damage type Universal.
                Unit - Create 1 Peasant for (Owner of (Casting unit)) at (Position of TargetUnitOfAbilityBeingCast) facing (Position of TargetUnitOfAbilityBeingCast)
                Unit - Set Level of Battle Charge (Dummy) for (Last created unit) to (1 x (Level of Battle Charge  for (Casting unit)))
                Unit - Add a 0.01 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Neutral - Firebolt TargetUnitOfAbilityBeingCast
                Set TempReal = (Real((1 x Distance)))
                Floating Text - Create floating text that reads ((|cffFFFF00 + (String((Integer(TempReal))))) + ( Damage + <Empty String>)) at (Position of (Casting unit)) with Z offset 0.00, using font size 12.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
                Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                Set TempFloatText = (Last created floating text)
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Current order of (Casting unit)) Equal to (Order(smart))
            Then - Actions
                Unit - Set (Casting unit) movement speed to (Default movement speed of (Casting unit))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Integer((Remaining time for Wait))) Equal to 0
            Then - Actions
                Unit - Set (Casting unit) movement speed to (Default movement speed of (Casting unit))
            Else - Actions
                Do nothing
 
TPOX said:
the cooldown is 15 seconds or so, so casting it more then once at once isnt a problem.
As long as you can assume that this won't be cast by multiple players at the same time either.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1
  • The Helper The Helper:
    Weekend went by too fast. Next weekend I am going to try to do a nature thing - buddy of mine lives by the Colorado river and has some kayaks and invited me to do some kayaking from a place he knows to get on the river.

The Helper Discord

Staff online

  • Ghan
    Administrator - Servers are fun

Members online

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top