[:1]Hi guys...
Don't know if this is possible, but i want to make a unit use an ability whenever a timer expires, and he must stop using the ability after a certain event...
The main idea is to have a tower defece like Legion TD where towers become units and fight the creep wave and then after they are done the original towers are replaced and in the same position. My idea is to make the towers windwalk so that they are not there(maybe give then to another player so that the owner of the towers cannot see them) then just create a normal unit where the tower was standing... Then after the fight is finished the windwalk must expire so that the player can use his towers again (for placing new towers, selling ect)
Is this possible and if it is, how do I do it?
If it is not possible, any other ideas?
Please help me!|||I don't exactly know what you mean but you can try this (It works!).
Event
Time- Timer expires
Condition
Action
Pick every unit in ... and do multiple actions
Loop- Actions
Order picked unit to cast Human soceress- Invisibility on picked unit.
Or you can try this:
Event
Time-Timer expires
Condition
Action
Pick every unit in... and do multiple actions
Loop- Actions
Hide picked unit
Create 1 ... at positon of picked unit facing default building facing degrees.
Wait ... seconds (This is an individual action!)
Show picked unit
Hope I helped!|||Tnx for your response, but it doesn't seem to work... (the spell doesnt work on buildings, and thus, the towers stay visible)
But I've come up with a new idea, but it will take alot of variables... (I will explain now and at the bottom I will give my code for it... The code doesn't fully work, so if you have any ideas please help)
The idea is to have an array that stores a location and an array that stores the tower type... Then at the start of each round it picks every tower and saves the type of tower and the location of the tower into the to arrays.. (obviously the first item in the one array is related to the first item of the other array, so is the second and third....) then the tower is removed and the unit is created. After the round has finished the towers are then created with a for loop.
This is the saving part :
Save Tower Locations
Events
Conditions
Actions
Unit Group - Pick every unit in (Units in Player 1 Towers <gen> owned by Player 1 (Red)) and do (Actions)
Loop - Actions
Set Counter = (Counter + 1)
Region - Center Temp Region <gen> on (Position of (Picked unit))
Set Tower_Locations[Counter] = Temp Region <gen>
Set Tower_Types[Counter] = (Unit-type of (Picked unit))
Unit - Remove (Picked unit) from the game
Unit - Create 1 "Unit" for Player 1 (Red) at (Center of Temp Region <gen>) facing Default building facing degrees
And this is where the towers are replaced again :
Create Towers Again
Events
Conditions
Actions
Unit Group - Pick every unit in (Units in Player 1 Towers <gen>) and do (Unit - Remove (Picked unit) from the game) "(this is just to remove all the units created in previous round)"
For each (Integer A) from 1 to Counter, do (Actions)
Loop - Actions
Unit - Create 1 Tower_Types[(Integer A)] for Player 1 (Red) at (Center of Tower_Locations[(Integer A)]) facing Default building facing degrees
Set Counter = 0 (outside loop of course)
Now the problem I have is that all the towers built are all at the same location as where the last one that was picked were, and not at the locations where they were when i saved the location in the array. Any ideas on why this happens?? And do you have any ideas on how to do this so that it might work?
Sorry for the long msg, but I want to get this right. I hope I explained well.|||Nevermind. I found an alternative way to do it... That way didn't work at all.
But I got it, thanks anyway!
No comments:
Post a Comment