Page 1 of 1

AirField/Neutral Side/Radar Icons

Posted: 15 Mar 2011, 11:34
by Von66341
Hey!

I was wondering if it is possible to do the following:

1. Create an airfield and have aircrafts land at the airfield when fuel/ammo low or after completing the attack mission?

2. Neutral Side
Is it possible to create a neutral side that on sight of it our units won't fire at them?
Basically this neutral side does nothing, like civilians.

3. Is there a file that determine what radar icon is show when the unit is detected on radar?

Re: AirField/Neutral Side/Radar Icons

Posted: 15 Mar 2011, 15:12
by SirMaverick
Von66341 wrote:Hey!

I was wondering if it is possible to do the following:

1. Create an airfield and have aircrafts land at the airfield when fuel/ammo low or after completing the attack mission?
CA/ZK does this via fuel.
2. Neutral Side
Is it possible to create a neutral side that on sight of it our units won't fire at them?
Basically this neutral side does nothing, like civilians.
http://springrts.com/phpbb/viewtopic.ph ... al#p465765
3. Is there a file that determine what radar icon is show when the unit is detected on radar?
gamedata/icontypes.lua

Re: AirField/Neutral Side/Radar Icons

Posted: 16 Mar 2011, 07:52
by Von66341
Thanks SirMaverick!
Your link to the neutral units really helped alot =)

For the airfield, any idea how it is scripted? or how should I go about doing it?

For RadarIcon types, say I would like to resize the size of the icon.
I won't be able to do it in gamedata/icontypes.lua correct?

Thanks! =D

Re: AirField/Neutral Side/Radar Icons

Posted: 17 Mar 2011, 02:20
by j5mello
for the airfield, what kind are you looking fore?

a realistic style one with landing strips, taxiways, and hangars?
or Red Alert style VTOL landing pads?

Re: AirField/Neutral Side/Radar Icons

Posted: 17 Mar 2011, 08:49
by Von66341
Hey!
Am looking an aircraft with its own landing field. Don't need much fancy infranstructure maybe a circle to represent.

The aircraft with the landing field will spawn with individual aircraft.
And when health/fuels reaches a certain level the aircraft will return to the airfield automatically to re-charge.

Re: AirField/Neutral Side/Radar Icons

Posted: 17 Mar 2011, 17:42
by knorke
The aircraft with the landing field will spawn with individual aircraft.
Do something like:

Code: Select all

gadget:UnitCreated (bla)
if newUnitName == "landing field" then Spring.CreateUnit (aircraft, PositionOfLandingField) end
For RadarIcon types, say I would like to resize the size of the icon.
I won't be able to do it in gamedata/icontypes.lua correct?
you can do it in icontypes.lua
size=10, -- default is 1, > 1 means bigger icon
radiusadjust=1,
icontypes.lua i use, all icons are rescaled a bit:
http://pastebin.com/bQWYYUWt
And when health/fuels reaches a certain level the aircraft will return to the airfield automatically to re-charge.
To any airfield or just to the airfield it was built from?

Re: AirField/Neutral Side/Radar Icons

Posted: 18 Mar 2011, 00:07
by Neddie
j5mello wrote:for the airfield, what kind are you looking fore?

a realistic style one with landing strips, taxiways, and hangars?
or Red Alert style VTOL landing pads?
He can do both, but the realistic one is much harder. I can't remember who set it up, but we did test one in 1944 some time ago.

Re: AirField/Neutral Side/Radar Icons

Posted: 18 Mar 2011, 01:47
by Von66341
For the radaricon, if I would like to resize it based on the unit footprint? I should script it in icontypes.lua too?

Basically there is no building of aircraft, the aircraft spawns with the airfield at the begining of the game and it will return/land to the start point at low fuel/health.

Neddie, thanks! I saw the awesome work you guys did with 1944 airfield. Care to share the reasons/problems why it was remove it the newer verision?

Re: AirField/Neutral Side/Radar Icons

Posted: 18 Mar 2011, 04:38
by Von66341
Hey. I did some try out for the radar.

I created a widget that will read the value I want for the radar icon. Different unit different value. Code here:

Code: Select all

