• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Using Attack-Once peroperly

Status
Not open for further replies.
Level 13
Joined
Jan 2, 2016
Messages
973
Can anyone explain how to use Attack-Once efficiently?
1) Do I need a 2-nd type of dummy with attack enabled?
2) Would it work if the dummy has damage base = 0, and dice which is rolled 0 times (so the dummy wouldn't deal damage)?
3) Do I need to spawn a new dummy for every unit I want hit or is it possible to do it with 1 dummy?

And... is there a better way to apply an orb effect than giving the orb effect to the dummy and making it attack-once a unit?
At the moment I'm fully triggering the orb effects, but this isn't as efficient as I want it to be, cuz REAL orb effects, and triggered orb effects stack (while some orb effects don't stack with normal unit spells), and I don't want that...
 
Last edited:
Level 13
Joined
Jan 2, 2016
Messages
973
My system might fit your needs: http://www.hiveworkshop.com/forums/spells-569/gui-custom-stacking-orbs-system-v1-4-a-268768/

You can also, if you use a damage engine, remove the dummy when the damage event occurs.

Well, I already have a library, that "simulates" orb effects. The problem is that I want to just use the original orb effects because:
1) Normal orbs (which are also used on my map) WILL stack with the triggered ones, and it will just be weird. (A unit affected by Orb of Darkness will spawn 2 skeletons instead of one; Unit, affected by orb of Corruption will have its armor reduced by 10, instead of 5, etc...)
2) Some abilities (like bloodlust, and slow) wouldn't stack with orb effects (since I'm using them as base skills for some of the orb effects) xP
 

Ardenian

A

Ardenian

1) I don't get why you simply don't use the default orbs then or trigger them, too ?
2) Yeah, there are a few drawbacks with using abilities as a base ( custom orbs), on-attack effects like Parasite and Black Arrow don't work, appearently.
 
Level 13
Joined
Jan 2, 2016
Messages
973
The thing is that I'm making an add-on library for my Custom Multishot.
That add-on library makes my multishot work with orb effects (by triggering the effect).
However - I am using the custom orbs (triggered ones) only on units, which are using the multishot, the rest just use the original orbs.
So instead of triggering everything I just want to make a dummy, with the original orb effect to hit them once :p
This will make things a lot simpler, and more reliable.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Well, I already have a library, that "simulates" orb effects. The problem is that I want to just use the original orb effects because:
1) Normal orbs (which are also used on my map) WILL stack with the triggered ones, and it will just be weird. (A unit affected by Orb of Darkness will spawn 2 skeletons instead of one; Unit, affected by orb of Corruption will have its armor reduced by 10, instead of 5, etc...)
2) Some abilities (like bloodlust, and slow) wouldn't stack with orb effects (since I'm using them as base skills for some of the orb effects) xP

Why not use a buff system (or make one) for the orb effects? The slow effects can all be done with tornado aura. You can do armour reduction with a bonus mod system with a tornado aura to show the buff, or you could use a devotion aura with negative armour bonus in a disabled spellbook.

The on-death one is a little more tricky. You may need some kind of "unit dies" system that makes sure they can only spawn one unit. You could also create effects that prevent on-death things from happening. In any case, a tornado aura works for this as well since you can just check for the tornado aura ability when a unit dies.

EDIT:
Just saw your new post. How does your custom orb system work? Can you not fake an orb effect hit somehow?
 

Ardenian

A

Ardenian

Then create a dummy, give it the original orb and attack the target once, removing the dummy in the damage event ?
 
Level 13
Joined
Jan 2, 2016
Messages
973
@SAUS, you can check my Multishot system from my signature.
It pretty much uses a dummy, casting Acidbomb to spawn the arrows, I save a struct, with the damage's properties into the dummy, and when the unit takes 0 damage (from the acid bomb), and has a special buff (applied via the acidbomb) - the buff is removed, and the dummy deals the Multishot's damage.

I'm also registering an "On hit" event, and I simulate the orb effects there. For example I'm giving "slow" ability to the dummy, and make it cast it on the unit, hit by the multishot.

@Ardenian, yes, that was my idea, and that's why I started this thread.
I still don't know if I need a to make another dummy, with attack enabled to do that; and do I need seperate dummy for each "hit" (check the 3 questions in the original post).

