• 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.

[Spell] Build a Structure on a trees location

Status
Not open for further replies.
Level 2
Joined
Nov 16, 2011
Messages
16
Continuing from this thread here: http://www.hiveworkshop.com/forums/...ower-self-cast-buff-spell-207196/#post2049490

I now need help figuring out how to make a build or spell that will craft a building at the location of the targeted tree.

I had originally tried:

"On spell cast of Create Tower, create arrow tower and remove targeted unit." (the create tower spell is a modified single target attacking spell thats able to target structures, alive, dead)

I realized that trees are doodads and tried making some sort of remove targeted doodad. It didn't work in the least.

I then created a building with a tree's model and used the above function but it still doesnt work.

And even if it did work I dont know how to tie it into the autocast upgrade code from the previous thread. It detecs for unit finished building, but it'd need to look for unit is created, which I cannot find.


Forgive me for seeming so nooby. I sorta hate that I need help on the 2 biggest mechanics on my map but I'm totally at a loss and I'd like to be able to see a map finalized...

Any help is greatly appreciated.
Thanks.
 
Level 2
Joined
Nov 16, 2011
Messages
16
Destructables, Warcraft III (default) trees are destructables. Use Eat Tree as the base ability to target a tree.

I tried that and I tried the tree club or whatever the NE Giants skill is but theres no "Create Unit at location of Target Destructible". So the tree would be torn down and nothing would come of it.
 
Level 2
Joined
Nov 16, 2011
Messages
16
As long as you don't have any destructable-related trigger than the one that you want to create
Use the event: a destructible dies

Uhh.. I've managed to figure that part out, but how do I determine which spell is cast. This is supposed to be a TD.

I had thought to do:

When spell 'create specific tower' is cast
if destructable dies
then
'the actions'

but I cant have the destructable dieing as a condition.
 
Level 17
Joined
Jan 21, 2010
Messages
2,111
This one:
Event
A destructible dies
Condition
(destructible type of (dying destructible)) equal to ashenvale canopy tree
Action
Create 1 footman for (player 1 red)

Or

Event
A unit is issued an order
Or
A unit is issued an order targeting a destructible
(nb: forgot which one is available on trigger editor)
Condition
(issued order) equal to eattree
(target destructible of (issued order)) is equal to ashenvale tree wall
Action
unit - create 1 militia for player 1 red


Try these, just change the action
Sorry for wall-o-text, don't have any WE atm
 
Level 2
Joined
Nov 16, 2011
Messages
16
This one:
Event
A destructible dies
Condition
(destructible type of (dying destructible)) equal to ashenvale canopy tree
Action
Create 1 footman for (player 1 red)

Or

Event
A unit is issued an order
Or
A unit is issued an order targeting a destructible
(nb: forgot which one is available on trigger editor)
Condition
(issued order) equal to eattree
(target destructible of (issued order)) is equal to ashenvale tree wall
Action
unit - create 1 militia for player 1 red


Try these, just change the action
Sorry for wall-o-text, don't have any WE atm


I havent geared into thoroughly combing the trigger editor for this yet but when I first got your response I looked for the "(target destructible of (issued order))" or something simmilar but I couldnt find anything related to target destructible... could you direct me to where I should be looking for it, or double check if such a thing exists?
 
Level 11
Joined
Nov 15, 2007
Messages
800
It's "Event Response - Target destructible of ability being cast"

  • Tree
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Eat Tree
    • Actions
      • Set POINT = (Position of (Target destructible of ability being cast))
      • Destructible - Remove (Target destructible of ability being cast)
      • Unit - Create 1 Scout Tower for (Owner of (Triggering unit)) at POINT facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_point)
Here's a map if you need help finding any of this.
 

Attachments

  • tree.w3x
    17.1 KB · Views: 55
Level 2
Joined
Nov 16, 2011
Messages
16
Awesome. I'll add this to my map and see how everything works together!

Add:

So your trigger works flawlesly however now that I create buildings like that, the trigger for my last thread isn't being triggered. Its looking for a building being constructed and through that is adding the building to variables and using those to do the self cast upgrade mechanic.

I can easily change the trigger to be when spell is cast blah blah. But the rest of the trigger uses (triggering unit) to add the tower to the list to watch for self casting.

Does anyone have an idea how I could get them to work together?
 
Last edited:
Level 11
Joined
Nov 15, 2007
Messages
800
Awesome. I'll add this to my map and see how everything works together!

Add:

