• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Making a unit attack incredibly fast

Status
Not open for further replies.

Oli

Oli

Level 4
Joined
Aug 9, 2015
Messages
42
I have a trigger that moves a unit by the "instantly move unit" function in a repetitive timer that expires per 0.05 seconds, however i want the same unit be able to attack in-between the timer expirations. Tried reducing the attack speed, combat animation backswing point and damage point of the unit to 0, furthermore i've made it so that everytime the timer expires the unit is forced to face an enemy and attack it. However, the unit is either attacking once or twice, and sometimes not at all.
The map is attached.
There are other bugs in the script i'm working on to fix.
I would be grateful for any help to fix that bug.
 

Attachments

  • RVM.w3m
    21.1 KB · Views: 38
The "instantly move unit" function also orders the unit to stop, which might explain the bug where the flying machine doesn't attack. For the flying machine, try using the following natives for changing the unit's position instead.

JASS:
native SetUnitX takes unit whichUnit, real x returns nothing
native SetUnitY takes unit whichUnit, real y returns nothing

The functions above can be invoked by selecting the custom script in the actions tab and pasting the following:

  • Custom script: call SetUnitX(gg_unit_hgyr_0005, udg_point2)
  • Custom script: call SetUnitY(gg_unit_hgyr_0005, udg_point1)

EDIT:

Changing the attack cooldown of the flying machine can be done as follows:
  • Modified Base Cooldown
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Flying Machine
        • Then - Actions
          • Unit - Set Attack Interval of (Triggering unit) to 0.05 for weapon index: 1
        • Else - Actions
 
  • Like
Reactions: Oli

Oli

Oli

Level 4
Joined
Aug 9, 2015
Messages
42
The "instantly move unit" function also orders the unit to stop, which might explain the bug where the flying machine doesn't attack. For the flying machine, try using the following natives for changing the unit's position instead.

JASS:
native SetUnitX takes unit whichUnit, real x returns nothing
native SetUnitY takes unit whichUnit, real y returns nothing

The functions above can be invoked by selecting the custom script in the actions tab and pasting the following:

  • Custom script: call SetUnitX(gg_unit_hgyr_0005, udg_point2)
  • Custom script: call SetUnitY(gg_unit_hgyr_0005, udg_point1)

EDIT:

Changing the attack cooldown of the flying machine can be done as follows:
  • Modified Base Cooldown
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Flying Machine
        • Then - Actions
          • Unit - Set Attack Interval of (Triggering unit) to 0.05 for weapon index: 1
        • Else - Actions
Thanks a lot. It worked.
 
Status
Not open for further replies.
Top