Creating a Ability

robinremue

Member
Reaction score
16
I want to create this ability.
A unit casts the ability, then a beam comes shooting toward the targeted unit, I did it until this part. Then I want flame strikes to show up like this:

Caster-Flamestrike-Flamestrike-Flamestrike-Flamestrike-Flamestrike-Target

If you get what I mean, could someone help me plz :D
 
Set CasterPoint = position of casting unit
Set TargetPoint = position of target unit of ability being cast
Set Angle = angle between CasterPoint and TargetPoint
Set Offset = (distance between CasterPoint and TargetPoint) / 6
Set Distance = Offset

For each Integer A from 1 to 5 do
- Special effect - create effect at CasterPoint offset by Distance with angle Angle (point with polar offset) using model "FlameStrike"
- Special effect - destroy (last created special effect)
- Set Distance = Distance + Offset


However, that might look somewhat strange if the units are too close, or really far.
 
Thanks, so I would better give the ability a minimun range??
What kind of variables are Angle, Offset and Distance??
 
> so I would better give the ability a minimun range?

Depends on how complicated you want this.
But, if they are really close, like at melee range, creating 5 flame strikes in between their feet...

You could try to do:
If distance less than 200 then create only 1
or, distance between 200 and 400 then create 3

Or, starting at the caster's position, you create one every 50 until you reach the target...
That one would be very dynamic, the closer you are, the less are created.

> What kind of variables are Angle, Offset and Distance?

Real. All three.
 
Great thanks very much
But how do you add the /6 on the distance between target and casterpoint??

I now have this

Code:
AnimationAbility
    Events
        Unit - A unit owned by Player 1 (Red) Begins casting an ability
    Conditions
        (Ability being cast) Equal to Final Flash 
    Actions
        Set CasterPoint = (Position of (Casting unit))
        Set TargetPoint = (Position of (Target unit of ability being cast))
        Set Angle = (Angle from CasterPoint to TargetPoint)
        Set Offset = (Distance between CasterPoint and TargetPoint)
        Set Distance = Offset
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at (CasterPoint offset by Distance towards Angle degrees) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
                Wait 2.00 game-time seconds
                Special Effect - Destroy (Last created special effect)
                Set Distance = (Distance + Offset)
 
Arithmetic.
(Change the "value" to "distance between ...", the "+" to "/" and the "1" to "6")


EDIT:
> Wait 2.00 game-time seconds
> Special Effect - Destroy (Last created special effect)

should be

> Special Effect - Destroy (Last created special effect)
> Wait 2.00 game-time seconds

Do you need the "wait"? Try without...
 
Code:
Final Flash
    Events
        Unit - A unit owned by Player 1 (Red) Begins channeling an ability
    Conditions
        (Ability being cast) Equal to Final Flash 
    Actions
        Set CasterPoint = (Position of (Casting unit))
        Set TargetPoint = (Position of (Target unit of ability being cast))
        Set Angle = (Angle from CasterPoint to TargetPoint)
        Set Offset = ((Distance between CasterPoint and TargetPoint) / 6.00)
        Set Distance = Offset
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at (CasterPoint offset by Distance towards Angle degrees) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
                Wait 1.00 seconds
                Special Effect - Destroy (Last created special effect)
                Set Distance = (Distance + Offset)

Yes It doesn't work without the wait time :confused:
But when I test the ability, the flamestrikes are created at the feet of the casting hero :confused:
 
I changed that,

--> I target a unit then a flamestrike comes after some seconds a second comes really close to the old one and he does that 3 times, It looks really weird :confused:

You wrote, set angle: ... between...
I got set angle: ... from ....???
 
Hm...

If you add a couple "Game - Display to (all players)", showing
- the name of the "target unit of ability being cast"
- the "offset", after you set it
- the "distance", inside the loop

Does it make sense? Is the Offset shorter if you're closer?


Also, you're using "channels an ability" as event.
You could try "starts the effect".


As for the "from" and "between", well, I'm typing this from (weak) memory.
No editor in front of me... ;)
 
IT WORKS, I just needed to change the event lol :D

But its pretty slow, I mean, the enemy is dead before the flames reach him :)
 
> But its pretty slow, I mean, the enemy is dead before the flames reach him

