(Possibly) tricky ability question

Corleone

New Member
Reaction score
44
Hey,
I've been working on a map for some time and I want my units ( tanks ) to have an ability to fire one bullet. I tried basing it off Carrion Swarm, but then the bullet can move through walls, and doesnt disappear when it hits an enemy. So, since I hardly have any experience with abilities, I ask for your help.
The ability should:
- Not be visible, nor deal any damage after it collides with a wall
- Disappear when it hits an enemy
Optional
- If two bullets collide, they both explode // destroy eachother.

What should I base it on, and how should I trigger it ( if necessary )?
 

Some1Sneakin

New Member
Reaction score
5
Sorry but it i dont think if all that is possible atleast not with that it destroys when it hit a wall and it explodes when hit another.

Maybe something of that is possible but im not sure i will see if it can get it to work
 

Corleone

New Member
Reaction score
44
I just got an idea, actually. Could it be possible to determine the angle between the casting unit and the target of the ability being cast? Then I could create a unit and order it to move towards that direction, and give it a constantly turned on immolation with 9999 dps. That would also make it possible to kill it when it exits the "arena" and when it collides with another bullet; because I could give it 1 hp. Anyway, anyone got an idea on how to figure out what the firing angle is and how to make the unit move towards that point? :p
 

hi_im_bob

......and you are?
Reaction score
44
Maybe this?

Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing (Facing of (Triggering unit)) degrees
 

Corleone

New Member
Reaction score
44
Well, i know how to make the bullet, but the hard part is to make it move in a specific direction. The only way I can think of to do this is to make 360 region ( one for each facing-angle degree ) but making that would just suck..
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,491
> Could it be possible to determine the angle between the casting unit and the target of the ability being cast?

Set myRealVariable = Angle between points.
 

Corleone

New Member
Reaction score
44
Well, I tried using this trigger, but the bullet wouldn't actually move ( so setting the new target didn't really work ). How can I fix this? Should I just make it 2 If//Then//Else statements, or edit something else? I probably made it way more complicated than it should be :p

Code:
Triggered Fire
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Fire! 
    Actions
        Set FireTarget = (Target point of ability being cast)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Y of FireTarget) Less than (Y of (Position of (Triggering unit)))
            Then - Actions
                Set BulletTargetY = (Point(0.00, ((Distance between (Point(0.00, (Y of FireTarget))) and (Point(0.00, (Y of (Position of (Triggering unit)))))) / 5.00)))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Y of FireTarget) Greater than (Y of (Position of (Triggering unit)))
            Then - Actions
                Set BulletTargetY = (Point(0.00, ((Distance between (Point(0.00, (Y of FireTarget))) and (Point(0.00, (Y of (Position of (Triggering unit)))))) x 5.00)))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (X of FireTarget) Less than (X of (Position of (Triggering unit)))
            Then - Actions
                Set BulletTargetX = (Point(((Distance between (Point((X of FireTarget), 0.00)) and (Point((X of (Position of (Triggering unit))), 0.00))) / 5.00), 0.00))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (X of FireTarget) Greater than (X of (Position of (Triggering unit)))
            Then - Actions
                Set BulletTargetX = (Point(((Distance between (Point((X of FireTarget), 0.00)) and (Point((X of (Position of (Triggering unit))), 0.00))) x 5.00), 0.00))
            Else - Actions
                Do nothing
        Set BulletTarget = (Point((X of BulletTargetX), (Y of BulletTargetY)))
        Unit - Create 1 Bullet for Player 12 (Brown) at (Position of (Triggering unit)) facing BulletTarget
        Set Bullet = (Last created unit)
        Unit - Order Bullet to Move To BulletTarget
        Wait until ((Distance between (Position of (Triggering unit)) and (Position of Bullet)) Greater than or equal to 40.00), checking every 0.10 seconds
        Unit - Order Bullet to Night Elf Demon Hunter - Activate Immolation
        Custom script:   call RemoveLocation ( udg_BulletTarget )
        Custom script:   call RemoveLocation ( udg_BulletTargetX )
        Custom script:   call RemoveLocation ( udg_BulletTargetY )
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,491
"Point with polar offset" is your friend.

