Page 2 of 3

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sat Jan 26, 2013 4:12 pm
by Diziet Sma
Thank you muchly.. 8)

(you also mentioned something about custom syntax highlighting? :wink: )

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sat Jan 26, 2013 6:37 pm
by Svengali
Diziet Sma wrote:
(you also mentioned something about custom syntax highlighting? :wink: )
This is is color schema I'm using for shipdata.plists. But I'm only using it in a few cases (after converting XML plists, when working on older shipdata.plists and before releasing a new version). The exported shipdata schemata is done in NPP 6.2.3.

Code: Select all

<NotepadPlus>
    <UserLang name="shipdata" ext="" udlVersion="2.0">
        <Settings>
            <Global caseIgnored="no" allowFoldOfComments="yes" forceLineCommentsAtBOL="no" foldCompact="yes" />
            <Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
        </Settings>
        <KeywordLists>
            <Keywords name="Comments" id="0">00// 01 02 03/* 04*/</Keywords>
            <Keywords name="Numbers, additional" id="1">. ,</Keywords>
            <Keywords name="Numbers, prefixes" id="2">, - .</Keywords>
            <Keywords name="Numbers, extras with prefixes" id="3"></Keywords>
            <Keywords name="Numbers, suffixes" id="4"></Keywords>
            <Keywords name="Operators1" id="5">{ } ( )</Keywords>
            <Keywords name="Operators2" id="6">= , ;</Keywords>
            <Keywords name="Folders in code1, open" id="7"></Keywords>
            <Keywords name="Folders in code1, middle" id="8"></Keywords>
            <Keywords name="Folders in code1, close" id="9"></Keywords>
            <Keywords name="Folders in code2, open" id="10"></Keywords>
            <Keywords name="Folders in code2, middle" id="11"></Keywords>
            <Keywords name="Folders in code2, close" id="12"></Keywords>
            <Keywords name="Folders in comment, open" id="13"></Keywords>
            <Keywords name="Folders in comment, middle" id="14"></Keywords>
            <Keywords name="Folders in comment, close" id="15"></Keywords>
            <Keywords name="Keywords1" id="16">accuracy aft_eject_position aft_weapon_type ai_type auto_ai beacon bounty cargo_carried cargo_type cloak_automatic cloak_passive condition_script counts_as_kil debris_role density display_name energy_recharge_rate escape_pod_model escorts escort_role escort_ship exhaust extra_cargo forward_weapon_type frangible fragment_chance fuel has_cloaking_device has_ecm has_energy_bomb has_escape_pod has_fuel_injection has_military_jammer has_military_scanner_filter has_scoop has_scoop_message has_shield_booster has_shield_enhancer heat_insulation hud hyperspace_motor hyperspace_motor_spin_time is_external_dependency is_submunition is_template laser_color like_ship likely_cargo materials max_cargo max_energy max_flight_pitch max_flight_roll max_flight_speed max_flight_yaw max_missiles missile_launch_position missile_load_time missiles missile_role model name no_boulders pilot port_weapon_type roles rotational_velocity scan_class scanner_display_color1 scanner_display_color2 scanner_range scoop_position script script_info shaders smooth starboard_weapon_type subentities track_contacts throw_sparks thrust unpiloted weapon_energy weapon_facings weapon_position_aft weapon_position_forward weapon_position_port weapon_position_starboard</Keywords>
            <Keywords name="Keywords2" id="17">conditions death_actions launch_actions script_actions setup_actions spawn escort-ship escort-role hasShipyard scanClass specular ambient weapon_offset weapon_offset_x isCarrier has_energy_unit</Keywords>
            <Keywords name="Keywords3" id="18">allows_auto_docking allows_fast_docking defense_ship defense_ship_role equipment_price_factor equivalent_tech_level has_npc_traffic has_patrol_ships has_shipyard interstellar_undocking is_carrier market max_defense_ships max_police max_scavengers port_dimensions port_radius requires_docking_clearance rotating station_roll tunnel_corners tunnel_start_angle tunnel_aspect_ratio view_position_aft view_position_forward view_position_port view_position_starboard custom_views</Keywords>
            <Keywords name="Keywords4" id="19">EQ_WEAPON</Keywords>
            <Keywords name="Keywords5" id="20">type value binding name bindToSubentity vertex_shader fragment_shader textures uniforms clamped normalized asMatrix</Keywords>
            <Keywords name="Keywords6" id="21">true false yes no FORWARD texture float vector int quaternion</Keywords>
            <Keywords name="Keywords7" id="22">type subentity_key position orientation is_dock allow_docking allow_launching disallowed_docking_collides dock_label fire_rate weapon_range weapon_energy color colors frequency initially_on phase size bright_fraction hue</Keywords>
            <Keywords name="Keywords8" id="23">standard ball_turret flasher ambient_color anisotropy cube_map diffuse_color diffuse_map emission_and_illumination_map emission_color emission_map emission_modulate_color extract_channel illumination_map illumination_modulate_color mag_filter min_filter name normal_and_parallax_map normal_map no_shrink parallax_bias parallax_scale repeat_s repeat_t shininess specular_color specular_map specular_modulate_color texture_LOD_bias view_description view_orientation view_position weapon_facing</Keywords>
            <Keywords name="Delimiters" id="24">00= 01 02; 03" 04 05" 06( 07 08) 09{ 10 11} 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" styleID="0" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="COMMENTS" styleID="1" fgColor="008000" bgColor="FFF2F2" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="LINE COMMENTS" styleID="2" fgColor="008000" bgColor="FFF2F2" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="NUMBERS" styleID="3" fgColor="FF8080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS1" styleID="4" fgColor="000040" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS2" styleID="5" fgColor="804040" bgColor="FFDDEE" fontName="" fontStyle="5" nesting="0" />
            <WordsStyle name="KEYWORDS3" styleID="6" fgColor="000000" bgColor="DDFFDD" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS4" styleID="7" fgColor="800080" bgColor="FFEAFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS5" styleID="8" fgColor="004000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS6" styleID="9" fgColor="0080FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS7" styleID="10" fgColor="1E003C" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS8" styleID="11" fgColor="400080" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="OPERATORS" styleID="12" fgColor="0080FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="FOLDER IN CODE1" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE2" styleID="14" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN COMMENT" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS1" styleID="16" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="117702414" />
            <WordsStyle name="DELIMITERS2" styleID="17" fgColor="5555FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="117702400" />
            <WordsStyle name="DELIMITERS3" styleID="18" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="117702403" />
            <WordsStyle name="DELIMITERS4" styleID="19" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="117702407" />
            <WordsStyle name="DELIMITERS5" styleID="20" fgColor="FF0000" bgColor="80FF80" fontName="" fontStyle="1" nesting="117702400" />
            <WordsStyle name="DELIMITERS6" styleID="21" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS7" styleID="22" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS8" styleID="23" fgColor="808040" bgColor="FF8040" fontName="" fontStyle="1" nesting="117702528" />
        </Styles>
    </UserLang>
