Page 1 of 1
How to to get a Widget working with a different Mod
Posted: 12 Dec 2009, 11:38
by iph8x
I'am a complety Noob with these Widgets, and i'd like to make some widgets for Example the Defence Range Widget working for a not Supported mod also an example Complete Anaihalion Advanced.
I'd woud be very nice if someone can spend some time in explaining this for a noob

.
Thanks
Re: How to to get a Widget working with a different Mod
Posted: 12 Dec 2009, 15:30
by manolo_
iph8x wrote:I'am a complety Noob with these Widgets, and i'd like to make some widgets for Example the Defence Range Widget working for a not Supported mod also an example Complete Anaihalion Advanced.
I'd woud be very nice if someone can spend some time in explaining this for a noob

.
Thanks
hiho,
i did the same for xta, so open the gui_defenseRange.lua
and scroll to the part
Code: Select all
local modConfig = {}
-- BA
--to support other mods
--table initialized and unitList is needed!
and add the mod:
switch e.g. BA with the mod u want and add the units from
here
Code: Select all
modConfig["BA"] = {}
modConfig["BA"]["unitList"] =
{
armclaw = { weapons = { 1 } },
cormaw = { weapons = { 1 } },
armllt = { weapons = { 1 } },
tawf001 = { weapons = { 1 } },
armhlt = { weapons = { 1 } },
armguard = { weapons = { 1, 1 } },
armrl = { weapons = { 2 } }, --light aa
packo = { weapons = { 2 } },
armcir = { weapons = { 2 } }, --chainsaw
armdl = { weapons = { 1 } }, --depthcharge
ajuno = { weapons = { 1 } },
armtl = { weapons = { 1 } }, --torp launcher
armfhlt = { weapons = { 1 } }, --floating hlt
armfrt = { weapons = { 2 } }, --floating rocket laucher
armamb = { weapons = { 1,1 } }, --ambusher
armpb = { weapons = { 1 } }, --pitbull
armanni = { weapons = { 1 } },
armflak = { weapons = { 2 } },
mercury = { weapons = { 2 } },
armemp = { weapons = { 1 } },
armamd = { weapons = { 3 } }, --antinuke
armbrtha = { weapons = { 1 } },
armvulc = { weapons = { 1 } },
--CORE
corexp = { weapons = { 1 } },
cormaw = { weapons = { 1 } },
corllt = { weapons = { 1 } },
hllt = { weapons = { 1 } },
corhlt = { weapons = { 1 } },
corpun = { weapons = { 1, 1 } },
corrl = { weapons = { 2 } },
madsam = { weapons = { 2 } },
corerad = { weapons = { 2 } },
cordl = { weapons = { 1 } },
cjuno = { weapons = { 1 } },
corfhlt = { weapons = { 1 } }, --floating hlt
cortl = { weapons = { 1 } }, --torp launcher
corfrt = { weapons = { 2 } }, --floating rocket laucher
cortoast = { weapons = { 1 } },
corvipe = { weapons = { 1 } },
cordoom = { weapons = { 1 } },
corflak = { weapons = { 2 } },
screamer = { weapons = { 2 } },
cortron = { weapons = { 1 } },
corfmd = { weapons = { 3 } },
corint = { weapons = { 1 } },
corbuzz = { weapons = { 1 } }
}
--implement this if you want dps-depending ring-colors
--colors will be interpolated by dps scores between min and max values. values outside range will be set to nearest value in range -> min or max
modConfig["BA"]["armorTags"] = {}
modConfig["BA"]["armorTags"]["air"] = "vtol"
modConfig["BA"]["armorTags"]["ground"] = "else"
modConfig["BA"]["dps"] = {}
modConfig["BA"]["dps"]["ground"] = {}
modConfig["BA"]["dps"]["air"] = {}
modConfig["BA"]["dps"]["ground"]["min"] = 50
modConfig["BA"]["dps"]["ground"]["max"] = 500
modConfig["BA"]["dps"]["air"]["min"] = 80
modConfig["BA"]["dps"]["air"]["max"] = 500
--end of dps-colors
--implement this if you want custom colors - we dont want it for BA
--[[
modConfig["BA"]["color"] = {}
modConfig["BA"]["color"]["enemy"] = {}
modConfig["BA"]["color"]["enemy"]["ground"] = {}
modConfig["BA"]["color"]["enemy"]["air"] = {}
modConfig["BA"]["color"]["enemy"]["nuke"] = {}
modConfig["BA"]["color"]["enemy"]["ground"]["min"] = { 1.0, 0.0, 0.0 }
modConfig["BA"]["color"]["enemy"]["ground"]["max"] = { 1.0, 1.0, 0.0 }
modConfig["BA"]["color"]["enemy"]["air"]["min"] = { 0.0, 1.0, 0.0 }
modConfig["BA"]["color"]["enemy"]["air"]["max"] = { 0.0, 0.0, 1.0 }
modConfig["BA"]["color"]["enemy"]["nuke"] = { 1.0, 1.0, 1.0 }
modConfig["BA"]["color"]["ally"] = modConfig["BA"]["color"]["enemy"]
--]]
--end of custom colors
--end of BA
Re: How to to get a Widget working with a different Mod
Posted: 12 Dec 2009, 15:57
by iph8x
Thanks, but there is a little Problem... The Mod is not in the List.
Re: How to to get a Widget working with a different Mod
Posted: 12 Dec 2009, 16:54
by very_bad_soldier
Then try this:
1. Change the modfile's extension to "zip"
2. Extract it
To find out your mod's shortname:
-Open modinfo.tdf in your editor
-Look for the tag "shortname". This is the mod identifier to use in the table.
To find out unit names:
-Go to the directory "units"
-You will see one definition file for each unit in the mod. Open some of them. ("armflash.fbi" for example)
-"unitname" is the name to use as identifier (Look at the tag "name" to find out how the unit is called ingame)
I hope this helps. I never made a mod or anything similar, so use at your own risk
BTW:
The weapon codes in the table of the lua widget are:
1 = Ground Weapon
2 = AntiAir Weapon
3 = AntiNuke Weapon
Re: How to to get a Widget working with a different Mod
Posted: 12 Dec 2009, 18:39
by iph8x
Thanks, but is ther realy no other way the MANUALY

