- Joined
- Mar 19, 2010
- Messages
- 870
A question.
In my map i sell towers with a dummy unit and transmute. All works fine.
Now i'm working on a Tower AI and the selling makes trouble
I debugged up to the point that it's not possible to order a dummy casting transmute if the dummy player is a computer.
here's the code snippet.
This code works fine for real players BUT as i said if the TrainedUnit(Dummy with the transmutre ability) is a computer player it will not work!!!
Any ideas? My idea is to sell the tower manually by remove + special effect and give wood back to the player. For this i need a special lib which gets me the tower costs. I think i saw it here on hive.
Best Reg.
In my map i sell towers with a dummy unit and transmute. All works fine.
Now i'm working on a Tower AI and the selling makes trouble
I debugged up to the point that it's not possible to order a dummy casting transmute if the dummy player is a computer.
here's the code snippet.
JASS:
private static method onSell takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit t = GetTrainedUnit()
if GetUnitTypeId(t) == SELL then
call SetUnitInvulnerable( u, false )
call IssueTargetOrder( t, "transmute", u )
call UnitApplyTimedLife(t, 'BTLF', 1.50)
call GroupRemoveUnit(BEING_UPGRADE_UNITS, u)
endif
set u = null
set t = null
endmethod
This code works fine for real players BUT as i said if the TrainedUnit(Dummy with the transmutre ability) is a computer player it will not work!!!
Any ideas? My idea is to sell the tower manually by remove + special effect and give wood back to the player. For this i need a special lib which gets me the tower costs. I think i saw it here on hive.
Best Reg.