View unanswered posts | View active topics It is currently Mon Aug 19, 2019 2:03 pm



Reply to topic  [ 99 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next
RWDK: Reassembly Web Development Kit (Updated 2017/01/07) 
Author Message

Joined: Thu Jan 14, 2016 2:21 pm
Posts: 94
Reply with quote
I've been making a few mods lately, and decided that messing around with the text files for blocks was more annoyance than it was worth, particularly in remember which fields are relevant to what feature, exactly what some of the features do, how certain shapes act or which are available, and directly relating hex values to colours among other things.

So I made a tool to do it for me. It can be found here.

The Reassembly Web Development Kit (RWDK) currently allows creating and editing blocks, factions and regions, as well as visualising ship designs and helping to preserve them through ID changes (this process is WIP and not all ships currently load.) Almost everything has mouse-over text explaining usage.

Image

A preview of the block is displayed at the top with icons for quick reference of features and can be reordered at will.

Fields which are ticked will be written to the file, fields left unticked are ignored. Editing a field will automatically tick it. Fields are only displayed if they are relevant to the feature set of the block. Several fields show their in-game related values, such as mass and health being calculated from density/durability and their shape area.

Image

Shapes are displayed with their hardpoints highlighted, and scale with the block's scale field. The grid in the background shows how they measure up to 1x1 blocks.

Image

The ids of all blocks can be reordered in one easy click, working from an offset in case you have several local mods which aren't relocated. The numbers avoid reserved ranges and automatically update sub-blocks like drones and missiles if they have an ID, or if they refer to a block id instead of defining the block directly (as per seed launchers).


The resulting files are clean and human readable. I've made two whole faction mods since making the tool (one released, the other not, due to current game limitations which I hope to be fixed sometime), and both were made in less time than my others, even when added together. It really helps when you don't have to keep looking stuff up over and over.

I hope you find this as useful as I have :)

Steam Community discussion thread

Changelog:

2019/04/12:
  • Moved hosting over to Github pages.

2017/01/07 Beta:
  • Partial shape support - shapes files can be loaded for use, but there's no facility to edit them yet. Creating a new shape in the UI is pretty pointless right now since it'd have no vertices.
  • Added MUTATE AI flag and armor block field. I still don't like armour, and don't think it should be used, but it's there for the sake of completeness.
  • Upped max block scale to 20. Vanilla shapes still only go to 10 though. This number is largely arbitrary.
  • Added P estimation by implementing the formula detailed here. It's not 100% accurate (size 2 sentinel armour, I'm looking at you!) but it's almost right in almost every situation.
  • Fixed flag display on blocks and factions so the icons disappear if the features field is unticked, previously the icons would remain incorrectly.
  • Changed some shapes to make them a more accurate representation of in-game versions. I should really just embed the vanilla shapes file sometime now that it's available, but that's a big job. This in turn leads to more accurate health/mass/p cost estimates.

2016/03/13:
  • Fixed region saving so that single region saves don't destroy the map.
  • Fixed ISOTRI_6 to be the correct angle.
  • Fixed the GEM and SEED shapes to have the corret number of hardpoints.
  • Added ATTACK AI tag.
  • Added WIP ship tab. Can be used to visualise ship designs and keep designs up to date with ID reordering. Any loaded ships will rearrange their block ids when the reorder tool is used and can be then re-saved to finalise the changes. Ships which need saving will have an icon on their preview.
  • Added indicator for whether a block is used in loaded ship designs. When at least one ship is loaded, if a block is not used anywhere in any of the designs, an icon will appear on the block preview.
  • Allowed factions to have zero primary colours, should you desire... (but why?)
  • Added a link to the official modding documentation on the top bar in each tab. Use it, people!
  • Fixed a few instances where the editor would crash.

Also, in accordance with upcoming changes in the Reassembly beta branch:
  • Added linearForce and immobilizeForce to the laser block.
  • Added COMMAND_MISSILE shape, used by the faction 12 (Bee) Anchor drones.
  • Added alternate graphics for healing lasers (defined by damage being negative).
  • Added side mounting ports to the MISSILE_SHORT shape.

Force beam graphics are not in yet, nor are the current launcher changes because I'm not sure how final they would be and they'd be a lot of work to add for now. If they are included in the main branch release I'll add them in.
________

2016/02/08:
  • Added the factions and regions tabs, which contain tools for editing factions and regions, including a starchart visualisation for regions.
  • Fixed dropdown enum field bug where they didn't tell the field to change value when they were selected, rendering them useless.
  • Added bindingId field to blocks. Appears when CANNON, LASER or LAUNCHER features are enabled.
  • Several other small tweaks and fixes.