EDIT:
And by the way... Anyone knows how exactly does Orb of Fire work?
Does it change the attack/damage type of the hero, using it, and upon hit what type of damage does it deal with its splash, AND what amount of damage does it deal.
A hero with 27-32 damage (with the bonus from the orb) deals 5 damage with the splash.
I set the triggered damage to 20% of the original damage, and hero with 28-33 damage deals 6 damage with the triggered splash. However, I feel that that's not quite how the Orb of Fire's damage works...
I'd need to keep triggering Orb of fire, as it's dealing splash damage, and I can't just let that happen via a dummy :p
 

Ardenian

A

Ardenian

As far as I know, you can modify the object data of one dummy ( cast point) and then order it to cast the spell on multiple targets ( like Pick every unit and then order one dummy to cast the spell on the picked unit).
 
Level 13
Joined
Jan 2, 2016
Messages
973
Yeah, but spells don't stack with orb effects. I'd need to make it ATTACK the target.

My idea is:
Event: On multishot hit
Condition: Missile Id of the shot (this checks if the unit has been hit by an orb effect or not) equal to some value
Actions: Summon "battle dummy"
Add the orb effect ability to it
Order it to attack the multishot target
Remove it from the game, or give it 0.01 exp timer.
 

Ardenian

A

Ardenian

You couldy try whether a combination of attack speed and damage event solves the problem.

Basically you pick all targets, then index them temporarily. Order the dummy to attack the first indexed. Once the damage event triggers, order it to stop and attack the next indexed target.
Obviously, you will need a high turn-rate and attack speed to make that happen within 0.3 seconds. You might need to set the unit facing manually, to speed up the attack.
 
Level 13
Joined
Jan 2, 2016
Messages
973
Okay, I conducted some tests. I made another dummy, with the fastest attack possible, and max turn rate:
Test 1:
I created a dummy, gave it an orb ability and made it "attack" a unit.
The dummy started attacking like crazy.

Test 2:
I created a dummy, gave it an orb ability and made it "attackonce" a unit.
The dummy started attacking like crazy.

Test 3:
I created a dummy, gave it an orb ability and made it "attack" a unit. I also gave it 0.01 timed life.
Nothing happened

Test 4:
I created a dummy, gave it an orb ability and made it "attack" a unit. I also gave it 0.05 timed life.
Nothing happened

Test 5:
I created a dummy, gave it an orb ability and made it "attack" a unit. I also gave it 0.10 timed life.
SOMETIMES it was hitting the unit, sometimes it wasn't.

Test 6:
I created a dummy, gave it an orb ability and made it "attack" a unit. I also gave it 0.25 timed life.
Sometimes it was hitting the unit 2-3 times
Sometimes it was hitting the unit 1-ce
Sometimes it wasn't hitting the unit at all

Test 7:
I created a dummy, gave it an orb ability and made it "attackonce" a unit. I also gave it 0.25 timed life.
Nothing was happening

This is WAY too unreliable the way it is now.....
Anyone has any idea how can I make it give more "stable" results?

EDIT:
Test 8:
I created a dummy, gave it an orb ability and made it "attackonce" a unit. I also made an event "a unit takes damage" and as condition "source = Orb Dummy"; Actions = Order damage source to "stop", and give it 0.5 sec timed life.
The dummy started hitting the target 2-4 times.

EDIT 2:
Test 8, but with 0.01 timed life works :)
 

Ardenian

A

Ardenian

So it works now ? Good to hear :)
Why do you give it the orb ability ? You could also just give the dummy an orb item, couldn't you ?
 
Level 13
Joined
Jan 2, 2016
Messages
973
Nope, the dummy isn't a hero. Orbs don't work on normal units.

