forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Thu Nov 23, 2017 9:13 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun Oct 11, 2009 11:10 pm 
Offline

Joined: Wed Sep 09, 2009 2:37 pm
Posts: 156
UPDATE: These tools are outdated as of version 0.97

I've decided to just put all my tools on one page for easy reference instead of separate threads for each. Here are all the tools I created to assist myself in variant creation, that I'm sure others will want to use as well.

Convert judge files to webDiplomacy SQL Database (Updated Oct 30, 2009)
Website: http://careyj.com/dippatches/judge2wd.php
Used For: Converting the ascii-based judge variant files used in the old-style diplomacy judges (like dpjudge and realpolitik) to a mysql database for use in webDiplomacy.
Instructions: Fill out the fields on the form, including the list of codes/countries, your table prefix, the seed.* judge file for the variant, and the map.* judge file for the variant. (You can get these files from most diplomacy judges by sending an email to the judge and putting in the body, for example, "get map.empire" or "get seed.empire"). The script will then return an SQL data file. Save it as something.sql (using a "text" file type) or copy/paste into a new file. Import the SQL file to your test installation, and all you have to do database-wise is input the x and y coordinates on your maps for the territories.
Notes: This has been tested with North American Empire (seed.empire and map.empire), Ancient Mediterranean (seed.ancient_med and map.ancient_med), as well as Imperium (map.imperium and seed.999). Please let me know if there are any curveballs for other maps you try.
License Notes: Since this is a standalone application and does not require any additions to or interactions with webDiplomacy to run, I'm not releasing it under the AGPL license, so you must use my server to convert it. However, all output the script produces (based on your input) is released to the public domain. This is mostly because I'm embarrassed by the quality of the source code and I don't want anyone to see it :lol:

Create CSS values based on config.php (Added Dec 1, 2009)
Website: http://careyj.com/dippatches/createCSS.tgz
Used For: Creating the .countryName and .occupationBarCountryname CSS values based on the rgb values you used in your map config in config.php
Instructions: Put in your home directory, change the $map and $customColors values at the top to suit your needs. $customColors is if you are using goonDiplomacy's 'customColors' map config value. Open the page in a web browser and copy and paste to your global.css and gamepanel.css files.

Database Border Maker
Download: http://careyj.com/dippatches/borders.tgz
Used for: Outputs an entire _Borders and _CoastalBorders mysql query, based on x,y distance between two country points.
Instructions: Use after you've completed filling in your Territories table, with x and y values. At the top of the file, fill in your database information and table prefix. The script will output an entire mysql file for _Borders and _CoastalBorders connecting each territory to its "$max_borders" closest available regions. All you have to do is go through it and delete the extras.
The script keeps a memory of all the borders it's outputted, so there will be very few lines outputted when it gets to the final countries. It also means you don't have to delete multiple instances of bad links. I found this script to be an incredibly fast way to get your borders sql file made.

UnitDestroyIndex (Updated Dec. 29, 2009)
Download: http://careyj.com/dippatches/unitdestroyindex.tgz
Used for: Outputting the entire UnitDestroyedIndex table
Instructions: Use after you've completed filling in your Territories table. At the top of the file, fill in your database information, table prefix, and list of countries, then just view it from your web browser. It should spit out the mysql instructions to create the entire table. UPDATE: This now puts the territories in orders like it is supposed to (with the furthest territory away from home supply centers being numbered 1, and home supply centers having the highest number). If you have a map that starts on winter builds, remove "and supply='Yes'" from the initial mysql query.

Update Enum (Updated Nov. 4, 2009)
Download: http://careyj.com/dippatches/update_enums.sql
Used for: Updating the enumerated types in the webDiplomacy database with your variant's countries and territories
Instructions: Change @countries, @terr, and @terrcoast to your own list of countries and territories, and then add to the beginning of your sql update file for your variant.

