Mod unit list tool?
Moderator: Moderators
- tyran_nick
- Posts: 47
- Joined: 07 Mar 2010, 12:42
Mod unit list tool?
Has anyone created a tool to automatically generate a list of the units contained in a mod along with some basic info? Something like a small offline Modinfo. The units are in fbi.
Re: Mod unit list tool?
Code: Select all
for id,unitDef in pairs(UnitDefs) do
Spring.Echo("----------------------------------------")
for name,param in unitDef:pairs() do
Spring.Echo(name,param)
end
Spring.Echo("----------------------------------------")
end
- tyran_nick
- Posts: 47
- Joined: 07 Mar 2010, 12:42
Re: Mod unit list tool?
Thanks, I ll keep this in mind when I get more into lua coding. I was actually looking for a way to do this outside spring. I managed to do it with autoit. I ve attached an alpha output. If anyone is interested I can post the code here, though as you can see its more or less primitive...
http://rapidshare.com/files/418024553/unitlist.pdf
http://rapidshare.com/files/418024553/unitlist.pdf
Re: Mod unit list tool?
there is also http://modinfo.adune.nl/ so such a tool must already exist in some form.
Re: Mod unit list tool?
Is there a source code for http://modinfo.adune.nl/ ? I don't like it contains too old and too many mods, and does not contain the most recent mods. I would like to set up it locally if maintainer is busy.
Re: Mod unit list tool?
TradeMark's http://modinfo.adune.nl/ worked by parsing the FBI, and he got mightly annoyed when mods started using Lua'ed unitDefs.
That reminds me I promised him a Lua replacment I never delivered....
That reminds me I promised him a Lua replacment I never delivered....
Re: Mod unit list tool?
Ah, that is why data updating has been stuck.
Re: Mod unit list tool?
Keep in mind that it's perfectly possible to create unitdefs dynamically on game load (but hardly any projects utilize that yet). So any info you gather outside of game can in theory have little resemblance to what is in game. The code zwzsg provided will still work, no matter how the unitdefs were produced (fbi/lua/dynamic creation).tyran_nick wrote:I was actually looking for a way to do this outside spring.
- tyran_nick
- Posts: 47
- Joined: 07 Mar 2010, 12:42
Re: Mod unit list tool?
Indeed, though the reason I got into this was to be able to provide an informative list of units for a mutator mod that I m building. So for my case and, as you said, potentially for most cases, dynamically specified unitdefs is not a problem. I guess its much better for someone who downloads a mod to have a bit of details (with pics) of what to expect! Personally I find it boring to do the list manual... so I prefer to write an algorithm to do that for me
EDIT: how can I use zwzsg's code to output the result to a file instead of the console? Getting a list with the units and their attributes from spring and then automatically formatting it outside would be the most general solution I guess. That should handle both static and dynamic unitdefs and both fbi and luas, etc.
EDIT: how can I use zwzsg's code to output the result to a file instead of the console? Getting a list with the units and their attributes from spring and then automatically formatting it outside would be the most general solution I guess. That should handle both static and dynamic unitdefs and both fbi and luas, etc.
Re: Mod unit list tool?
Anything that went to the console will be in the infolog.txt, so you can get it from there. That's the fastest way.
It's also possible to modify the code so that it writes output to some other file.
It's also possible to modify the code so that it writes output to some other file.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Mod unit list tool?
That link went dead about 8 years ago when TradeMark left.
Newer version of the code was last seen on viewtopic.php?f=44&t=35306&p=578741&hil ... fo#p578741
Newer version of the code was last seen on viewtopic.php?f=44&t=35306&p=578741&hil ... fo#p578741
Re: Mod unit list tool?
The very point of having config files isolated is that they should be static.yuritch wrote:Keep in mind that it's perfectly possible to create unitdefs dynamically on game load (but hardly any projects utilize that yet). So any info you gather outside of game can in theory have little resemblance to what is in game. The code zwzsg provided will still work, no matter how the unitdefs were produced (fbi/lua/dynamic creation).tyran_nick wrote:I was actually looking for a way to do this outside spring.
Re: Mod unit list tool?
Did you just argue with a post from 2010?Jools wrote:The very point of having config files isolated is that they should be static.
Also, this really isn't the point.
https://github.com/spring1944/spring1944/pull/7 wouldn't have been possible with static defs a-la fbi.
defs are isolated for organisation reasons, that you generally know where to look in order to make a change. Staticness is very very unnecessary.
Re: Mod unit list tool?
Thanks. Maybe that will be used for BA 10.XX as well ?Silentwings wrote:That link went dead about 8 years ago when TradeMark left.
Newer version of the code was last seen on viewtopic.php?f=44&t=35306&p=578741&hil ... fo#p578741