Attacking Ground

Mythes

Member
Reaction score
7
Is there an ability to make a unit attack ground? (Like catapults do in some games)
That is, the unit attacks the ground, and not a specific target.
Or must this be triggered?


Myt.
 

xkid4ditya

New Member
Reaction score
13
Ummm.....I dont know there is an ability for that, but you can set Combat Attack Weapon type of your unit to "Artillery" in Object Editor.

Hope usefull;)
 

hopy

Active Member
Reaction score
64
Is there an ability to make a unit attack ground? (Like catapults do in some games)
That is, the unit attacks the ground, and not a specific target.
Or must this be triggered?

If you want a unit to be able to attack the ground (giving them the ability to 'attack ground'), you'll need to make sure their 'Combat - Attack 1 - Weapon Type:' is set to 'Artillery'. Also I believe only ranged units have the ability to attack ground, even if set as Artillery, though I'm not sure about this. So make sure the units fits those conditions.

Now if you want a unit to attack the ground you will have to either:
1. Manually click the 'Attack Ground' button in game.
2. Force the unit to attack the ground by trigger, which isn't hard.
Since I wasn't sure what you wanted from your main post (I didn't fully understand if you wanted to know how to make a unit able to 'Attack Ground', or if you wanted a unit to be forced to attack ground without having to order him manually).

The trigger would look a bit like this (make sure the unit is able to attack ground!):
Trigger:
  • Attack Ground
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Demolisher
    • Actions
      • Set Point = (Position of (Attacked unit))
      • Set Point2 = (Point offset by (Random real number between 100.00 and 600.00) towards (Random real number between 0.00 and 359.00) degrees)
      • Unit - Order (Attacked unit) to Attack Ground Point2
      • Custom script: call RemoveLocation (udg_Point2)
      • Custom script: call RemoveLocation (udg_Point)

- Point, and Point2 are both point variables.
What this trigger does is it forces the 'Catapult' to attack a random point within 600 range everytime it's attacked. Now this would ofcourse look a bit silly because of the slow attack speed of the 'Catapult', but it's just an example. :D

Please do let me know if this didn't fix your problem.
 

Mythes

Member
Reaction score
7
Kind of fixed it hopy..
I just needed the unit to keep attacking the ground, so all I need is a timing trigger.
In place of "unit is attacked", just put "Time - Every 1.5 seconds in-game."
Being 1,5 the cooldown of my catapult.

Is the ability for attacking ground "Atack Ground" ?
Or does it have another name?

Thanks for the help =)


Myt.
 

evilwolf

Member
Reaction score
11
This action...
Code:
Unit - Order (Last created unit) to Attack Ground (Center of (Playable map area))
Unit - Issue Order attacking a point...
To attack ground the unit has to have SPLASH damage and artillery missile, this might be optional though.
 

hopy

Active Member
Reaction score
64
I just needed the unit to keep attacking the ground, so all I need is a timing trigger.
In place of "unit is attacked", just put "Time - Every 1.5 seconds in-game."
Being 1,5 the cooldown of my catapult.
I believe that when you order a unit to 'Attack Ground' in a trigger it will continue to attack ground until death, or a different order is given.
So if the Catapult will not be controled by any player or AI just giving the comand once is enough.

The 'When a unit is attacked' is just for example, if you want it to attack all the time it's better to use '5.00 seconds afther the start of the game' or something. Giving the order every 1.5 seconds seconds isn't needed and is more laggy.

Is the ability for attacking ground "Atack Ground" ?
Or does it have another name?

Thanks for the help =)
I cant remember this exactly, you could try and search (Ctrl+F) in the Object Editor and search for 'Attack Ground'.
However I think 'Attack Ground' is the same as the 'Attack' button on normal units, so just a command button rather then a ability.

Happy to help.

======EDIT======
This action...
Code:
Unit - Order (Last created unit) to Attack Ground (Center of (Playable map area))
Unit - Issue Order attacking a point...
To attack ground the unit has to have SPLASH damage and artillery missile, this might be optional though.
From what I remember 'Artillery Missile and Ranged attack', I'm not sure about the splash. Since it's a Catapult firing at the same place all the time I assume Splash is active though.

Also:
(Center of (Playable map area))
is a leak.
======/EIDIT======
 

Mythes

Member
Reaction score
7
Will test this tonight..
Yeah, I noticed "point of attack" leaks..
No problem, customscript fixes it...
 

evilwolf

Member
Reaction score
11
"I cant remember this exactly, you could try and search (Ctrl+F) in the Object Editor and search for 'Attack Ground'"
You can't! thats not an ability! Try it yourself!
A unit will automatically come with the attack ground ability if it has splash damage and artillery missile type.
 

hopy

Active Member
Reaction score
64
I cant remember this exactly, you could try and search (Ctrl+F) in the Object Editor and search for 'Attack Ground'.
However I think 'Attack Ground' is the same as the 'Attack' button on normal units, so just a command button rather then a ability.
Do read all please.
 

Mythes

Member
Reaction score
7
I think I understand what everyone said, and took in consideration leaks and other stuff..
I'll be making the ability tonight and posting here what went right / wrong.
rep+ everyone who posted here (cause every1 helped :p)


Thanks again everyone,
Myt.
 

Mythes

Member
Reaction score
7
Ok it worked... partially...
I wanted the unit to attack anypoint in the map for a certain time... But the unit doesn't attack ground if the target is further than 800 range (more less) even if I set it's attack range to 20000....
Ideas here? Or must I use "damage point" ?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top