</NotepadPlus>

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sat Jan 26, 2013 8:01 pm
by Diziet Sma
Sweet! Many thanks! 8)

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 11:57 am
by Diziet Sma
Svengali wrote:
Dropping a file works under Windows and places the new file in the same folder as the original one.
Damn I wish I could get Linux to do that.. :mrgreen:
Svengali wrote:
btw: I'm using a tweaked version which doesn't use quotes for the inner keys (except if a minus is used like in escort-ship).
Nice.. I like the difference.

The old xml2ns.py and Svengali's new xml2ns.py output side-by-side (Obj-C style highlighting):
ImageImage

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 12:22 pm
by GGShinobi
This is good, thanks! :mrgreen:

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 1:19 pm
by Diziet Sma
GGShinobi wrote:
This is good, thanks! :mrgreen:
Note that the fixed-for-Linux version you (well, I guessing it was you) just downloaded is the older, non-Svengali version of the script.

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 2:23 pm
by GGShinobi
Diziet Sma wrote:
GGShinobi wrote:
This is good, thanks! :mrgreen:
Note that the fixed-for-Linux version you (well, I guessing it was you) just downloaded is the older, non-Svengali version of the script.
Whoops, indeed. I guess that's what you get for rushing through the news instead of properly reading them :roll: Thanks!

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 2:37 pm
by Diziet Sma
No worries..

I'd like to formally nominate Svengali's version of the script for inclusion as the new official version. How say ye?

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 5:22 pm
by GGShinobi
Diziet Sma wrote:
No worries..

I'd like to formally nominate Svengali's version of the script for inclusion as the new official version. How say ye?
I had a little problem with Svengali's version:

Code: Select all

bash: ./xml2ns-svengali.py: /usr/bin/python^M: bad interpreter: No such file or directory
So I had to resolve it by running

Code: Select all

dos2unix xml2ns-svengali.py
Personally, I don't mind whether there are quotation marks around the names or not... But what I like is that Svengali uses spaces instead of tabs! :mrgreen: so I think I equally like both versions! :mrgreen:

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 5:26 pm
by JazHaz
What do I need to get one of these working on Windows? Python? No experience of running that. Is there a runtime version?

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 5:29 pm
by Diziet Sma
GGShinobi wrote:
I had a little problem with Svengali's version:

Code: Select all

bash: ./xml2ns-svengali.py: /usr/bin/python^M: bad interpreter: No such file or directory
So I had to resolve it by running

Code: Select all

dos2unix xml2ns-svengali.py
Weird.. how did you create your copy? I copy/pasted into Geany, saved it, and it ran fine.. (but now I think about it, I've set Geany to auto-strip CR characters from line endings.. :mrgreen:)

(For indenting code, gimme tabs over spaces any day.)

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 5:36 pm
by Diziet Sma
JazHaz wrote:
What do I need to get one of these working on Windows? Python? No experience of running that. Is there a runtime version?
Yes, there is a version for Windows. You want Python 2.7. NOT Python 3.3.

You can get it here:
http://www.python.org/getit/

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 6:25 pm
by JazHaz
Diziet Sma wrote:
JazHaz wrote:
What do I need to get one of these working on Windows? Python? No experience of running that. Is there a runtime version?
Yes, there is a version for Windows. You want Python 2.7. NOT Python 3.3.
Downloaded and installed Python v2.7.3.

When it runs I get a command line window, but I'm stumped how to load up the xml2ns.py script (downloaded from the wiki). I've copied the script and my shipdata.plist into the Python directory (C:\Python.27\).

Tried obvious things like run xml2ns.py or load xml2ns.py or just xml2ns.py but nothing seems to happen. It's been years since I last used MS-Dos, so maybe missing something else obvious?

EDIT: also tried dragging and dropping the .py file onto python.exe, tried executing the .py file too.

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 6:29 pm
by Zieman
Once you have Python installed, IIRC you just need to open the command prompt on Windows, navigate to the right folder and type

Code: Select all

xml2ns.py shipdata.plist
, if you want to convert a shipdata.plist that is.
Best bet is to have the .py & the .plist in same directory when doing this.

Re: Converting XML plists to the old NeXTSTEP (ASCII) format

Posted: Sun Jan 27, 2013 6:33 pm
by JazHaz
That worked, thanks! :)