• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

building a "fire-arrow" station

Status
Not open for further replies.
Level 4
Joined
Aug 17, 2011
Messages
119
I'm trying to make a "fire-arrow' station. I'm trying to get it to work like this:

Workers can build "fire station", costs 1 food, archers close by get fire arrow ability and shoot flaming arrows. each shot fired costs the "fire station" 1 mana, when it runs out of mana, it dies.

flaming arrows deal + 5 damage and projectile models need to change.

I don't know what to base this off of? Would you do this with auras? If so, Healing Ward? Health/Mana Fountain? If not, how would you make this?
 
Level 11
Joined
Jun 30, 2008
Messages
580
Well, you can run a timer checking every 0.03 seconds.

If unit type == to Archer then

Add Fire arrow to Archer

endif

Then have another trigger run everytime a unit attacks, if unit has Fire Arrow then reduce the fire station's mana by 1.
 
Level 4
Joined
Aug 17, 2011
Messages
119
assuming i'm correct in thinking that the whole time check thing takes up memory, would it not be better to just:

make a blank aura and apply to brazier (building, no collision/pating problems)

then

apply "searing arrows" with 0 mana cost to any archer unit under effect of aura

now to do this with triggers, i cant find the right event..


also, i'd like to do it this way, coz i'v made all the spells an stuff... XD
 
Level 4
Joined
Nov 24, 2010
Messages
62
I think you should use some increase damage aura and make it increase 5 damages.
Using this trigger to drain mana:
  • Test
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff Fire Arrow) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Attacking unit)) Greater than or equal to 1.00
        • Then - Actions
          • -------- Maybe some special effect here --------
        • Else - Actions
          • Unit - Kill (Attacking unit)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Ok... Here I Go.
1) Add the Fire Arrow aBility to all your archers in the object editor. Set their max mana to 1, and regen to 0.
2) Use a Moonwell and change the model to the FireTower, edit the values of the Moonwell ability so it regens really fast the mana of really near units by 1 in a fast rate. Set the Moonwell mana regen to 0.

3-a) Create a trigger: that every 1 sec (0.03 is just for things that requires a lot of realism) picks all the FireTowers matching: Mana of (Picked Unit) Equal to 0 -> Kill them.

Problem: It will restore mana to anyone, not just the archers.

Posible Solution 1:

E: A unit begins casting an ability.
C1: Unit-Type of Triggering Unit = Fire Station
C2: Target Unit of Ability Being Cast -Not equal to- Your_Archer
A: Order Triggering Unit to Stop.

--------------------------------

Possible Solution 2: Change the Targets Allowed of the Fire Station MooNwell Ability to something like 'Ancients' and make your Archers be targeted as 'Ground, Ancient'.

-------------------------------
 
Level 4
Joined
Aug 17, 2011
Messages
119
thanks, will try out and let you know.

one problem though. how do you set the archers to turn on auto-cast for searing arrows once they have it?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Archers already have it, but they have no mana to use it, unless they stand near to a fire station that gives them mana. But, so far, you have to turn it on manually.

Another suggestion (I'm not sure if it works)

  • Check Fire Station
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Your_Builder
      • (Unit-type of (Constructed structure)) Equal to Your_FireStation
    • Actions
      • Trigger - Add to Fire Station <gen> the event (Unit - A unit comes within 200.00 of (Constructed structure))
  • Fire Station
    • Events
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Your_Archer
    • Actions
      • Unit - Order (Triggering unit) to Night Elf Priestess Of The Moon - Activate Searing Arrows
Everytime you build a FireStation, this will add to another trigger the Event 'A unit comes withing 200 of 'The Fire Station'', and that trigger activates the Searing Arrow ability on archers.

However, i'm not sure if it will lag if you have many of these, you'll have to test.

I like your idea BTW.
 
Level 4
Joined
Aug 17, 2011
Messages
119
aaargh, frustrating... i got it to work, kinda, but then it all came to a grinding halt when i tried to do the mana thing. will try your "moonwell method" tomorrow. anyway, I'm off to bed.... its late where I am.

UPDATE:



  • Test
  • Events
  • Unit - A unit Is attacked
  • Conditions
  • ((Attacking unit) has buff Fire Arrow) Equal to True
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Mana of (Attacking unit)) Greater than or equal to 1.00
  • Then - Actions
  • -------- Maybe some special effect here --------
  • Else - Actions
  • Unit - Kill (Attacking unit)
works, but archers never loose the fire arrow skill even after they move away from the brazier


  • Events
  • Unit - A unit Finishes construction
  • Conditions
  • (Unit-type of (Triggering unit)) Equal to Your_Builder
  • (Unit-type of (Constructed structure)) Equal to Your_FireStation
  • Actions
  • Trigger - Add to Fire Station <gen> the event (Unit - A unit comes within 200.00 of (Constructed structure))
  • Fire Station
  • Events
  • Conditions
  • (Unit-type of (Triggering unit)) Equal to Your_Archer
  • Actions
  • Unit - Order (Triggering unit) to Night Elf Priestess Of The Moon - Activate Searing Arrows
