unitDefs to HTML-pages set exporter

unitDefs to HTML-pages set exporter

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
PepeAmpere
Posts: 586
Joined: 03 Jun 2010, 01:28

unitDefs to HTML-pages set exporter

Post by PepeAmpere » 10 Nov 2012, 01:55

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.
Attachments
mod_stats_exporter.zip
just unpack in your spring folder and it should create the result after init of first game you try to play
(4.23 KiB) Downloaded 60 times
Last edited by PepeAmpere on 10 Nov 2012, 18:41, edited 1 time in total.
0 x

gajop
Moderator
Posts: 3023
Joined: 05 Aug 2009, 20:42

Re: unitDefs to HTML-pages set exporter

Post by gajop » 10 Nov 2012, 02:15

at least sort units in the index by name
0 x

User avatar
smoth
Posts: 22298
Joined: 13 Jan 2005, 00:46

Re: unitDefs to HTML-pages set exporter

Post by smoth » 10 Nov 2012, 03:09

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.
0 x

User avatar
PepeAmpere
Posts: 586
Joined: 03 Jun 2010, 01:28

Re: unitDefs to HTML-pages set exporter

Post by PepeAmpere » 10 Nov 2012, 03:16

gajop wrote:at least sort units in the index by name
its sorted by name, unitDef name, not humanName ;)
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: unitDefs to HTML-pages set exporter

Post by knorke » 10 Nov 2012, 10:21

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
Attachments
tp_unitguide.lua
(5.09 KiB) Downloaded 27 times
0 x

User avatar
Jools
XTA Developer
Posts: 2804
Joined: 23 Feb 2009, 16:29

Re: unitDefs to HTML-pages set exporter

Post by Jools » 10 Nov 2012, 12:49

Thanks for a job well done.
0 x

Google_Frog
Moderator
Posts: 2434
Joined: 12 Oct 2007, 09:24

Re: unitDefs to HTML-pages set exporter

Post by Google_Frog » 10 Nov 2012, 15:17

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.
0 x

User avatar
PepeAmpere
Posts: 586
Joined: 03 Jun 2010, 01:28

Re: unitDefs to HTML-pages set exporter

Post by PepeAmpere » 10 Nov 2012, 18:34

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.
0 x

User avatar
PepeAmpere
Posts: 586
Joined: 03 Jun 2010, 01:28

Re: unitDefs to HTML-pages set exporter

Post by PepeAmpere » 22 Jan 2013, 00:59

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:
Attachments
mod_stats_exporter_v0_7.zip
version 0.7 of widget
(14.3 KiB) Downloaded 27 times
sea_drag_example.jpg
example of place iframe with seadragon on nota page
(68.48 KiB) Not downloaded yet
0 x

User avatar
PepeAmpere
Posts: 586
Joined: 03 Jun 2010, 01:28

Re: unitDefs to HTML-pages set exporter

Post by PepeAmpere » 18 Feb 2013, 03:51

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
Attachments
mod_stats_exporter_v0_7_1.zip
version 0.7.1 pf the widget
(14.37 KiB) Downloaded 40 times
0 x

Post Reply

Return to “Lua Scripts”

cron