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: 329
Joined: 18 Nov 2009, 14:27

Cannot shoot icons for units

Post by triton » 26 Oct 2018, 03:35

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 884 times
2 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14542
Joined: 17 Nov 2005, 02:43

Re: Cannot shoot icons for units

Post by Forboding Angel » 26 Oct 2018, 04:41

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.
2 x

User avatar
triton
Lobby Moderator
Posts: 329
Joined: 18 Nov 2009, 14:27

Re: Cannot shoot icons for units

Post by triton » 26 Oct 2018, 05:19

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?
1 x

User avatar
Silentwings
Moderator
Posts: 3554
Joined: 25 Oct 2008, 00:23

Re: Cannot shoot icons for units

Post by Silentwings » 26 Oct 2018, 05:30

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),
2 x

User avatar
triton
Lobby Moderator
Posts: 329
Joined: 18 Nov 2009, 14:27

Re: Cannot shoot icons for units

Post by triton » 26 Oct 2018, 05:34

thx, btw the most important one would be the underwater situation, I think.
1 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10128
Joined: 24 Jan 2006, 21:12

Re: Cannot shoot icons for units

Post by PicassoCT » 26 Oct 2018, 17:27

X, y, z =Spring. GetUnitPosition (Unitid)
If y<0 then
1 x

Post Reply

Return to “Feature Requests”