Page 1 of 1

unitDefs to HTML-pages set exporter

Posted: 10 Nov 2012, 01:55
by PepeAmpere
Hi, Im sure someone did the same before me, but maybe his try is not known enough and maybe it does a bit different thing or work different way (than i needed). So here is the widget

WHAT DOES IT DO?

You launch standard game - from every unit defined in your choosen mod/gamefile widgets gets some choosen values (unit statistics). For each unit, it creates separate html page with all choosen stats + navigation (list of names of all units).

It creates one index.html and one style.css file, too.

Example result you can check: http://nota.machys.net/images/units/index.html

Currently widget creator contains three files:
  • ./LuaUI/Widgets/stat_mod_to_html.lua
  • ./LuaUI/Widgets/html-creator/css.lua
  • ./LuaUI/Widgets/html-creator/head.lua
POSSIBLE SETTINGS (in first file):
  • websiteURL (def: "http://nota.machys.net/" - put here your webpage or let empty -> "")
  • filePath (def: "LuaUI/stats/" - choose different folder in LuaUI - if you dont want create "stats" there - its folder for output data)
  • notaPageGoogleStatistics (def: "true" - for different game then NOTA let false OR edit google analytics in head.lua file and use own one)
  • backgroundColor (def: "fff")
  • backgroundColor2 (def: "ddd")
POSSIBLE ISSUES

I: I have no result.
A: Maybe you forgot to create "stats" folder in your spring ./LuaUI/

I: It says - "./LuaUI/stats/ doesnt exist" in my logfile but I created it
A: Maybe you look in the folder with some browser or file manager (folder testing is done by silly way - it tests renaming)

I: There are some units in result I never met in game
A: Yes, those bastards are hiding all the time.

I: I dont have any images as you on example page
A: Yes, you need to pick all images from you game, convert them to *.jpg and put into same folder as all html files

EXPECTED CRITICS
(I answer in Taunts shortcuts)

C: You code like my granny.
A: (1) (43)

C: There can be added many features, its not finished, there are only few values, its not possible to change the list of values
A: (202)

C: What is that for? It does almost nothing
A: (1), its for fast comparing, arguing about balance in you mod/game, for showing to newbies (if no better tools present around in your game community)

FUTURE:

At the end I want to say, it was done in few hours this afternoon to get the some end-value at the smallest time cost.

Another development depends on interest of you or our NOTA dudes.

Re: unitDefs to HTML-pages set exporter

Posted: 10 Nov 2012, 02:15
by gajop
at least sort units in the index by name

Re: unitDefs to HTML-pages set exporter

Posted: 10 Nov 2012, 03:09
by smoth
neat, I did one like this years ago and lost the source code. Good stuff. I didn't think of generating an index with all the names, that is a cool idea.

Re: unitDefs to HTML-pages set exporter

Posted: 10 Nov 2012, 03:16
by PepeAmpere
gajop wrote:at least sort units in the index by name
its sorted by name, unitDef name, not humanName ;)

Re: unitDefs to HTML-pages set exporter

Posted: 10 Nov 2012, 10:21
by knorke
zK has this http://zero-k.info/Static/UnitGuide made with similiar widget.

this was my try at unitguide generator, did not really do much:
http://knorke.darkstars.co.uk/ug/unitguide.html

Re: unitDefs to HTML-pages set exporter

Posted: 10 Nov 2012, 12:49
by Jools
Thanks for a job well done.

Re: unitDefs to HTML-pages set exporter

Posted: 10 Nov 2012, 15:17
by Google_Frog
I like the widget method because it will read values after unitdefs_posts has messed with them.

The reported LOS and speed values are very strange. Also only one weapon is reported and it has a strange damage value.

Re: unitDefs to HTML-pages set exporter

Posted: 10 Nov 2012, 18:34
by PepeAmpere
Google_Frog wrote:The reported LOS and speed values are very strange.
  • Yes, it looks some values are edited in postdef or by engine way. But still, i can cut the string to make it shorter.
Google_Frog wrote:Also only one weapon is reported and it has a strange damage value.
  • Yes, in new version i will write all weapons.
  • Strange DMG value is because some NOTA weapons have set some "strange" number as default and some normal for all armor classes (default is first in list, i write only dmg from first position) = so that "strange" number is never used, because every armor class have some own number. ---> i can list all damages for given weapon.

Re: unitDefs to HTML-pages set exporter

Posted: 22 Jan 2013, 00:59
by PepeAmpere
Hi, here is much more advanced version of previous widget.

Image

CHANGELOG 0.1 -> 0.7
  • 0.7 - new icons (ONLY FOR NOTA), rebalancing size of tables, fix of weapons names
  • 0.6 - basic icons (part of this .zip)
  • 0.5 - new Layout, all weapons, new stats of unit and weapons...
  • 0.2 - options - use different CSS, noNavigation
WHAT DOES IT DO NOW?

Gets some values and do nice tables with stats of unit. Now equiped with nice icons, nice size, more options, full weapons damages list, etc...

Page with links on example result you can check: http://nota.machys.net/nota-units

Contain three main files:
  • ./LuaUI/Widgets/stat_mod_to_html.lua
  • ./LuaUI/Widgets/html-creator/css.lua
  • ./LuaUI/Widgets/html-creator/head.lua
... and folder with 29 original Pepe's icons made in 30 minutes in old Windows Paintbrush :regret: NEW
  • ./LuaUI/stats/icons/
You are free to use them of course or make own ones and rewrite those in icons folder.

POSSIBLE SETTINGS (in stat_mod_to_html.lua file):
  • title (def: false - if you want full alone standing page as in version 0.1, let this TRUE) NEW
  • navigation (def: false - list of links on other units, in version 0.1 it was hardcoded TRUE) NEW
  • footer (def: false - additional foot info with link on main page, , in version 0.1 it was hardcoded TRUE) NEW
  • websiteURL (def: "http://nota.machys.net/" - put here your webpage or let empty -> "")
  • filePath (def: "LuaUI/stats/" - choose different folder in LuaUI - if you dont want create "stats" there - its folder for output data)
  • notaPageGoogleStatistics (def: false - for different game then NOTA let false OR edit google analytics in head.lua file and use own one)
  • backgroundColor (def: "fff")
  • backgroundColor2 (def: "ddd")
  • ownCSS - (def: false - do you want use own CSS or external - for example the one on NOTA page) NEW
  • cssFile - (def: nota page CCS file URL - if you want to use your web CSS, add here its URL) NEW
SOME MARKS
Thx to danil_kalina for new icons set and to Godde for consulting the stats representation and layout.

Enjoy! :mrgreen:

Re: unitDefs to HTML-pages set exporter

Posted: 18 Feb 2013, 03:51
by PepeAmpere
CHANGELOG 0.7 -> 0.7.1
  • support for burst/salvo multiplier - if it is not 1, the info about number of projectiles is added into weapon name cell