Enter all This Units ?
Re: How to to get a Widget working with a different Mod
Posted: 12 Dec 2009, 19:59
by very_bad_soldier
Keep in mind that defenseRange is meant for static defenses only. The Arm Flash was a bad example.
You will only want to add a fraction of the complete unit set to that widget.
Re: How to to get a Widget working with a different Mod
Posted: 13 Dec 2009, 01:40
by FLOZi
Why doesn't it just detect all static, armed units?
Re: How to to get a Widget working with a different Mod
Posted: 13 Dec 2009, 01:46
by very_bad_soldier
It did once but I changed it. You have not enough control over which units are considered static defenses. There are static defenses you would not want to show up. And you cant reliable say if its antiground/antiair or even both.
Cmon its just 15-20 mins of work which you do once for a mod and you have full control over the whole result.
Re: How to to get a Widget working with a different Mod
Posted: 13 Dec 2009, 02:57
by Forboding Angel
Umm, use defense ranges included in EvoRTS, it will work for old mods. And if you read the description in the widget database, it tells you to use an older version for mods that aren't BA.
Re: How to to get a Widget working with a different Mod
Posted: 13 Dec 2009, 14:16
by very_bad_soldier
Forboding Angel wrote:And if you read the description in the widget database, it tells you to use an older version for mods that aren't BA.
Are you confusing it with Attack-AoE maybe?
Re: How to to get a Widget working with a different Mod
Posted: 14 Dec 2009, 03:38
by Tribulex
very_bad_soldier wrote:Forboding Angel wrote:And if you read the description in the widget database, it tells you to use an older version for mods that aren't BA.
Are you confusing it with Attack-AoE maybe?
yes he is.
Re: How to to get a Widget working with a different Mod
Posted: 14 Dec 2009, 05:37
by FLOZi
very_bad_soldier wrote:It did once but I changed it. You have not enough control over which units are considered static defenses. There are static defenses you would not want to show up. And you cant reliable say if its antiground/antiair or even both.
Cmon its just 15-20 mins of work which you do once for a mod and you have full control over the whole result.
You could include all static, armed units then have a mod specific blacklist. I guess that doesn't help with antiground/air though.
Re: How to to get a Widget working with a different Mod
Posted: 14 Dec 2009, 06:42
by Tribulex
Allow the lua to learn the behaviors of different units as you play.
Re: How to to get a Widget working with a different Mod
Posted: 14 Dec 2009, 07:47
by manolo_
very_bad_soldier wrote:It did once but I changed it. You have not enough control over which units are considered static defenses. There are static defenses you would not want to show up. And you cant reliable say if its antiground/antiair or even both.
Cmon its just 15-20 mins of work which you do once for a mod and you have full control over the whole result.
ive to agree, the work was done pretty fast (but xta is on modua.., so its was easier)
Re: How to to get a Widget working with a different Mod
Posted: 14 Dec 2009, 09:20
by Argh
Better question: why not just have the mod / game authors write simple customParams that can be used for stock Widgets like this, so that they know what type a thing is? Pretty easy solution, tbh, just some copy-pasta work.