• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Td help

Status
Not open for further replies.
Level 11
Joined
Dec 5, 2009
Messages
846
Hello im short of time right now. You ever played Legion Td in Wc3? Well how to do that trigger in the beginning when you build an tower you can click on it but then later when creeps spawn you cant click on it or yes you can but its not a green selecting ring its a yellow one and the unit doesnt respond like clicking on an allys units.. How to do that trigger Thanks for the help!! And im short of time so if you want me to explain better i will edit soon. THANKS!
 
Level 11
Joined
Dec 5, 2009
Messages
846
This yellow selection circle appears when you
  • Unit - Change ownership of (your unit) to (any ally player that is not going to be used in-game as a user) and retain color


Yeah i know that part ^^ But i need help with when the wave ends then all the towers you builded return where they were built and the same tower you builded shall be at the same place where you builded it. And the pause part when you can upgrade your unit between the waves. And when you shall build your tower do you build it as an tower or as an unit?


Thanks with the help so far :thumbs_up:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Simple, the towers never move or change. They are placeholders.

At the start of every round you run through all the towers and hide them. As you hide them you spawn a unit at their position based on the tower type (advise the use of hashtables for this efficently).
At the end of the round you remove all existing units and then run through all the hidden towers and then unhide them so they are visible again.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
I have no idea what you are refering to. Once again...

Like I said you use triggers that at the start of each round picks all towers and then hides them and makes the corrosponding units at the tower position for the tower.
At the end of a round you remove all the excess units and then simply unhide all the hidden towers.
 
Level 11
Joined
Dec 5, 2009
Messages
846
I have no idea what you are refering to. Once again...

Like I said you use triggers that at the start of each round picks all towers and then hides them and makes the corrosponding units at the tower position for the tower.
At the end of a round you remove all the excess units and then simply unhide all the hidden towers.




Yes but if i build one tower (Footman) how do i do so the unit footman spaws there? If i have 10 units you can build in the map should i do 1 trigger for each unit? Like if this tower is built then spawn this unit and do that with all 10 units/towers?

Ty for help hope you understand!
 
Level 11
Joined
Dec 5, 2009
Messages
846
You create a database and from unit type of the tower get the type of unit it should spawn. Hardly advanced stuff really.

Like mentioned I advise the use of hashtables as unit types are integers which fit quite nicly as indicies for the hashtable.


I've never used any hashtables before so can you please give me an example? for the trigger

Thanks man
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
They are self explanitory. You just use our data management knowledge with them and use them like you would arrays.

The natives all take the hashtable to interact with (you can have 256 of them or something), a "parent" integer which can be any number (I advise the integer of the unit type for the tower) and a "child" integer which can be any number (use 0 or anything static/constant for this). The save natives also then after that take the data to save based on the native use (in this case you want to use integer so you can save the unit type that the tower spawns). Finally you just load the saved value for each tower at the round start and create a unit at the location of the tower you hid based on the unit type of the tower.
 
Level 11
Joined
Dec 5, 2009
Messages
846
But should i use the hashtable variables?

You mean something like this?

: Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Set Runestone
Actions
Hashtable - Create a hashtable
Set MyTable = (Last created hashtable)
Hashtable - Save Handle Of(Position of (Triggering unit)) as (Key (Triggering unit)) of 1 in MyTable
 
Level 9
Joined
Nov 4, 2007
Messages
931
The you are doomed.
DOOOOOOOOOOOOOOOOOOOOOOOOOOMMMMMMMMMMEEEEEEDDDDD!!!!!!!!!!!!!!!!!!!!!!!!!
There is a simpler and leakier way, do a unit group run:
  • Actions
    • Unit Group - Pick every unit in (Units of type Footman (Tower)) and do (Actions)
      • Loop - Actions
        • //whatever actions you want to use to hide you're tower
        • Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees
This will work if you just want to know how to do it. If you want to learn how to do it better you should probably start learning JASS.
 
Status
Not open for further replies.
Top