flat 2-Dimensional units..

Spring EngineLua Scripts

5725 (0 today)

File Information

Title / Version flat 2-Dimensional units.. v1.5
License Freeware / Free
Filename gui_flat2dview.lua
Filesize 19.76 KB
Date 01/09/2011 - 17:29
Changed 07/03/2011 - 12:28
Publisher / Author xponen (Uploaded by xponen)


"flat2DView.lua" (v1.5) (if enabled) will set SPRING's "draw distance" to 0 and then re-render the currently 'invisible' units with build-picture and/or a static model. It uses the unit's build-picture and when the unit doesn't have a build-picture (or if its build-picture is less than 32x32 in size) then it will be drawn as a 3d object that do not have articulate animation.

The purpose of this widget is to increase performance on low-end computers. For example; to be playing Chicken-Mod can be soo laggy such that any standard anti-lag measure (low setting) would not be enough; so this widget provide the next step which is to play in 2d.

How It Work:
Basically it sets "draw distance" to 0 (/distdraw 0, and /disticon 100), and augment the ingame-view with build-picture and colors, and then revert the settings to its original value when the widget is turned-off. The focus of the widget is to display the build-picture as icon (such that the game can be played without 3D unit).
Issues (v1.5):
- press f1 and f1 again on Hexfarm map to fix icon disappearing during gamestart.

Version 1.1 will color any featureID according to its owner, and the icon is raised a little bit to reduce clipping near slopes.
Version 1.2 fix the problem of WIdget not restoring to default-LOD when widget crash or turned-off and raised the icon 1 more square, and stopped rendering icon when camera is at 4000 unit height.
Version 1.3 added feature that enlarge icons proportionaly with camera height, and add a simple firestate indicator.
Version 1.31 fix "error when drawing tree" and "error when drawing enemy firestate"
Version 1.4 fixed color issue and add 2 more unit state indicator (movestate, wait/repeat state)
Version 1.5 allow the icons to rotate under camera rotation, fixed any unforseen issues (has cleaned the code).