Page 1 of 1
Custom icontypes.lua cant be included by map?
Posted: 04 Jan 2012, 16:14
by Beherith
I did the above, but it doesnt work.
Added the following to gamedata/icontypes.lua:
Code: Select all
local icontypes = {
tree = {
bitmap="icons/treeicon.tga",
size=1,
},
}
return icontypes
Added the corresponding icon (in icons/) and the def to the unit:
Code: Select all
uad0_pine_3_xxl = {
...
reclaimable=true,
description = "A fucking tree",
footprintx = 1,
footprintz = 1,
icontype = "tree",
...
name = "Big tree",
objectname = "ad0_pine_3_xxl.s3o",
...
},
TLDR: I want trees that I spawn as neutral gaia units to have no radar dot on minimap and map.
Re: Custom icontypes.lua cant be included by map?
Posted: 04 Jan 2012, 16:22
by knorke
wanted that too (for gaiea birds), appearently not possible.
Maybe games can just be asked to always include an "empty" icontype?
/edit:
until there is an icontypes_map.lua and movedefs_map.lua and armordefs_map.lua etc
Re: Custom icontypes.lua cant be included by map?
Posted: 04 Jan 2012, 16:23
by FLOZi
Need a way to cleanly load such defs from both map & game first.
Re: Custom icontypes.lua cant be included by map?
Posted: 04 Jan 2012, 16:35
by Beherith
Thanks guys!
Re: Custom icontypes.lua cant be included by map?
Posted: 04 Jan 2012, 16:55
by Niobium
Give the units stealth? -> No radar dot
Re: Custom icontypes.lua cant be included by map?
Posted: 04 Jan 2012, 17:32
by Beherith
They are already
Code: Select all
SetUnitRotation(treeID, 0, math.random()*32768, 0)
SetUnitNeutral(treeID,true)
SetUnitAlwaysVisible(treeID,true)
So stealth doesnt help

Re: Custom icontypes.lua cant be included by map?
Posted: 05 Jan 2012, 02:13
by Niobium
Code: Select all
Spring.AddUnitIcon('BLANK', 'LuaUI\\Icons\\blank.png')
Spring.SetUnitDefIcon(UnitDefNames.armflash.id, 'BLANK')
^ Worked for me (Where blank.png is a 1x1 transparent pixel)
Re: Custom icontypes.lua cant be included by map?
Posted: 05 Jan 2012, 02:19
by knorke
wow, unit icons can be change during gameplay? nice.
Re: Custom icontypes.lua cant be included by map?
Posted: 05 Jan 2012, 04:06
by jK
since a long time, trepan even made a widget that makes commander radar icons blink
Re: Custom icontypes.lua cant be included by map?
Posted: 05 Jan 2012, 18:10
by Beherith
Nice, didnt even notice yall replied to the thread, I found nio's solution too :D