OpenXcom Forum

Modding => Tools => Topic started by: Falko on June 05, 2014, 06:35:16 pm

Title: modtester
Post by: Falko on June 05, 2014, 06:35:16 pm
update for the modtester https://falkooxc.pythonanywhere.com/

put your mod in a zip file and try it :)

since you can now see the list of possible errors some explanations would be useful:

i downloaded >70 mods to get most of the errors "in the wild"

since we have now >50 errors i explain the more frequent/seriuos ones here
'rulfile is likely not UTF-8','some error during rulfile import','rulfile not in Ruleset Folder','the mod .rul is not a map/dict'
here i catch problems reading a mod - i see the rul file as the center of the mod if no rulfile or it is "wrong" yaml format it throws an error
'image/sound file should be in Resources/modname/... ' an information that you should put your files into a subfolder to avoid conflicts with other mods

'palette not correct' here we have an error in the image mostly the palette is slightly wrong see: https://imgur.com/kPn3C3W  but sometimes completely
'palette could use more colours' the image of this entry is not shown in the ufopedia and can therefore use the last 16 colors
'a sprite sheet is bigger than needed','references spritesheet does misses images' handobs,armors,tanks where the number of sprites is not as it should be
'an image has the wrong mode' we found a image that is not using a palette that should be fixed

'no string translation' each new item/research/manufacture/ufopedia,... needs a entry in extraStrings
'a language/translation is missing' the interface allows to select some languages that have to be there .. if not you get an error
'a language is incomplete' one language has more strings than another

'file/dir not found' happens rarely that a file is wrongly referenced in extrasprites/sounds
'spec file not found' happens more often for maps and terrain - e.g. some mods use map as directory it is MAPS!
'the case sensitive test of dir/file path failed' very often the path of the file extraSound/sprite entry differs from the (case sensitive) real path that leads to problems with using the mod in unix systems
'case sensitive path error for a file' see above but in regard to maps/terrains
'extrasprite/sound is not ruleset-referenced' there are extrasprite entries but no item that uses these entries
'not referenced file found' here are files that were in the mod directory but were not referenced somewhere in the rulset .. bestcase: there is a "Readme.txt" "error"
'no connected file entry found for ruleset-referenced' here an item refers to some file entry but it does not exists happens mostly if someone got confused with the sprite ids

'a property doubled in map/dict' happens if you have an object and add the same property twice the devs called that "unsafe and unsane"
Code: [Select]
extraSprites:
  - type: FLOOROB.PCK
    files:
      83: Resources/Piratez/FLOOROB/FloorBarrel.gif
      83: Resources/Piratez/FLOOROB/FloorDynamite.gif
'an item occurs multiple time' here we have declared the same item more than once in a list
Code: [Select]
extraStrings:
  - type: en-US
    strings:
      STR_HEAVY_LASER_CLIP: Heavy Laser clip
  - type: fr
    strings:
      STR_HEAVY_LASER_CLIP: Chargeur de laser lourd
  - type: en-US
    strings:
      STR_LASER_RIFLE_CLIP: Laser Rifle clip
  - type: fr
    strings:
      STR_LASER_RIFLE_CLIP: Chargeur de fusil laser
  - type: en-US
    strings:
      STR_LASER_PISTOL_CLIP: Laser Pistol clip
  - type: fr
    strings:
      STR_LASER_PISTOL_CLIP: Chargeur de pistolet laser
    better would be
Code: [Select]
extraStrings:
  - type: en-US
    strings:
      STR_HEAVY_LASER_CLIP: Heavy Laser clip
      STR_LASER_RIFLE_CLIP: Laser Rifle clip
      STR_LASER_PISTOL_CLIP: Laser Pistol clip
  - type: fr
    strings:
      STR_HEAVY_LASER_CLIP: Chargeur de laser lourd
      STR_LASER_RIFLE_CLIP: Chargeur de fusil laser
      STR_LASER_PISTOL_CLIP: Chargeur de pistolet laser


'keeps original value' shows that you have an entry that is a exact copy of the original and it could be removed (or automatically fixed)
'missing research referenced' somewhere you reference a research (unlock,requires,getonefree,..) but the researchobject does not exists
'missing item referenced' somewhere you reference a item (required item, fuel, compatible ammo, ...) but the item object does not exists
'no listorder for new objects' Solarius Scorch wanted that and it was easy to make - errormessage should speak for itself

