Is it possible to have some icons on units that cannot fire? Like because they lack energy, or because they are underwater and cannot use their weapons? It would be very nub friendly change, no?
Its just bad icons example, here but so I am sure you got the general idea :)
Cannot shoot icons for units
Moderator: Moderators
Cannot shoot icons for units
- Attachments
-
- icons.gif (8.16 KiB) Viewed 7193 times
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Cannot shoot icons for units
This is probably a "lua it" situation. However, I do not know of any calls that happen when a unit cannot fire due to lack of energy. Perhaps someone here knows.
A unit being underwater and therefore unable to fire is relatively easy.
A unit being underwater and therefore unable to fire is relatively easy.
Re: Cannot shoot icons for units
relativly easy? without performance cost? lua stuff cost so much perf sometimes :/
It seems that BA has same fps with 4k units than zerok with 1k, it's mostly because of lot of lua codes, no?
It seems that BA has same fps with 4k units than zerok with 1k, it's mostly because of lot of lua codes, no?
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Cannot shoot icons for units
Healthbars are drawn for all units in lua, without significant cost. Using the same framework as that would be fine for this, afaics.
To detect if a unit can't fire due to lack of energy, simply (cache and) compare the cost of firing a shot to current E storage. You'll probably want to do smth to prevent flickering when a player has low resources (resources come in every 16 frames, and go out on every frame, iirc),
To detect if a unit can't fire due to lack of energy, simply (cache and) compare the cost of firing a shot to current E storage. You'll probably want to do smth to prevent flickering when a player has low resources (resources come in every 16 frames, and go out on every frame, iirc),
Re: Cannot shoot icons for units
thx, btw the most important one would be the underwater situation, I think.
Re: Cannot shoot icons for units
X, y, z =Spring. GetUnitPosition (Unitid)
If y<0 then
If y<0 then