Now it looks like this :D
JASS:
    private function DummyHit takes nothing returns boolean
        if GetUnitTypeId(GetEventDamageSource()) == ORB_DUMMY then
            call IssueImmediateOrder(GetEventDamageSource(), "stop")
            call UnitApplyTimedLife(GetEventDamageSource(), 'BTLF', 0.01)
            call DestroyTrigger(GetTriggeringTrigger())
        endif
        return false
    endfunction

    private function Trig_On_Hit_Actions takes nothing returns boolean
        local unit d
        local trigger t
        if udg_MS_Missile == FROST_MISSILE then
            set d = CreateUnit(GetOwningPlayer(udg_MS_Source), ORB_DUMMY, GetUnitX(udg_MS_Hit_Unit), GetUnitY(udg_MS_Hit_Unit), 0.00)
            call UnitAddAbility( d, DUMMY_FROST )
            call IssueTargetOrder( d, "attack", udg_MS_Hit_Unit )
        elseif udg_MS_Missile == CORRUPTION_MISSILE then
            set d = CreateUnit(GetOwningPlayer(udg_MS_Source), ORB_DUMMY, GetUnitX(udg_MS_Hit_Unit), GetUnitY(udg_MS_Hit_Unit), 0.00)
            call UnitAddAbility( d, DUMMY_CORRUPTION )
            call IssueTargetOrder( d, "attack", udg_MS_Hit_Unit )
        elseif udg_MS_Missile == DARKNESS_MISSILE then
            set d = CreateUnit(GetOwningPlayer(udg_MS_Source), ORB_DUMMY, GetUnitX(udg_MS_Hit_Unit), GetUnitY(udg_MS_Hit_Unit), 0.00)
            call UnitAddAbility( d, DUMMY_DARKNESS )
            call IssueTargetOrder( d, "attack", udg_MS_Hit_Unit )
        elseif udg_MS_Missile == LIGHTNING_MISSILE then
            set d = CreateUnit(GetOwningPlayer(udg_MS_Source), ORB_DUMMY, GetUnitX(udg_MS_Hit_Unit), GetUnitY(udg_MS_Hit_Unit), 0.00)
            call UnitAddAbility( d, DUMMY_LIGHTNING )
            call IssueTargetOrder( d, "attack", udg_MS_Hit_Unit )
        elseif udg_MS_Missile == FIRE_MISSILE then
            call OrbOfFire()
            return false
        elseif udg_MS_Missile == SLOW_MISSILE then
            set d = CreateUnit(GetOwningPlayer(udg_MS_Source), ORB_DUMMY, GetUnitX(udg_MS_Hit_Unit), GetUnitY(udg_MS_Hit_Unit), 0.00)
            call UnitAddAbility( d, DUMMY_SLOW )
            call IssueTargetOrder( d, "attack", udg_MS_Hit_Unit )
        elseif udg_MS_Missile == VENOM_MISSILE then
            set d = CreateUnit(GetOwningPlayer(udg_MS_Source), ORB_DUMMY, GetUnitX(udg_MS_Hit_Unit), GetUnitY(udg_MS_Hit_Unit), 0.00)
            call UnitAddAbility( d, DUMMY_VENOM )
            call UnitAddAbility( d, 'Apo2' )
            call IssueTargetOrder( d, "attack", udg_MS_Hit_Unit )
        endif
        set t = CreateTrigger()
        call TriggerRegisterUnitEvent( t, udg_MS_Hit_Unit, EVENT_UNIT_DAMAGED )
        call TriggerAddCondition( t, Condition(function DummyHit))
        set t = null
        set d = null
        return false
    endfunction
 
Level 12
Joined
May 22, 2015
Messages
1,051
Nope, the dummy isn't a hero. Orbs don't work on normal units.

I'm pretty sure orb items work fine on normal units. The problem is that the unit inventories have one option set that makes items not do anything on units.
 

Ardenian

A

Ardenian

I'm pretty sure orb items work fine on normal units. The problem is that the unit inventories have one option set that makes items not do anything on units.

I think it works fine if you use the hero inventory
 
Level 13
Joined
Jan 2, 2016
Messages
973
Ah, that's new information for me :p

Anyways.. even if that was the case - I still would've needed another pair of custom orbs to do the trick, since I have to reduce the dummy's damage to 0 (it's actually 1 now). But since orbs give bonus damage - I need custom ones.

So I guess it's pretty much the same thing if I give the dummy the orb ability or the orb itself (custom one). xP
 

Ardenian

A

Ardenian

Why don't you nullify the damage using a damage system ? Then it doesn't matter
 
Status
Not open for further replies.
Top