now you can make fixes for your mod
the tester takes the last rulfile in a mod and "repairs" it
you can
Change case sensitive filepath entries [that works only for extrafile/sound entries you cant fix a map reference to files named SoMeNeW.MaP+sOmEnEw.rMp with just fixing the ruleset]

Remove unchanged vanilla properties/entries [removes entries that are unchanged in regard to the original values - last update of vanilla=jun 28]

if string only in en-XX add it to en-YY [just mantain en-GB .. US is added automatically or vis versa - is es and es-419 also exchangable?]

Edit:
during the devopment of a more complex tool realized i could create a mod tester without much additional work on my site
here it is
https://falkooxc.pythonanywhere.com/
it needs a mod in a zip file with a rulfile in the ruleset Folder
at the moment it chacks for ~40 errors  i encountered  3/4 of these errors in real mods i found online
the "design" is not really good but it does its job
you can see the importance level, error description  and clues where to find the error in the line below the error message

i use a free account on pythonanywhere.com that gives a limited amount of CPU Power so should there be a run on this it could get a bit slow in theory
Title: Re: modtester
Post by: Solarius Scorch on June 11, 2014, 02:53:51 pm
I tested it briefly. Works like a charm, the only problem I encountered so far is that it raises an alarm regarding non-UTF-8 format when in fact it is UTF-8. Check my recent Firearms Compilation for an example of this.
To sum up, it's a goddamn monster in terms of usability. Great work, Falko!
Title: Re: modtester
Post by: Falko on June 11, 2014, 04:00:49 pm
there seems to be a problem with some of the es/ es-419 utf strings
i deleted the es* languages zipped it and uploaded it and now the rulfile could be checked
the game seems to be a bit more forgiving than the tool or yaml online parser

Edit:
currently some errors can be a bit missleading:
like:
Code: [Select]
file/dir not found
['warning:', 'a extrasprite/sound entry is wrong', 'extraSprites', 'FLOOROB.PCK', 'Resources/Firearms_Compilation/Submachinegun/floorob_clip.gif']
there is a file Resources/Firearms_Compilation/Submachinegun/floorob_Clip.gif (c!=C in unix where the test is running) i will fix that confusing error recognition some day
Title: Re: modtester
Post by: yrizoud on June 11, 2014, 04:28:22 pm
Getting a warning for this is quite important, because it works for some players and breaks for others, causing much confusion.
Title: Re: modtester
Post by: Falko on June 15, 2014, 11:28:01 pm
update for the tester - description see first post
Title: Re: modtester
Post by: Jo5hua on June 16, 2014, 02:12:02 pm
Nice. I have a question. What is this coded in? If we get to having an ingame mod downloader we could implement this into the modsite for testing all the mods that are uploaded to the site.
Title: Re: modtester
Post by: Falko on June 16, 2014, 02:50:21 pm
the url https://falkooxc.pythonanywhere.com/ gives a hint :)
its coded in python (works with 2.7 (web) and 3.x (local version))

the modsite was one of my main search grounds for testfiles for the tool
Title: Re: modtester
Post by: Jo5hua on June 17, 2014, 01:12:01 am
Ahh yes I saw that just after I posted it :) Even looked a bit into python... Neat though!
Title: Re: modtester
Post by: Solarius Scorch on June 17, 2014, 11:04:36 pm
Hey Falko, I'm trying to test this mod (see attachment), but I'm getting internal server error on it. Other mods work just fine.

Help please?
Title: Re: modtester
Post by: Falko on June 17, 2014, 11:16:22 pm
short help
ru language screws with the "double item"-test
the tool compares
Code: [Select]
items:
  - type: STR_ALLOY_CANNON
    size: 1.5
    costSell: 45000
    transferTime: 48
    listOrder: 630
with
Code: [Select]
68007683798485791001items:
  - 66749472307414965242type: STR_ALLOY_CANNON
    65274331231985014017size: 1.5
    83813619105999693028costSell: 45000
    85164732974404812969transferTime: 48
    59065739506796236675listOrder: 630