Set myPoint = Position of (Casting unit) offset by 800 towards (Angle from (Position of (Casting unit) to Position of (Target point of ability being cast))
Unit - Order Bullet to move to myPoint


Don't use "begins casting" in triggered spells. Go with "starts the effect of".
 

Corleone

New Member
Reaction score
44
Well, for some reason, the bullet travels a random distance now. Sometimes it goes through the entire map ( as intended ) and sometimes it just stops for no reason.
Trigger :

Code:
Fire Target
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Fire! 
    Actions
        Set FireTarget = (Target point of ability being cast)
        Set FireAngle = (Angle from (Position of (Triggering unit)) to FireTarget)
        Set BulletTarget = ((Position of (Triggering unit)) offset by 1000.00 towards FireAngle degrees)
        Unit - Create 1 Bullet for Neutral Hostile at (Position of (Triggering unit)) facing BulletTarget
        Set Bullet = (Last created unit)
        Unit - Order Bullet to Move To BulletTarget
        Wait 1.00 seconds
        Unit - Order Bullet to Night Elf Demon Hunter - Activate Immolation
        Custom script:   call RemoveLocation ( udg_BulletTarget )
        Custom script:   call RemoveLocation ( udg_FireTarget )
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,491
There's always a reason :p

Like, the point is outside the playable map.
Or it's in the middle of a doodad.
It's in deep water.
...


You could try to test for the pathability of that point.

Alternatively, remember the direction it needs to go, and use a periodic trigger or timer to move it in smaller steps.

I would also activate immolation right after creation, then order the move, to remove that "wait".
 

Corleone

New Member
Reaction score
44
There's always a reason :p

Like, the point is outside the playable map.
Or it's in the middle of a doodad.
It's in deep water.
...


You could try to test for the pathability of that point.

Alternatively, remember the direction it needs to go, and use a periodic trigger or timer to move it in smaller steps.

I would also activate immolation right after creation, then order the move, to remove that "wait".
Well, it could be outside the playable map area, so I think Ill go for the periodic trigger system. It cant be in the middle of a doodad or in deep water, because the map has no doodads or water ( just a very, very simple arena ). Also, I didn't activate immolation right after creation, in case the unit that fires the bullet is still too close to the bullet, and kills himself. Ah well, time to remake the trigger :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • jonas jonas:
    Oh, I see. I thought Chinese version of A-levels :D
  • jonas jonas:
    I've been using the translate app a lot on my phone. take a photo, translate. take another photo, translate again :D
  • jonas jonas:
    it also has voice translation, my colleagues sometimes use that
  • jonas jonas:
    You came during the 0 covid policy right? How'd you get through quarantine? Did you have some help with the apps and green codes?
  • tom_mai78101 tom_mai78101:
    If you have any Chinese you need help with, let me know.
    +1
  • vypur85 vypur85:
    @jonas Those were the things I did too. Translate app and VPN are always the most important things to have to survive. Lol.
  • vypur85 vypur85:
    Yea I came last year. I was quarantined for about 30 days. Fml. The first day of my quarantine was the eve of Chinese new year last year. Fml again... Lol.
  • vypur85 vypur85:
    @tom_mai78101 IIRC you're from Taiwan right.
  • The Helper The Helper:
    I thought China had cracked down on having any foreign teachers?
  • vypur85 vypur85:
    Yeah I've heard of the news before. My school is still actively hiring foreign teachers. Not sure how things work now.
  • The Helper The Helper:
    yeah it is hard to get reliable information about that kind of stuff
  • The Helper The Helper:
    but you are doing it so it is still doable
  • vypur85 vypur85:
    I think it doesn't affect existing foreign teachers. Then again, its still weird that my school is hiring.
  • The Helper The Helper:
    Happy Monday people hope everyone has a fantastic week!
  • Ghan Ghan:
    Happy Monday?! That's a contradiction.
  • jonas jonas:
  • jonas jonas:
    please put this in the news section, it's crazy
  • tom_mai78101 tom_mai78101:
    Technically, you can post in the Headline News. Just posted your news there.
  • tom_mai78101 tom_mai78101:
    I'm not aware of you not being able to post news.
  • jonas jonas:
    I think technically I can I just forget how
    +1
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Happy Friday Night!
    +1
  • V-SNES V-SNES:
    Happy Friday night!
    +1
  • vypur85 vypur85:
    Happy Sunday. Sigh. Work day tomorrow.
    +1

    The Helper Discord

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top