I have a set of eclipse and ant based tools for modding with Sins that others may find useful when validating or building their projects.
Current Downloads (older downloads: Downloads)
FAQ
System Requirements
Syntax Wiki - A syntaxual representation of almost all of the Sins editable files.
How To's:How To Install EclipseHow To Setup Entity Validation Eclipse Plugin (Updated for new preference with v0.6)
Video: How to setup and configure the Soase Eclipse Plugin
References:
Mod Development with Eclipse (Forum link providing a general overview of Eclipse)
Eclipse download site (http://eclipse.org/downloads)
Tools Supported:
Entity Editor (Click me for cool stuff about visual Entity Validations)
Eclipse Editor builder/nature extension that provides visual feedback to the following validations.
Entity Definition View - Displays the syntax rules for the currently opened entity file.
Summary of validations currently supported: Boolean: Validates boolean entries contain TRUE or FALSE onlyBrush: Validates a referenced brush entry exists for the value enteredConditional Validation: Allows conditional structures to follow based on a field valueKey word: Validates all entity file key words are spelled correctlyQuotes: Validates any values requiring qoutes have beginning and ending quotation marksInteger: Validates integer entries contain digitsDecimal: Validates decimal entries contain ####.#####Entity References: Validates a referenced entity file exists for the value enteredString Reference: Validates a referenced String entry exists for the value enteredSound Reference: Validates a referenced Sound entry exists for the value enteredEnumeration Validation: Validates an entry confirms to an allowed set of values (i.e. buffInstantActionType)Iteration Validation: Validates repeating elements are correctStructure Validation: Validates entries appear in the correct order in the entity file (configurable to allow unordered structures)Explosion Validation: Validates a referenced explosion entry exists for the value enteredTexture Validation: Validates a referenced texture exists for the value enteredParticle Validation: Validates a referenced effect exists for the value enteredSounddata Validation: Validates sounddata files for correctness including referenced sound filesGalaxyScenarioDef Validation: Validates galaxyScenarioDef files for correctness with 2 pass validationsStringInfo Validation: Validates English.str for correctnessBrushes Validation: Validates brushes files for correctnessGameplay.constants: Validates the Gameplay.constant file for correctnessExplosiondata Validation: Validates sounddata files for correctness including referenced sound filesGalaxy Validation: Validates galaxy files for correctness and performs additional validations on referenced templates and design names.
Content Assistance: [ctrl]+[space bar] on keywords or constants and get suggested completionsSyntax Coloring: change syntax coloring of entity files to suit your preferences (defaults to all black currently)Hover Help: hover over a keyword and get additional details about the value or structureQuick link to wiki syntax
good ideas.
best of luck getting them to work the way you want them to.
harpo
I would be so happy if you can pull this off.
So I tried this against a different mod that had text files published and it worked quite well for the entity definitions I have built so far.
As you can see from the results below I don't have the spawn ships elements defined yet for Buff entities as that didn't exist in Sins proper.
Other things of note where I'm expecting a Integer it doesn't like Decimals and vice versa. Capitalization is enforced right now on effects and meshes which may or may not be required. I personally prefer capitalization to match.
edit - outdated now
Here's a taste of the structure defenitions:
<structure name="CapitalShip"> <field name="ability:0"/> <field name="ability:1"/> <field name="ability:2"/> <field name="ability:3"/> <field name="ability:4"/> <field name="defaultAutoAttackRange"/> <field name="defaultAutoAttackOn"/> <field name="prefersToFocusFire"/> <field name="usesFighterAttack"/> <field name="autoJoinFleetDefault"/> <field name="canBomb"/> <field name="hasBombingLevels"/> <field name="baseDamage"/> <field name="basePopulationKilled"/> <field name="bombingFreqTime"/> <field name="baseRange"/> <field name="bombTransitTime"/> <field name="bombEffectCount"/> <field name="bombEffectAngleVariance"/> <structure_reference name="bombEffectsDef" type="weaponEffectsDef"/> <field name="mainViewIcon"/> <structure_reference name="basePrice" type="Cost"/> <field name="slotCount"/> <field name="BuildTime"/> <structure_reference name="MaxHullPoints" type="LevelIncrease"/> <structure_reference name="MaxShieldPoints" type="LevelIncrease"/> <structure_reference name="HullPointRestoreRate" type="LevelIncrease"/> <structure_reference name="ShieldPointRestoreRate" type="LevelIncrease"/> <structure_reference name="ArmorPointsFromExperience" type="LevelIncrease"/> <structure_reference name="maxMitigation" type="LevelIncrease"/> <structure_reference name="MaxAntiMatter" type="LevelIncrease"/> <structure_reference name="AntiMatterRestoreRate" type="LevelIncrease"/> <structure_reference name="CultureProtectRate" type="LevelIncrease"/> <field name="NameStringID"/> <field name="DescriptionStringID"/> <field name="picture"/> <structure_reference name="Prerequisites" type="researchPrerequisites"/> <field name="roleType"/> <field name="statCountType"/> <field name="numRandomDebrisLarge"/> <field name="numRandomDebrisSmall"/> <iterative_field name="numSpecificDebris"> <field name="specificDebrisMeshName"/> </iterative_field> <field name="armorType"/> <field name="hudIcon"/> <field name="smallHudIcon"/> <field name="infoCardIcon"/> <field name="minZoomDistanceMult"/> <iterative_field name="NumWeapons"> <structure_reference name="Weapon"/> </iterative_field> <field name="m_weaponIndexForRange"/> <field name="firingAlignmentType"/> <field name="TargetCountPerBank:FRONT"/> <field name="TargetCountPerBank:BACK"/> <field name="TargetCountPerBank:LEFT"/> <field name="TargetCountPerBank:RIGHT"/> <field name="canOnlyTargetStructures"/> <field name="mass"/> <field name="ShieldMeshName"/> <field name="renderShield"/> <field name="maxAccelerationLinear"/> <field name="maxAccelerationStrafe"/> <field name="maxDecelerationLinear"/> <field name="maxAccelerationAngular"/> <field name="maxDecelerationAngular"/> <field name="maxSpeedLinear"/> <field name="maxRollRate"/> <field name="maxRollAngle"/> <field name="squadTypeEntityDef:0"/> <field name="squadAntiMatterCost:0"/> <field name="squadTypeEntityDef:1"/> <field name="squadAntiMatterCost:1"/> <field name="squadTypeEntityDef:2"/> <field name="squadAntiMatterCost:2"/> <field name="squadTypeEntityDef:3"/> <field name="squadAntiMatterCost:3"/> <iterative_field name="NumSoundsFor:ONATTACKORDERISSUED"> <field name="SoundID"/> </iterative_field> <iterative_field name="NumSoundsFor:ONCREATION"> <field name="SoundID"/> </iterative_field> <iterative_field name="NumSoundsFor:ONGENERALORDERISSUED"> <field name="SoundID"/> </iterative_field> <iterative_field name="NumSoundsFor:ONSELECTED"> <field name="SoundID"/> </iterative_field> <iterative_field name="NumSoundsFor:ONSTARTPHASEJUMP"> <field name="SoundID"/> </iterative_field> <iterative_field name="MeshNameInfoCount"> <structure name="MeshNameInfo"> <field name="meshName"/> <field name="criteriaType"/> </structure> </iterative_field> <field name="meshNameIncreasedEffectName"/> <field name="meshNameDecreasedEffectName"/> <field name="ExhaustParticleSystemName"/> <field name="ExplosionName"/> <structure_reference name="CommandPoints" type="LevelIncrease"/> <structure_reference name="weaponCooldownDecreasePerc" type="LevelIncrease"/> <structure_reference name="weaponDamageIncreasePerc" type="LevelIncrease"/> <field name="HyperspaceChargingSoundID"/> <field name="HyperspaceTravelSoundID"/> <field name="EngineSoundID"/> <field name="formationRank"/> <field name="minShadow"/> <field name="maxShadow"/> </structure>
And element validation rules
<element_rule name="isUltimateAbility" validation="Boolean"/> <element_rule name="maxNumLevels" validation="Integer"/> <element_rule name="levelSourceType" validation="Simple" values="Intrinsic,ResearchWithoutBase,FixedLevel0,ResearchWithBase,StarBaseUpgradeLevel"/> <element_rule name="sourcePropertyType" validation="Simple" values="AbilityALevel,AbilityBLevel,AbilityCLevel"/> <element_rule name="baseSourceResearchSubject" validation="Research"/>
Mod tools released!
After lots of caffiene I believe I have a stable version for this tool. I've tested the EntityValidator against Vanilla, Entrenchment, Diplomacy as well as some significant mods that have been released.
Some of the results may not be obvious due to the nature of parsing these files but generally if the tool fails to parse the files there may be an issue. It is possible to run the tool in debug to get more information on why the tool failed on the particular file.
One example this tool does not like is using tabs or multiple spaces between a keyWord and it's value. This would be reported as an error even though the file will run in Sins.
Running the tool with failOnError set to false is a nice way to see all of the missing or incorrectly spelled references to String, Brush, Textures, etc.
Player[Name].entity only validates correctly against entrenchment currently.
I'm reviewing how to support both.
Thanks.
Very nice, I hope to start testing it this weekend.
Thank you, I look forward to seeing what you think.
Also, I released a version 0.2 after running some more passes over diplomacy and a few other mods.
Cheers
Looks interesting, keep up the work!
Wow great work so far , tools like this one and harpos will make modding for the masses possible
Released version 0.3 which makes minor improvements to the error reporting capabiltiies. I'm also toying with integrating this with eclipse as a custom Builder/Nature. I'm pretty excited about the possibilities of getting that working.
Here is a screenshot of my prototype Entity Builder/Nature plugin in eclipse. So far so good!
I realize this is not for the faint of heart, but I have a alpha version of the Eclipse editor tool available. It supports basic entity level validation support by the Ant build tools. I will be updating the ant build tools to reflect the current changes to the Entity validation process incorporated into the Eclipse Plugin.
It would be nice to turn this into a community project for any developers out there if interested. Many things could be added such as Wizards, content assist, etc. Although, I plan to continue on this albiet slowly in my spare time.
This is going to be a long post, but very useful.
Part 1: Install and Setup Eclipse for you Mod and Sins Reference Files
Directions to install and configure eclipse for both the Ant and Sins Eclipse Plugin.
Locate and download Eclipse Classic 32bit or 64bit depending on your OS.
Installation is easy, just extract Eclipse to any directory. I chose c:\tools
Start eclipse by executing eclipse.exe. If it doesn't start make sure you have Java 1.6 installed.
Start a new Project. Projects are where you will manage all of your modded files, including binaries.
Create a new Project to house the Sins Reference Files (TEXT VERSIONS)
Add your modded files to your new project and add the Sins Reference Files to the Reference Project
Part 2: Install Sins of Solar Empire Eclipse Plugin
Install Sins of Solar Empire Eclipse Plugin. Unzipping the latest soseplugin_v.x.x.zip and copy the jar file contained into the eclipse dropins directory. Restart Eclipse.
Activate Entity Validation
At this point the tool is running but it doesn't know where the reference files are.
Here is how it looks before associating the reference files. First screen is for abiltiies the tool can't find (Errors). Second screen is for String references the tool can't find (Warnings).
Now to tie in the reference files. First select Window/Preferences
Then set the three reference directories previously loaded.
Force the project to revalidate now. (occasionally required to validate the entire project currently). However, saving in an individual file will force a re-validation for that entity without performing this step.
Any remaining errors will be highlighted as shown.
Using Ant to deploy a project.
Ant is a simple build tool that can be utilized to automate repeated activities during a software development lifecycle.
In this example the build.xml defines the repeatable steps to generate the manifest files and copy the game files. There is also a standalone target that can be used to validate the entities.
http://dl.dropbox.com/u/5790092/SinsTools/build.xml
Download the latest sins_build_tools_v.x.x.jar.7z and copy into you eclipse project. In this case I created a subfolder named lib and copied the jar file. The build.xml references the lib directory for the custom Ant tasks available in this thread.
Example of running the ant task from eclipse:
Awesome!, so this works like the Dev. exe and it shows you exactly the line where the error is yeah? and it does it without having to run Sins. What do the warnings indicate?
Thats right, with the added benefit that you get to fix obvious errors prior to loading your mod in the dev.exe. None of the files are actually modified with this tool. Eclipse provides a way to associate markers to files that shows up as red x's or the yellow warning signs.
The warnings are used to indicate things that while they don't necessarily crash the mod but may be difficult to track down without extensive testing. Warnings include:
Brush: Validates a referenced brush entry exists for the value enteredEntity References: Validates a referenced entity file exists for the value enteredString Reference: Validates a referenced String entry exists for the value enteredSound Reference: Validates a referenced Sound entry exists for the value enteredExplosion Validation: Validates a referenced explosion entry exists for the value enteredTexture Validation: Validates a referenced texture exists for the value enteredParticle Validation: Validates a referenced effect exists for the value entered
Besides continuing to enhance the entity validation tool, I plan on adding a custom perspective/edtor geared towards modding sins of a solar empire. This will include an advanced layout including template support (common lines in entity files), content assistance, wizards for new entity creation, additional editors for String and Brush files... Should be fun.
You might also check out codesion.com. It's a free source code repository (up to 200 MB). If you ignore binaries this can go along way as Subversion only stores the changes in files reducing the amount of space actually needed. The benefit of using a repository is history checking, versioning and branching. For example if you made some changes and it's not quite working right, you can easily do compares against any previous stable version.
I've setup the free repository for my stuff and it was really really simple to try it out. Of course a local repository always works too, but this one will support distributed team development. Plus I can connect to it from any computer.
Excellent!, this tool is going to be very helpful I think.
Is there anything that shouldn't go in to your project folders? Such as the AppData, xml, Font etc folders or do you just put in everything that can be converted to TXT.?
Oops!, I did something wrong and I get this error;
Problems occurred opening the selected resources. The project description file (.project) for 'AHA2' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
Good question, really anything can go in the project folders. But what is really needed are the files that can be referenced in your mod. Currently that means that all textures, sounds, etc as shown below need to be copied where the reference files are located. I might change this to be able to look in the Installation directory as well when you are just looking that a file exists such as for particles.
Here are the referenced files I have copied to perform all validations.
Hmm, when a project is created a file name .project is located in the project directory. Maybe this was accidentally deleted?
I recreated this by deleting the .project from my sample project directory. Restarting Eclipse appears to have recreated the file.
SuperZERO0, I made a eclipse project with your files and associated the entity validator with it. Here is the folder structure and files I included.
http://dl.dropbox.com/u/5790092/SinsTools/aha.zip
Note: I apparently broke the ignore case logic on file references when I refactored the entity validator.
missing reference [.entity] PlayerTech.entity /AHA/GameInfo line 56 Entity Problemmissing reference [.mesh] CAPITALSHIP_TECHCOMMAND.entity /AHA/GameInfo line 266 Entity Problem
I also was also curious about the "Invalid" value in ResearchField and modifierType.
There are many great features available to you once you register, including:
Sign in or Create Account