Request to widget makers: Iconmodel

Request to widget makers: Iconmodel

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Request to widget makers: Iconmodel

Post by KDR_11k »

There are some widgets that display the unit model as an icon (e.g. idle builders, selection buttons, group buttons). However, this is the base pose of the model used for the unit. For some units this is not desirable since e.g. the unit shares its model with others by hiding parts, contains effect objects (e.g. construction frames or the hourglass on the window in Kernel Panic Corruption) that aren't shown on the model normally or the unit is just posed in an unappealing or unrepresentative way (e.g. KPC Security Hole or Kernel) for better scripting.

It would be helpful if modders could define a separate model to be used for these widgets that have the hidden parts removed and possibly stand in a position that's more representative of the unit, perhaps even with additions for easier differentiation of the selection icons.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Said model should also be used for the ghost building you see when placing it, if I may add.

However, personnaly I'd just like a Cob Function, MakesModelPretty(), that contains all the move/turn to make the model presentable. Because I hate any kind of duplicate, makes maintenace hellish.

Ex: You touch up a model, with your method you have to touch up the icon model as well. While with mine, no.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Yes but I figured Lua just reads the data from the model and dumps it on the screen with no understanding for what a COB is.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

I have a different idea. Use the buildpic instead of a 3D model.
chlue
Posts: 101
Joined: 28 Dec 2005, 20:48

Post by chlue »

I used this luafunction to draw the buildpic of a unit some time ago.

Code: Select all

local function drawbuildPic(coord,unitDefID,Color)
	gl.Color(Color)
	gl.Texture("#" .. unitDefID)
	gl.Shape(GL_QUADS, {
    { v = { coord.x + 1, coord.y + 1 }, t = { 0, 1 } },
    { v = { coord.x+iconSizeX - 0, coord.y + 1 }, t = { 1, 1 } },
    { v = { coord.x+iconSizeX - 0, coord.y+iconSizeY - 0 }, t = { 1, 0 } },
    { v = { coord.x + 1, coord.y+iconSizeY - 0 }, t = { 0, 0 } },
	})
	gl.Texture(false)
end
(needs the variables iconSizeX, iconSizeY)
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

gl.TexRect() is a faster / easier call that can be used with SVN lua.
Post Reply

Return to “Lua Scripts”