Page 1 of 1

Universal way to detect comanders in all games[SOLVED]

Posted: 15 Apr 2012, 19:22
by wolas
Ok I m not lua coder nor I m into game developing, I m creating map and all I need to know if it is commander or not, before life was easy .isCommander and easy way to detect coms in all mods? because currently I m detecting only zero-k coms.

if UnitDefs[unitDefID].customParams.commtype then

EDIT: if UnitDefs[unitDefID].customParams.commtype or UnitDefs[unitDefID].customParams.iscommander then

works on BA and zk and similar thanks nixtux.

is features now unatackable? Because I have big feature and even when I set manual fire where aoe would hit it unit refuses attack it. It wasnt like this in 82.0

Re: Universal way to detect comanders in all games[HALF SOLVED]

Posted: 15 Apr 2012, 23:25
by smoth
what are you going to do about games that don't have commanders?

Re: Universal way to detect comanders in all games[HALF SOLVED]

Posted: 15 Apr 2012, 23:31
by wolas
This is for lol map like a duck and when com dies some cool sound is a must.

Re: Universal way to detect comanders in all games[HALF SOLVED]

Posted: 15 Apr 2012, 23:31
by Jools
The UnitDefs[unitDefID].customParams.iscommander works for xta too.

Re: Universal way to detect comanders in all games[HALF SOLVED]

Posted: 15 Apr 2012, 23:32
by Jools
But I think the best way to do it would be to make a table of all the unist that all present frame 1, since those are commanders.

Re: Universal way to detect comanders in all games[HALF SOLVED]

Posted: 16 Apr 2012, 03:37
by SpliFF
@jools: That's not a very reliable assumption. There are games and mutators where teams start with other unit types.