for some reason makes my brazier un-buildable??!
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
The triggers I gave to you wasn't supposed to remove the ability from the archer if the unit goes away, but just remove the mana source.

I think you can add the Fire Arrows to a spellbook, add the spellbook to the unit, disable the spellbook, and use the same trigger that orders the archer of Night Elf Priestess of the Moon - Activate Searing Arrows. MAYBE (i'm not sure) you can create another trigger, just like the one that activates the Flaming arrow. If the unit comes within 250, order 'Disable Searing Arrow', if it comes within 200, 'Enable Searing ARrow'.
 
Level 4
Joined
Aug 17, 2011
Messages
119
uuumm, so, i don't know how to do the spell-book thing...?

i have also tried to set it up with "add ability" and "set ability level to 1" (as actions to the enter range event), that didn't work either.

O, and I can build the Fire Brazier again...
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Finally, it's done.

This is used later to destroy towers with 0 mana. I used the 'If then else' in case you wanted to check other kind of stations the same way.
  • Check Tower
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructed structure)) Equal to Moon Well
        • Then - Actions
          • Unit Group - Add (Constructed structure) to FireTowersGroup
        • Else - Actions
This

1) Adds the passive Searing Arrows for Archers that gets the Fire Arrow buff from Tower. (300 range is set in the Object Editor for the aura).
2) Removes the ability of the units that doesn't have the Fire Arrow buff (Given by the Fire Station)
3) Destroys the Fire Stations with 0 mana.
  • Add Remove FireArrow
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • -------- Adding/Removing Searing Arrow --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Archer)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Fire Arrrows ) Equal to True
            • Then - Actions
              • Unit - Add Fire Arrows Passive to (Picked unit)
            • Else - Actions
              • Unit - Remove Fire Arrows Passive from (Picked unit)
      • -------- Removing Deplenished Fire Stations --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in FireTowersGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Moon Well
              • (Mana of (Picked unit)) Less than 1.00
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
This detects when a unit has Fire Arrow Buff, and deals damage to another unit. If there's a Fire station near (one or more) reduces the mana of a random tower around by 1. If there are no towers, the ability and buff are removed. The bonus damage in set in the trigger, not in the object editor. The 'Turn off' thing is needed to prevent game crash (since the damage done in the trigger would trigger again, and again, and again, doing a fatal error loop).

The FireStation mana will be reduced when the damage is dealt, and not when the arrow is shooted.

  • Mana thing
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Mana cost per shot --------
      • Set ManaCost = 2.00
      • Set BonusDamage = 10.00
      • -------- End Configuration --------
      • Set Point1 = (Position of GDD_DamageSource)
      • Set Group2 = (Units within 350.00 of Point1 matching (((Unit-type of (Matching unit)) Equal to Moon Well) and (((Matching unit) is alive) Equal to True)))
      • Set Unit1 = (Random unit from Group2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fire Arrows Passive for GDD_DamageSource) Greater than 0
          • (Number of units in Group2) Greater than 0
        • Then - Actions
          • Unit - Set mana of Unit1 to ((Mana of Unit1) - ManaCost)
          • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing BonusDamage damage of attack type Chaos and damage type Normal
        • Else - Actions
          • Unit - Remove Fire Arrrows buff from GDD_DamageSource
          • Unit - Remove Fire Arrows Passive from GDD_DamageSource
      • Custom script: call DestroyGroup(udg_Group2)
      • Custom script: call RemoveLocation(udg_Point1)
      • Trigger - Turn on (This trigger)
You need 'Weep damage detection system' in order to use this. The system is already in the map under 'GDD' Trigger Category Folder.

Check the modified units/abilities/buff in the object editor. ('Burning!' Buff is not used)

EDIT: Improved the triggers a bit following Maker suggestions. Already attached the updated map. There's still some 'Trash' in the map (Some variables that aren't used)
 

Attachments

  • Fire Station v2.w3x
    27 KB · Views: 95
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,243
Spartipilo, you shouldn't enumerate the towers every 0.1 seconds since you already have a group for them.

Also, you don't need to enumerate archers with and without the buff. Enumerate archers and use if/then/else in the loop to check the buff for example.

Also group1 creation in The GDD_Event becomes 0 could be avoided.

The system orks, but could be triggered a bit better when given more though on group handling.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hehe... I was working on a system that 'Works' and tryed to do it... 'well', but as you say, there are improvement points. Maybe i'll take this and improve it just... to have it :)

Thanks for suggestions!

EDIT: OMG... I never though about choosing all units in 'FireTowers' and then filter with an If/Then/Else inside the loop. That's why I was using Units Matching... I'll rework this soon, since I plan to use it in my map too.

EDIT: There, improved the triggers. I don't know if there are some other possible improvements? I forgot to remove the unused variabled and maybe rename then in a better way... (oops?)
 
Last edited:
Status
Not open for further replies.
Top