Cannot shoot icons for units

Cannot shoot icons for units

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
triton
Lobby Moderator
Posts: 330
Joined: 18 Nov 2009, 14:27

Cannot shoot icons for units

Post by triton »

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 :)
Attachments
icons.gif
icons.gif (8.16 KiB) Viewed 6966 times
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Cannot shoot icons for units

Post by Forboding Angel »

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.
User avatar
triton
Lobby Moderator
Posts: 330
Joined: 18 Nov 2009, 14:27

Re: Cannot shoot icons for units

Post by triton »

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?
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Cannot shoot icons for units

Post by Silentwings »

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),
User avatar
triton
Lobby Moderator
Posts: 330
Joined: 18 Nov 2009, 14:27

Re: Cannot shoot icons for units

Post by triton »

thx, btw the most important one would be the underwater situation, I think.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Cannot shoot icons for units

Post by PicassoCT »

X, y, z =Spring. GetUnitPosition (Unitid)
If y<0 then
Post Reply

Return to “Feature Requests”