_________________
My mods
Starring:
  • The Triumvirate - Triangles with shotguns and ablative armour
  • InfraSpatia - Disjointed aliens with spinal guns
  • Systems Coalition Remnant - Turbo-rectangles with stacking guns
  • Roiders - Cities and drills
Make your own with the Reassembly Web Development Kit!


Last edited by TTFTCUTS on Fri Apr 12, 2019 8:57 am, edited 13 times in total.



Thu Jan 14, 2016 2:43 pm
Profile
User avatar

Joined: Fri Jan 24, 2014 10:11 pm
Posts: 1295
Location: Ames, IA
Reply with quote
...I don't have permission to sticky this, so i'm just going to put the link in my sig.

_________________
The game where I originated as a member of this community. . VISUAL BASED MOD KIT!!
Shellcore command EP2


Thu Jan 14, 2016 6:48 pm
Profile
Online
User avatar

Joined: Thu Feb 05, 2015 6:07 am
Posts: 365
Reply with quote
Camo5 wrote:
...I don't have permission to sticky this, so i'm just going to put the link in my sig.

I'm not a mod, so... yeah. Cheers brah! :mrgreen:

_________________
Reassembly Web Dev Kit, by TTFTCUTS!

Muzzle Brake. Because not everyone is a fan of Noisy Crickets!

Empire of the Red Sun


Thu Jan 14, 2016 8:41 pm
Profile

Joined: Thu Jan 14, 2016 2:21 pm
Posts: 94
Reply with quote
I added a link to this thread in the kit itself, and cross-linked the Steam Community thread with this one. This has been a while in the making - and it's already been used to make 3 mods: the Systems Coalition Remnant, the Roiders - a faction which I haven't released because spawned blocks don't seem to understand how to use factories, and the Coral mod by Arheo.

_________________
My mods
Starring:
  • The Triumvirate - Triangles with shotguns and ablative armour
  • InfraSpatia - Disjointed aliens with spinal guns
  • Systems Coalition Remnant - Turbo-rectangles with stacking guns
  • Roiders - Cities and drills
Make your own with the Reassembly Web Development Kit!


Thu Jan 14, 2016 8:54 pm
Profile
User avatar

Joined: Sun Apr 12, 2015 3:13 am
Posts: 283
Reply with quote
Aller Louia!
(That joke is not translatable in English, let's just say that's a bad French pun about "Hallelujah")


...

Edit:
Just tested it => error on load XD
It say that:

File Parsing Failed:
FormatException: SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line 5 column 264 of the JSON data

The game don't have problem!
The line 1 to 8 of my blocks.lua


1)-- autogenerated from game/TheBlocks.h
2){
3) {963251401, command={faction=221}, name="Command", features=COMMAND|GENERATOR|ASSEMBLER|TRACTOR,
4) group=221, shape=COMMAND, points=10, durability=4.000, density=0.100, fillColor=0x404040,
5) fillColor1=0x606060, powerCapacity=12000.000, capacity=100.000, generatorCapacityPerSec=4000.000, tractorRange=600.000},
6) {963251402, command={faction=221}, name="Station Command", features=COMMAND|GENERATOR|ASSEMBLER|TRACTOR,
7) group=221, shape=OCTAGON, points=10, durability=4.000, density=1500, fillColor=0x404040,
8) fillColor1=0x606060, powerCapacity=12000.000, capacity=1000.000, generatorCapacityPerSec=4000.000, tractorRange=1000.000},



I have no idea where the column 264 is, the line is 165 character long! ^^'

_________________
Using Beta, always! (Well, for Reassembly)
(Also known as GATC on Steam)


Last edited by Cornebre on Fri Jan 15, 2016 1:25 am, edited 1 time in total.



Fri Jan 15, 2016 1:18 am
Profile
User avatar

Joined: Wed Dec 09, 2015 10:19 pm
Posts: 406
Location: Earth
Reply with quote
Eh, code is easier and less time consuming

_________________
"If the ai can do it player fights would be ruined.
If the player can do it the experience would not be the same.
Just leave the lone developer to his job and everything will turn out okay."


Image

Reassembly x10


Fri Jan 15, 2016 1:25 am
Profile

Joined: Thu Jan 14, 2016 2:21 pm
Posts: 94
Reply with quote
Dangit GATC, I already had to add a load of parsing stuff because of nonstandard things you did like hex block IDs and non-hex colours! Which mod is that? Can I get a look at the full file please?