Initial Map Output and Unit Placement Checker
Download: http://careyj.com/dippatches/initialMap.txt
Used for: 1) Creating the initialMap*.png file required by webDiplomacy for your variant, 2) Viewing a map with a unit on every territory, to check your X/Y coordinates
Instructions: Use after creating your Territories table. Apply the patch to map.php (either by using 'patch' or by hand; it's not that big). Then open map.php?gameID=yourTestGameID&turn=-1. Alternately add &largemap=1 for a largemap. This will view a blank map with all countries filled with neutral colors. Add &units=1 to see a unit on every territory. Also add &flags=1 in conjunction with 'units' to see a flag on every unit that is placed on the map (so you can see if a unit will be on top of your country labels.
Known Issue: You have to change 'Austria' in the patched code to a country in your variant, or else the flags won't work.


Last edited by gilgatex on Wed Jan 13, 2010 3:36 pm, edited 15 times in total.

Top
 Profile  
 
PostPosted: Tue Oct 20, 2009 12:10 am 
Offline

Joined: Wed Sep 09, 2009 2:37 pm
Posts: 156
Oct. 19, 2009: Added a judge to mysql converter.


Top
 Profile  
 
PostPosted: Wed Nov 04, 2009 7:08 pm 
Offline

Joined: Wed Sep 09, 2009 2:37 pm
Posts: 156
Oct. 30, 2009: The judgefile script generator now works with realpolitik map files (just omit the seed file)
Nov. 4, 2009: Bugfix on update_enums.sql as well as it now updates wD_Games with the game abbreviation.


Top
 Profile  
 
PostPosted: Tue Dec 01, 2009 4:25 pm 
Offline

Joined: Wed Sep 09, 2009 2:37 pm
Posts: 156
Dec 1, 2009: Added a script to create the html CSS values based on colors in your map config.


Top
 Profile  
 
PostPosted: Tue Dec 29, 2009 7:23 pm 
Offline

Joined: Wed Sep 09, 2009 2:37 pm
Posts: 156
Dec 29, 2009: Updated unitdestroyindex.php to now actually go through and find the distances from the home centers rather than assign them random sequential numbers.


Top
 Profile  
 
PostPosted: Tue Dec 29, 2009 9:23 pm 
Offline

Joined: Wed Jul 29, 2009 10:22 am
Posts: 841
gilgatex wrote:
Dec 29, 2009: Updated unitdestroyindex.php to now actually go through and find the distances from the home centers rather than assign them random sequential numbers.
Cool. Didn't know the numbers had a deeper meaning...
I'll change my variants once the official support is done.

Oliver


Top
 Profile  
 
PostPosted: Tue Dec 29, 2009 9:47 pm 
Offline

Joined: Wed Sep 09, 2009 2:37 pm
Posts: 156
Sleepcap wrote:
gilgatex wrote:
Dec 29, 2009: Updated unitdestroyindex.php to now actually go through and find the distances from the home centers rather than assign them random sequential numbers.
Cool. Didn't know the numbers had a deeper meaning...
I'll change my variants once the official support is done.

Oliver


Yeah, I actually had to flat out ask Kestas what the table was actually for. Apparently the number is the order that you're supposed to destroy a unit if a member NMRs, so #1 should be the furthest territory from your home territories, while the highest numbers should actually be your home territories.


Top
 Profile  
 
PostPosted: Wed Dec 30, 2009 5:20 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
The new variant code automatically loads up the unitdestroyindex numbers, so you dont have to worry about those now :)


Top
 Profile  
 
PostPosted: Wed Jan 13, 2010 3:36 pm 
Offline

Joined: Wed Sep 09, 2009 2:37 pm
Posts: 156
You can probably unsticky this now that the tools are outdated


Top
 Profile  
 
PostPosted: Thu Nov 29, 2012 2:23 pm 
Offline

Joined: Tue Nov 27, 2012 2:53 am
Posts: 5
so is there updated tools? or any tools to use


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group