Custom icontypes.lua cant be included by map?

Custom icontypes.lua cant be included by map?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Custom icontypes.lua cant be included by map?

Post 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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Custom icontypes.lua cant be included by map?

Post 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
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Custom icontypes.lua cant be included by map?

Post by FLOZi »

Need a way to cleanly load such defs from both map & game first.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Custom icontypes.lua cant be included by map?

Post by Beherith »

Thanks guys!
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Custom icontypes.lua cant be included by map?

Post by Niobium »

Give the units stealth? -> No radar dot
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Custom icontypes.lua cant be included by map?

Post 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 :(
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Custom icontypes.lua cant be included by map?

Post 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)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Custom icontypes.lua cant be included by map?

Post by knorke »

wow, unit icons can be change during gameplay? nice.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Custom icontypes.lua cant be included by map?

Post by jK »

since a long time, trepan even made a widget that makes commander radar icons blink
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Custom icontypes.lua cant be included by map?

Post by Beherith »

Nice, didnt even notice yall replied to the thread, I found nio's solution too :D
Post Reply

Return to “Game Development”