to check if you have some property twice
but in the [added randomnumber]-file all non ascii chars are deleted and then
it looks like that
Code: [Select]
  - 36311567784243541252type: ru
    83283974477833520692strings:
      59311439341153775329STR_MINIGUN:
      13233305588859474049STR_MINIGUN_CLIP:   
      38655119999810609854STR_MINIGUN_UFOPEDIA:                 .      ,       .
      22889816533367289416STR_LIGHT_MINIGUN: 
and that can not be read by a yaml parser

Edit:
problem is fixed now
Title: [WIP] check compatibility bethween rulesets
Post by: davide on June 18, 2014, 10:34:02 am
next step it is the merge :P
Title: Re: [WIP] check compatibility bethween rulesets
Post by: Falko on June 18, 2014, 11:18:48 am
next step it is the merge :P
yes but i am not sure that a webinterface is the right gui-choice for that
Title: Re: modtester
Post by: yrizoud on June 18, 2014, 05:56:01 pm
Thanks Falko for precious tool!

One remark : Got the warning :
Quote
[u'info:', u'new object should get a listOrder property to place them within their lists correctly', 'ufopaedia', 'STR_MACHINE_PISTOL_CLIP', u'Ruleset/MachinePistol.rul']
You may want to suppress it for ufopedia entries which have "section: STR_NOT_AVAILABLE"
Title: Re: modtester
Post by: Falko on June 18, 2014, 06:26:03 pm
i fixed that
missing-listorder-error is now shown for research with cost<=0, items you cant recover from battle and now ufopedia entries with section: STR_NOT_AVAILABLE

question: i find ufopedia entries without section entry in some mods .. is that an error/whats the default?
Title: Re: modtester
Post by: Falko on June 28, 2014, 05:22:58 pm
switched to a newer software version
now you can make fixes for your mod
the tester takes the last rulfile in a mod and "repairs" it
you can
Change case sensitive filepath entries [that works only for extrafile/sound entries you cant fix a map reference to files named SoMeNeW.MaP+sOmEnEw.rMp with just fixing the ruleset]

Remove unchanged vanilla properties/entries [removes entries that are unchanged in regard to the original values - last update of vanilla=jun 28]

if string only in en-XX add it to en-YY [just mantain en-GB .. US is added automatically or vis versa - is es and es-419 also exchangable?]
Title: Re: modtester
Post by: Falko on July 05, 2014, 12:20:27 am
update has some more logic tests(e.g. can i get an alien recovered)
one can now de/activate whole blocks of error messages
the output is "somewhat" sorted
Title: Re: modtester
Post by: Aldorn on July 21, 2014, 01:14:29 pm
"Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."

I will retry later
Title: Re: modtester
Post by: Falko on July 21, 2014, 01:32:57 pm
if the error is in your file trying later will not help
but if you attach the zip you want to test i can see whats the source of the error
Title: Re: modtester
Post by: Aldorn on July 21, 2014, 07:00:37 pm
As you confirm it works, I will deal with it  ;)
Title: Re: modtester
Post by: niculinux on July 27, 2014, 09:52:00 pm
This thread definitely needs to go sticky on this forum section  :-*
Title: Re: modtester
Post by: Solarius Scorch on August 02, 2014, 02:46:08 am
At some point the Final Mod Pack became untestable, always returning an Internal Server Error. (The mod appears to be working smoothly, though of course it's not a final guarantee.)

Is the mod wrong, or just somehow too big for the modtester?
Title: Re: modtester
Post by: Falko on August 02, 2014, 02:58:40 am
no i did not get to it to add the tftd armors numbers and other stuff got distracted by mapeditor and 3doxc
Title: Re: modtester
Post by: ivandogovich on August 02, 2014, 05:23:32 am
At some point the Final Mod Pack became untestable, always returning an Internal Server Error. (The mod appears to be working smoothly, though of course it's not a final guarantee.)

I was getting a similar response to that, when I copied and pasted "fixed text" from the mod tester, back into my ruleset and saved it out.  I'm guessing the copied text maybe comping accross as UTF-8 and I was not skilled enough to force it back.  When I manually made the same changes, and save them, it worked like a charm.

Thanks so much, Falko! This is an incredibly beneficial tool! :D

Cheers, Ivan :D