:D

Don't "wait" so long. Don't kill so fast...


That said, if you feel like it:

Code:
FlameStrikeToTarget
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to <some ability that targets a unit>
    Actions
        Set tmpReal = 96.00
        Set CasterPoint = (Position of (Casting unit))
        Set TargetPoint = (Position of (Target unit of ability being cast))
        Set Angle = (Angle from CasterPoint to TargetPoint)
        Set tmpInteger = (Integer(((Distance between CasterPoint and TargetPoint) / tmpReal)))
        Set Distance = 0.00
        For each (Integer A) from 1 to tmpInteger, do (Actions)
            Loop - Actions
                Set Distance = (Distance + tmpReal)
                Special Effect - Create a special effect at (CasterPoint offset by Distance towards Angle degrees) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
                Set FlameEffects[(Integer A)] = (Last created special effect)
                Wait 0.10 game-time seconds
        Wait 2.00 game-time seconds
        For each (Integer A) from 1 to tmpInteger, do (Actions)
            Loop - Actions
                Special Effect - Destroy FlameEffects[(Integer A)]

(That's with editor...)

That would be the "dynamic" version mentioned earlier.
To have more or less flames, all you need to change is the "96" for "tmpReal" (bigger = less).
"FlameEffects" is an array of "special effects", size... at least 20.


Happy mapping,
AceHart
 
hehe, I'll implement when I have some time, need to do homework now :mad:

But really really thanks

?? tmpReal = real variable??
?? tmpInteger= Integer Variable??
 
> need to do homework

Excellent.


> tmpReal = real variable?
> tmpInteger= Integer Variable?

And there I thought the names would be clear... ah, well...
So, hm, yes.
 
Homework can wait a bit :)

Can't find this line

Code:
set tmpInteger = (Integer(((Distance between CasterPoint and TargetPoint) / tmpReal)))

I setted tmpInteger as an integer variable

So for the moment I have this

Code:
Final Flash Animation
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Final Flash attack,slam
    Actions
        Set tmpReal = 96.00
        Set Casterpoint = (Position of (Casting unit))
        Set Targetpoint = (Position of (Target unit of ability being cast))
        Set Angle = (Angle from Casterpoint to Targetpoint)
     [U][B] Set tmpInteger = 0[/B][/U]
        Set Distance = 0.00
        For each (Integer A) from 1 to tmpInteger, do (Actions)
            Loop - Actions
                Set Distance = (Distance + tmpReal)
                Special Effect - Create a special effect at (Casterpoint offset by Distance towards Angle degrees) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
                Set FlameEffects[(Integer A)] = (Last created special effect)
                Wait 0.10 game-time seconds
        Wait 2.00 game-time seconds
        For each (Integer A) from 1 to tmpInteger, do (Actions)
            Loop - Actions
                Special Effect - Destroy FlameEffects[(Integer A)]
 
Since both "Distance between CasterPoint and TargetPoint" and "tmpReal" are of type "real",
the result is also "real".
But, we need an Integer.

So, a quick, or so, look in the functions list... "Conversion - convert Real to Integer".
Then some arithmetic, done.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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.
  • Ghan Ghan:
    That sounds like an adventure.
  • The Helper The Helper:
    400 users all online all looking at latest content
  • The Helper The Helper:
    I wonder how all these bots that sit on the lastest content page get passed anubis or maybe they did not but they are just registering on whos online
  • The Helper The Helper:
    showing up on whos online not registration
  • Ghan Ghan:
    The first gate is stopping all the bots that don't execute javascript.
  • Ghan Ghan:
    That's the main thing with Anubis - no Javascript, no site. Typically you can still get the site to load without Javascript.
  • The Helper The Helper:
    I remember the whole javascript thing, question - how many real people disable that?
  • The Helper The Helper:
    Hell I guess I could go back on the stats to know that - we probably capture that and we know the before and after
  • Ghan Ghan:
    Real users can't really disable Javascript anymore these days.
  • Ghan Ghan:
    The internet is broken without it.
  • Ghan Ghan:
    Bot readable, not human usable.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Check out the new Featured Content feature we apparently got with the forum software upgrade! https://www.thehelper.net/featured/

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top