function widget:GetInfo(0
	return { 
		name = "Radar Icon Sizing", 
		desc = " Different Radar Icon Size for different unit", 
		author ="Von66341",
		license ="",
		layer =0, 
		enabled = true --loaded by default
	}
end 

function widget:UnitCreated(unitID, unitDefID, unitTeam)
	local ud = UnitDefs[unitDefID[ 
	if ud.customParams.radariconsize then 
		Spring.Echo("ud.customParams.radariconsize")
		Spring.Echo(ud.customParams.radariconsize)
		local radarsize = ud.customParams.radariconsize
	end 
end 
At the gamedata/icontypes.lua, i modify it to include the first few lines. Code here:

Code: Select all

local radarsize = VFS.Include("LuaUI/Widgets/iconsize.lua")

local iconTypes = {
	default = {
		bitmap		=	"icons/alert.tga",
		size			=	radarsize,
		distance	=	5000,
	},
	rifle = {
		bitmap		=	"icons/rifle.tga",
		size			=	1.65,
		distance	=	0.15,
	},
	paratrooper = {
		bitmap		=	"icons/rifle.tga",
		size			=	1.65,
		distance	=	5000,
	},
	assault = {
		bitmap		=	"icons/assault.tga",
		size			=	1.5,
		distance	=	0.15,
	},
	antitank = {
		bitmap		=	"icons/antitank.tga",
		size			=	1.5,
		distance	=	0.15,
	},
	mortar = {
		bitmap		=	"icons/mortar.tga",
		size			=	2.5,
		distance	=	0.15,
	},
	sniper = {
		bitmap		=	"icons/sniper.tga",
		size			=	1.8,
		distance	=	0.15,
	},
	officer = {
		bitmap		=	"icons/binos.tga",
		size			=	1.4,
		distance	=	0.15,
	},
	engineer = {
		bitmap		=	"icons/engineer.tga",
		size			=	2,
		distance	=	0.15,
	},
	advancedengineer = {
		bitmap		=	"icons/engineer2.tga",
		size			=	2,
		distance	=	0.15,
	},
	engineervehicle = {
		bitmap		=	"icons/engineervehicle.tga",
		size			=	2.25,
		distance	=	0.2,
	},
	lightmg = {
		bitmap		=	"icons/lightmg.tga",
		size			=	3,
		distance	=	0.15,
	},
	bar = {
		bitmap		=	"icons/bar.tga",
		size			=	2.25,
		distance	=	0.15,
	},
	flame = {
		bitmap		=	"icons/flame.tga",
		size			=	2.25,
		distance	=	0.15,
	},
	aaartillery = {
		bitmap		=	"icons/aaartillery.tga",
		size			=	3,
		distance	=	0.2,
	},
	atartillery = {
		bitmap		=	"icons/ATartillery.tga",
		size			=	3.25,
		distance	=	0.25,
	},
	aahalftrack = {
		bitmap		=	"icons/aahalftrack.tga",
		size			=	3,
		distance	=	0.2,
	},
	aacar = {
		bitmap		=	"icons/AAcar.tga",
		size			=	2,
		distance	=	0.2,
	},
	aatruck = {
		bitmap		=	"icons/AAtruck.tga",
		size			=	2,
		distance	=	0.2,
	},
	attruck = {
		bitmap		=	"icons/ATtruck.tga",
		size			=	2,
		distance	=	0.2,
	},
	armoredcar = {
		bitmap		=	"icons/armoredcar.tga",
		size			=	2,
		distance	=	0.2,
	},
	artillery = {
		bitmap		=	"icons/artillery.tga",
		size			=	3.25,
		distance	=	0.25,
	},
	bomber = {
		bitmap		=	"icons/bomber.tga",
		size			=	2.5,
		distance	=	1,
	},
	fighter = {
		bitmap		=	"icons/fighter.tga",
		size			=	2.5,
		distance	=	1,
	},
	fighterbomber = {
		bitmap		=	"icons/fighterbomber.tga",
		size			=	2.5,
		distance	=	1,
	},

	gerhq = {
		bitmap		=	"icons/gerhq.tga",
		size			=	4,
		distance	=	0.8,
	},
	ushq = {
		bitmap		=	"icons/ushq.tga",
		size			=	4,
		distance	=	0.8,
	},
	gbrhq = {
		bitmap		=	"icons/GBRHQ.tga",
		size			=	4,
		distance	=	0.8,
	},
	halftrack = {
		bitmap		=	"icons/halftrack.tga",
		size			=	2,
		distance	=	0.2,
	},
	heavytank = {
		bitmap		=	"icons/heavytank.tga",
		size			=	2.75,
		distance	=	0.4,
	},
	medtank = {
		bitmap		=	"icons/medtank.tga",
		size			=	2,
		distance	=	0.3,
	},
	lighttank = {
		bitmap		=	"icons/medtank.tga",
		size			=	1.75,
		distance	=	0.3,
	},
	jeep = {
		bitmap		=	"icons/jeep.tga",
		size			=	2.25,
		distance	=	0.2,
	},
	recon = {
		bitmap		=	"icons/recon.tga",
		size			=	2.25,
		distance	=	0.75,
	},
	selfprop = {
		bitmap		=	"icons/selfprop.tga",
		size			=	2,
		distance	=	0.3,
	},
	sparty = {
		bitmap		=	"icons/sparty.tga",
		size			=	2.25,
		distance	=	0.3,
	},
	stockpile = {
		bitmap		=	"icons/stockpile.tga",
		size			=	3,
		distance	=	0.25,
	},
	rockettruck = {
		bitmap		=	"icons/rockettruck.tga",
		size			=	2.5,
		distance	=	0.25,
	},
	truck = {
		bitmap		=	"icons/truck.tga",
		size			=	2,
		distance	=	0.2,
	},
	htruck = {
		bitmap		=	"icons/Htruck.tga",
		size			=	2,
		distance	=	0.2,
	},
	rtruck = {
		bitmap		=	"icons/Rtruck.tga",
		size			=	2,
		distance	=	0.2,
	},
	ammo = {
		bitmap		=	"icons/ammo.tga",
		size			=	2.25,
		distance	=	0.3,
	},
	ammo2 = {
		bitmap		=	"icons/ammo2.tga",
		size			=	2.25,
		distance	=	0.3,
	},	
	factory = {
		bitmap		=	"icons/factory.tga",
		size			=	2.75,
		distance	=	0.4,
	},
	usflag = {
		bitmap		=	"icons/ushq.tga",
		size			=	2.25,
		distance	=	0.3,
	},
	gbrflag = {
		bitmap		=	"icons/gbrhq.tga",
		size			=	2.25,
		distance	=	0.3,
	},
	gerflag = {
		bitmap		=	"icons/gerhq.tga",
		size			=	2.25,
		distance	=	0.3,
	},
	mines = {
		bitmap		=	"icons/guard.tga",
		size			=	0.0001,
		distance	=	80,
	},
	rusflag = {
		bitmap		=	"icons/rushq.tga",
		size			=	2.5,
		distance	=	0.3,
	},
	commissar = {
		bitmap		=	"icons/rushq.tga",
		size			=	1.75,
		distance	=	0.15,
	},
	partisan = {
		bitmap		=	"icons/partisan.tga",
		size			=	1.65,
		distance	=	0.15,
	},
	commando = {
		bitmap		=	"icons/commando.tga",
		size			=	2,
		distance	=	0.15,
	},
	rubber = {
		bitmap		=	"icons/rubber.tga",
		size			=	2.5,
		distance	=	0.4,
	},
	lttrans = {
		bitmap		=	"icons/lttrans.tga",
		size			=	2.5,
		distance	=	0.4,
	},
	raft	= {
		bitmap		=	"icons/raft.tga",
		size			=	2.5,
		distance	=	0.4,
	},
	rusptrd = {
		bitmap		=	"icons/rusptrd.tga",
		size			=	2.25,
		distance	=	0.15,
	},
	barracks = {
		bitmap		=	"icons/barracks.tga",
		size			=	3,
		distance	=	0.4,
	},
	radar = {
		bitmap		=	"icons/radar.tga",
		size			=	4,
		distance	=	0.3,
	},
	flag = {
		bitmap		=	"icons/flag.tga",
		size			=	2.5,
		distance	=	0.3,
	},
	shack = {
		bitmap		=	"icons/shack.tga",
		size			=	2.75,
		distance	=	0.3,
	},
	shipyard = {
		bitmap		=	"icons/anchor.tga",
		size			=	5,
		distance	=	0.3,
	},
	hshipyard = {
		bitmap		=	"icons/anchor2.tga",
		size			=	5,
		distance	=	0.3,
	},
	destroyer = {
		bitmap		=	"icons/destroyer.tga",
		size			=	5,
		distance	=	0.3,
	},
	torpboat = {
		bitmap		=	"icons/t-boat.png",
		size			=	4,
		distance	=	0.3,
	},
	gunboat = {
		bitmap		=	"icons/g-boat.png",
		size			=	4,
		distance	=	0.3,
	},
	landingship = {
		bitmap		=	"icons/l-boat.png",
		size			=	4,
		distance	=	0.3,
	},
	transportship = {
		bitmap		=	"icons/transportship.tga",
		size			=	5,
		distance	=	0.3,
	},
	transportplane = {
		bitmap		=	"icons/transportplane.tga",
		size			=	2.5,
		distance	=	1,
	},
	flametank = {
		bitmap		=	"icons/flametank.tga",
		size			=	2.25,
		distance	=	0.2,
	},
}

return iconTypes
However when I run it the following error is received:
error = 2, gamedata/icontypes.lua, error=2, LuaUI/Widgets/iconsize.lua, [string "LuaUI/Widgets/iconsize.lua"]:1; attempt to index gloval 'widget' (a nil value)

Any ideas how I can resolve this?

Re: AirField/Neutral Side/Radar Icons

Posted: 18 Mar 2011, 23:44
by Neddie
Von66341 wrote:Neddie, thanks! I saw the awesome work you guys did with 1944 airfield. Care to share the reasons/problems why it was remove it the newer verision?
I believe it isn't presently in game because the functionally limited size of maps makes such a large building unreasonable. The limitations of the current map format dictate a number of decisions on our part.

Re: AirField/Neutral Side/Radar Icons

Posted: 21 Mar 2011, 01:37
by Von66341
Hmm so the main reason was it was the airfield was big is size?
And the maps can't really accomoadate to it?

Nothing much on the time spend on take off/landing?

Thanks!

Re: AirField/Neutral Side/Radar Icons

Posted: 21 Mar 2011, 07:56
by knorke
However when I run it the following error is received:
error = 2, gamedata/icontypes.lua, error=2, LuaUI/Widgets/iconsize.lua, [string "LuaUI/Widgets/iconsize.lua"]:1; attempt to index gloval 'widget' (a nil value)

Any ideas how I can resolve this?
You have this Widgets/iconsize.lua file and then include it in a file that is in gamedate\
I think widgets can only be in LuaUI\widgets, and as your iconsize.lua has widget: stuff, it does not work. I think the gamedata/icontypes.lua is just a config file anyway and not code that is run. That means you can probally put some math stuff in there, like size = 50*2 but UnitCreated() and similiar will not work.

Re: AirField/Neutral Side/Radar Icons

Posted: 21 Mar 2011, 08:43
by Von66341
Hmm...say for example, I want to resize the icons in gamedata/icontypes.lua to depend on the size of the ship/tank.

So for example, big tank have bigger icon. and smaller tank will have smaller icon.

I won't be able to use the widget way to varies the size?
Or there are other ways to be able to acheive this?

Thanks!

Re: AirField/Neutral Side/Radar Icons

Posted: 24 Mar 2011, 09:23
by knorke
http://springrts.com/wiki/CustomUnitIcons

radiusadjust is a boolean (0 or 1) that tells Spring whether or not the icon should scale with the unit radius. Default is 0 (false).

:?:

Re: AirField/Neutral Side/Radar Icons

Posted: 28 Mar 2011, 03:29
by Von66341
hey! thanks for the info on the radiusadjust.

Would like to check, for the unit radius is there a FBI tag or a file which we could make changes to?

Thanks!

Re: AirField/Neutral Side/Radar Icons

Posted: 29 Mar 2011, 03:04
by knorke
i think unit radius is the radius set in upspring.