Mod unit list tool?

Mod unit list tool?

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
tyran_nick
Posts: 47
Joined: 07 Mar 2010, 12:42

Mod unit list tool?

Post by tyran_nick »

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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Mod unit list tool?

Post by zwzsg »

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
User avatar
tyran_nick
Posts: 47
Joined: 07 Mar 2010, 12:42

Re: Mod unit list tool?

Post by tyran_nick »

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

Re: Mod unit list tool?

Post by knorke »

there is also http://modinfo.adune.nl/ so such a tool must already exist in some form.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Mod unit list tool?

Post by slogic »

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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Mod unit list tool?

Post by zwzsg »

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....
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Mod unit list tool?

Post by slogic »

Ah, that is why data updating has been stuck.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Mod unit list tool?

Post by yuritch »

tyran_nick wrote:I was actually looking for a way to do this outside spring.
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).
User avatar
tyran_nick
Posts: 47
Joined: 07 Mar 2010, 12:42

Re: Mod unit list tool?

Post by tyran_nick »

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.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Mod unit list tool?

Post by yuritch »

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.
User avatar
albator
Posts: 866
Joined: 14 Jan 2009, 14:20

Re: Mod unit list tool?

Post by albator »

Anyone know where did this go ?

http://modinfo.adune.nl/
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Mod unit list tool?

Post by Silentwings »

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
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Mod unit list tool?

Post by Jools »

yuritch wrote:
tyran_nick wrote:I was actually looking for a way to do this outside spring.
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).
The very point of having config files isolated is that they should be static.
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: Mod unit list tool?

Post by hokomoko »

Jools wrote:The very point of having config files isolated is that they should be static.
Did you just argue with a post from 2010?

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.
User avatar
albator
Posts: 866
Joined: 14 Jan 2009, 14:20

Re: Mod unit list tool?

Post by albator »

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
Thanks. Maybe that will be used for BA 10.XX as well ?
Post Reply

Return to “Game Development”