So your trigger works flawlesly however now that I create buildings like that, the trigger for my last thread isn't being triggered. Its looking for a building being constructed and through that is adding the building to variables and using those to do the self cast upgrade mechanic.

I can easily change the trigger to be when spell is cast blah blah. But the rest of the trigger uses (triggering unit) to add the tower to the list to watch for self casting.

Does anyone have an idea how I could get them to work together?

Not sure what you're trying to describe. Post the trigger here.
 
Level 2
Joined
Nov 16, 2011
Messages
16
  • SAS Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set UpgradeUnitType = Guard Tower Basic
      • Set UpgradedUnitType = Guard Tower Upgraded
      • Set UpgradeAbility = Inner Fire
      • Set ManaNeededToUpgrade = 40.00
^ This defines the towers and what to look for.

  • SAS Event
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Create Arrow Tower
    • Actions
      • Set UpgradeUnit = (Triggering unit)
      • Unit - Order UpgradeUnit to Human Priest - Activate Inner Fire
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of UpgradeUnit) Equal to UpgradeUnitType
        • Then - Actions
          • Unit Group - Add UpgradeUnit to UpgradeUnitGroup
          • Trigger - Turn on SAS Check Mana <gen>
        • Else - Actions
^ this is watching for a tower being built (which isn't the case when I use eat tree to turn a tree into a building) and all the actions involve the triggering unit so I cant just change the event to trigger the actions.

  • SAS Check Mana
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (UpgradeUnitGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Game - Display to (All players) the text: TURN OFF TRIGGER
        • Else - Actions
          • Unit Group - Pick every unit in UpgradeUnitGroup and do (Actions)
            • Loop - Actions
              • Set UpgradeUnit = (Picked unit)
              • Set UpgradeUnitMana = (Mana of UpgradeUnit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • UpgradeUnitMana Equal to ManaNeededToUpgrade
                • Then - Actions
                  • Unit - Replace UpgradeUnit with a UpgradedUnitType using The old unit's relative life and mana
                • Else - Actions
^This is the rest of the mechanic. I just didnt wanna leave it out.


Ultimately what I'm looking to do all together is make it so you cast a build spell on a tree. It takes off resources and creates the building on the tree you cast on. Then when the towers mana pool maxes out (experience is maxed) it upgrades to the next level of tower. You can have your builder standing beside it to give it mana regen with a modded brilliance aura (which is why I aimed to make a mana based 'exp' upgrade system)
 
Level 11
Joined
Nov 15, 2007
Messages
800
If I'm understanding you right, you don't need the "SAS Event" trigger any more. You can just copy/paste all of the actions in "SAS Event" to the end of my trigger, and use "last created unit" to reference the unit being created in place of the tree.
 
Level 2
Joined
Nov 16, 2011
Messages
16
If I'm understanding you right, you don't need the "SAS Event" trigger any more. You can just copy/paste all of the actions in "SAS Event" to the end of my trigger, and use "last created unit" to reference the unit being created in place of the tree.

That makes a lot of sense... I'll try it out.

Add:

Awesome! That did the trick! sweet. now to work on multiple towers and whatnot!
 
Level 2
Joined
Nov 16, 2011
Messages
16
One last thing.

I tried googling it but I dont really know how to word the question for a search engine.

I want to use the same eat tree spell with a different name and icon for each create tower spell but now that I have Create Arrow Tower and Create Cannon Tower, they are casting at the same time and both hot keys trigger only one of the create tower triggers.

I changed the icon coordinates, enabled attack index (hoping it would change things), order string use/turn on (hoping it would change things) and obviously the tooltips and icons.

Is there any way I can use the same spells with their changed icons and tool tips in the same spell book for building these towers?
 
Level 11
Joined
Nov 15, 2007
Messages
800
You can't have multiple instances of a single base ability, no matter what you change about it. The order strings will always get confused. I'm pretty sure you can set targets allowed to tree for most abilities and have it work, no?
 
Level 2
Joined
Nov 16, 2011
Messages
16
You can't have multiple instances of a single base ability, no matter what you change about it. The order strings will always get confused. I'm pretty sure you can set targets allowed to tree for most abilities and have it work, no?

Uhh possibly. I think I tried but it doesnt actually allow you to specifically target the trees. Though thats my current only option so I'll make sure to figure it out. If not.. I have Eat tree & war club so I'll have to figure out how to pull that off. Probably multiple spell books or something.
 
Status
Not open for further replies.
Top