Turns out the game is actually REALLY forgiving of mistakes, and a load of things which break this parser make it into the game just fine. It's probably something I do to fix those problems which makes that one break.

Also the line numbers in the original file don't line up with the actual line numbers, since a lot of stuff has to change to turn pseudo-lua into parseable JSON :P

_________________
My mods
Starring:
  • The Triumvirate - Triangles with shotguns and ablative armour
  • InfraSpatia - Disjointed aliens with spinal guns
  • Systems Coalition Remnant - Turbo-rectangles with stacking guns
  • Roiders - Cities and drills
Make your own with the Reassembly Web Development Kit!


Fri Jan 15, 2016 7:49 am
Profile
User avatar

Joined: Sun Apr 12, 2015 3:13 am
Posts: 283
Reply with quote
The file is not "normally" available (mod not fully finished (it's the Ethereal)).
But here it is anyway ;p


http://www.mediafire.com/download/hhf5g ... blocks.lua

BTW, is there a quick way to clear the block list? (except hitting F5?)



Edit: Could it be the lack of "lineColor="?

_________________
Using Beta, always! (Well, for Reassembly)
(Also known as GATC on Steam)


Fri Jan 15, 2016 8:38 am
Profile

Joined: Thu Jan 14, 2016 2:21 pm
Posts: 94
Reply with quote
{963251405, group=221, fillColor=0x404040, fillColor1=0x606060, name="Main Frame" growRate=6.6667, durability=9.000, density=0.200, points=1},

^ no comma after the name. This is what I mean about the game being forgiving. That's broken syntax!

Whichever browser you're using doesn't seem to have very helpful error messages returned by its parser either :P

Image

I'll see what I can do about getting it to be fixed automatically, like the other ones. Strings are a special case, so my pattern for missing commas didn't catch missing commas after them. *adds a tenth regex pattern to the parser*

Also no, there's no way to clear it *yet*, since refresh already does that, but I might still add one.

Edit: Fixed. It should now parse those strings, even if they're missing a comma (which they really shouldn't be!)

This is what all the regex looks like, btw:
Code:
   static RegExp JSONify1 = new RegExp(r'\b([\w|\.]+)\b[\s\n\r]*=[\s\n\r]*([^",;{}\n\r]+),*'); // handle normal entries
   static RegExp JSONify2 = new RegExp(r'\b([\w|\.]+)\b[\s\n\r]*=[\s\n\r]*([{"])'); // handle block and string entries
   static RegExp JSONify3 = new RegExp(r'(.)[\s\n\r]*{[\s\n\r]*([\d]+|0[xX][0-9a-fA-F]+)[\s\n\r]*,'); // handle block starts and idents
   static RegExp JSONify4 = new RegExp(r'--.*[\n\r]'); // strip comments
   static RegExp JSONify5 = new RegExp(r',[\s\n\r]*}'); // remove extra commas
   static RegExp JSONify6 = new RegExp(r'(["}])\s*[\n\r]'); // add missing commas for brackets
   static RegExp JSONify7 = new RegExp(r'{[\s\n\r]*([-\d\.]+)[\s\n\r]*,[\s\n\r]*([-\d\.]+)[\s\n\r]*}'); // number pairs
   static RegExp JSONify8 = new RegExp(r'(})[\s\n\r]*([^,}])'); // add commas between blocks
   static RegExp JSONify9 = new RegExp(r'(\\)'); // escape stuff
   static RegExp JSONify10 = new RegExp(r'(=[\s\n\r]*"[^"]*")([\s\n\r]*[^,])'); // add missing commas after strings

_________________
My mods
Starring:
  • The Triumvirate - Triangles with shotguns and ablative armour
  • InfraSpatia - Disjointed aliens with spinal guns
  • Systems Coalition Remnant - Turbo-rectangles with stacking guns
  • Roiders - Cities and drills
Make your own with the Reassembly Web Development Kit!


Fri Jan 15, 2016 8:58 am
Profile
User avatar

Joined: Thu Mar 27, 2014 2:30 pm
Posts: 151
Location: The Core!
Reply with quote
Your Development Kit doesn't know how to handle comment tags.
Quote:
File Parsing Failed:
FormatException: SyntaxError: Unexpected token #

_________________
The New Terran Republic [http://steamcommunity.com/sharedfiles/filedetails/?id=492719578]
The New Terran Republic V2.0 [http://steamcommunity.com/sharedfiles/filedetails/?id=659890051]


Sat Jan 16, 2016 11:29 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 99 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next

Who is online

Users browsing this forum: No registered users and 1 guest


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:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software