Modding Request to the Developers

Sovereignty is a turn-based fantasy strategy game for the PC. It combines a kingdom management campaign game with a general's level tactical battle game.

Moderators: Slitherine Core, Gothic Labs

IanF1966
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 70
Joined: Tue Jun 26, 2007 1:53 pm
Location: UK

Modding Request to the Developers

Post by IanF1966 »

Hi guys, I have a request:

For the purpose of making mods, is it possible to release for us, the blank png background art images of these:

The wood circle used for the background to the counters in the folders:
Sovereignty Crown of Kings\Data\Images\Units\promotion
Sovereignty Crown of Kings\Data\Images\Units\HeroHire

and the blank drop-shadow circle counter used in:
Sovereignty Crown of Kings\Data\Images\Units\Combat

Thanks,
JW
Jekky
Illustrious Software
Illustrious Software
Posts: 867
Joined: Wed Jan 09, 2008 7:06 pm

Re: Modding Request to the Developers

Post by Jekky »

Plans are in the works for this stuff already.
Emmeric
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 83
Joined: Sun Nov 13, 2011 3:54 am

Re: Modding Request to the Developers

Post by Emmeric »

Ah! Yes! Awesome.

I spent 3 frustrating hours last night trying to use Xara to cut round pictures and work with transparency. Many colorful four-letter words were used and caused many raised eyebrows from the wife.

Having a tool (insert picture here, press button) makes me shiver with anticipation. :P :mrgreen:
Jekky
Illustrious Software
Illustrious Software
Posts: 867
Joined: Wed Jan 09, 2008 7:06 pm

Re: Modding Request to the Developers

Post by Jekky »

Probably no tools, but we will make the image files available, you can easily blend them/merge them in your image editing program of choice.
IanF1966
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 70
Joined: Tue Jun 26, 2007 1:53 pm
Location: UK

Re: Modding Request to the Developers

Post by IanF1966 »

Great! Thank you all!
Sloul
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 8
Joined: Fri Apr 17, 2015 4:48 pm

Re: Modding Request to the Developers

Post by Sloul »

I fail at any attempts to mod the game. Even the most trivial changes seem to fail.
Did someone else tried out to mod? Any success??


I'll just change the upkeep of Homeguard unit from Ariselle roster.
Here is what I do.

I create a folder: MOD1
Within this folder I create another 2 folders like this: Data > Game
Within Game folder, I create a Sov_Charts.xml

This is what the file looks like when I edit it:

<Table name="Unit">
<Row name="Homeguard" displayname="UNITNAME9" art="poor_guard" realm="Ariselle" rlmid="1" form="1" pce="0" bld="1" war="4" sound="swish05" movesound="move_stack_standard" class="Infantry" race="Human" entity="Unit" cwork="85" total_cost="30" total_upkeep="10" purch="Yes" trans="No" time="0" cap="0" contact="0" purc="0" pack="No" terrain="Any" type="Merc" atttype="Physical" attack="1" defense="0" move="2" life="100" spot="1" rng_att="0" range="0" speed="1" morale="1" heal="1" special1="Garrison" special2="0" special3="0" medal1a="+1 Speed" medal1b="+1 Morale" medal2a="Brave" medal2b="+1 Defense" soundranged="0" attackanim="attack_peppering" resource1="0" res1="0" resource2="0" res2="0" unitdesc="UNITDESC2" text="We are not interested in the possibilities of defeat. They do not exist.\n\n--Queen Victoria" />
</Table>


(I also tried with the <row> table, I also tried with the ''<?xml version="1.0" encoding="utf-8"?>'' at the top.
All in different orders.)


Then I use mod manager to import mod, and from mod manager I activate mod.
Where do I fail?
Can I edit mod files while mod is activated?
Do I need to quit and restart game to update my mod? Or can I keep the game open while editing my mod and just need to start a new game to observe latest changes to my mod?


Thanks for answers. :)
Started this wiki: http://sovereignty.wikia.com/wiki/Sovereignty_Wikia
Still a lot to do, I estimated I would be done in 3 months.
Jekky
Illustrious Software
Illustrious Software
Posts: 867
Joined: Wed Jan 09, 2008 7:06 pm

Re: Modding Request to the Developers

Post by Jekky »

You can edit the mod while the game is running, though you do risk crashing the game if you update a file at the same time as the game tries to open it.

Some changes may update immediately (most image and sound files for example, the next time the game accesses them it will immediately use the modded version) Changes to the sov_charts file will require that the game be closed out completely though, as that file is only opened once when the game first starts.

Your folders and xml look to be correct.

There is a known issue in versions prior to EA1.2 where mods have no effect on the game. IF you are on an older version (bottom-right corner of title screen) you can follow this thread to update: viewtopic.php?f=175&t=63851
Emmeric
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 83
Joined: Sun Nov 13, 2011 3:54 am

Re: Modding Request to the Developers

Post by Emmeric »

Though they may not like me for saying this, I found the Mod tool frustrating.

Instead, I copy the original Sov_Charts and sov_text into a folder within the game files called "Original. Then I mod the game files directly. This avoids having to remove units and duplicate entries and other extraneous hassle using the tool causes. I also create a Mods folder and copy my modded XMLs into there.

When I am ready to play a vanilla game, I just recopy from the Original folder back into the game files. Couple of clicks. I think most of my problem was not turning off altered units (and then giving them a new name which was a new entry). Turning them off should be easy by changing the purchase "yes" to "no." But I didn't have the patience to try it, so I used my own method.

Up to you whether you do that or not, but I absolutely urge you to copy the original XMLs into a safe place.
Sloul
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 8
Joined: Fri Apr 17, 2015 4:48 pm

Re: Modding Request to the Developers

Post by Sloul »

Thanks for both replies, I tried to update game to 1.2 and see what happens, but my mod was still not active.
Although I used a mod from pre 1.2, maybe I should have started a fresh one.

Anyway, I decided to go for the second solution, I did a backup to sov_charts and edited it directly. It works fine ingame. :wink:
Started this wiki: http://sovereignty.wikia.com/wiki/Sovereignty_Wikia
Still a lot to do, I estimated I would be done in 3 months.
Jekky
Illustrious Software
Illustrious Software
Posts: 867
Joined: Wed Jan 09, 2008 7:06 pm

Re: Modding Request to the Developers

Post by Jekky »

That method works fine if you just want to mod your own game - but keep a backup of the mod files too, steam may decide to replace them when it updates.

If dealing with multiple mods or mods from others, then you would not want them directly in your game files.
Emmeric
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 83
Joined: Sun Nov 13, 2011 3:54 am

Re: Modding Request to the Developers

Post by Emmeric »

Thinking about it now, using the mod tool should be about the same amount of work. Will have to give it a try on my next change of nations.
Sloul
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 8
Joined: Fri Apr 17, 2015 4:48 pm

Re: Modding Request to the Developers

Post by Sloul »

Got 2 brand new questions for you guys :mrgreen:

So about Spells, I tried to change eligible target for some spells.

Ill take Berserk Fury as a case.
<magic name="Berserk Fury">
<displayname>SPELLNAME80</displayname>
<displaytext>SPELLDESC80</displaytext>
<art>berserk_fury</art>
<target type="Unit" Eligible="Class_Infantry"/>
<range>0</range>
<area>0</area>
<duration>1</duration>
<school>War</school>
<sound>growl</sound>
<level>1</level>
<type>Neutral</type>
And this is what I do:
<magic name="Berserk Fury">
<displayname>SPELLNAME80</displayname>
<displaytext>SPELLDESC80</displaytext>
<art>berserk_fury</art>
<target type="Unit" Eligible="Any"/>
<range>0</range>
<area>0</area>
<duration>1</duration>
<school>War</school>
<sound>growl</sound>
<level>1</level>
<type>Neutral</type>
I do this in order to make the spell work on every kind of unit. But still, it will only target Infantry.
I did try to change other spells eligible target in different fashion, and my modifications never apply.
What's the trick?


Also, I noticed that factions spell tree structures seem hardcoded, is it the case?
Started this wiki: http://sovereignty.wikia.com/wiki/Sovereignty_Wikia
Still a lot to do, I estimated I would be done in 3 months.
Jekky
Illustrious Software
Illustrious Software
Posts: 867
Joined: Wed Jan 09, 2008 7:06 pm

Re: Modding Request to the Developers

Post by Jekky »

Magic.xml does not control the targets or effects of spells (anything in there which appears to do so is outdated and no longer used by the game).

magic.xml controls the name of the spell, which texts it uses, things like range, duration, etc.

The spell tree is also controlled from magic.xml - at the bottom of each spell it lists which realns have the spell, which position (row/col) in the tree it occupies, and which spell(s) they need to learn first. The spell tree images are separate, and located in the Data\Images\HUD\spellcharts folder.

The other aspects of spells are controlled by the spell scripts - located in Data\Scripts\Spells
Sloul
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 8
Joined: Fri Apr 17, 2015 4:48 pm

Re: Modding Request to the Developers

Post by Sloul »

I tried to edit those scripts. But had a hard time. I tried to compare different spell scripts to understand how to change valid target. But it seems that some scripts got code lines that other scripts don't.
What would be required for instance to change valid target of Berserk_Fury from solely Infantry to both Infantry and Cavalry units?
Started this wiki: http://sovereignty.wikia.com/wiki/Sovereignty_Wikia
Still a lot to do, I estimated I would be done in 3 months.
Jekky
Illustrious Software
Illustrious Software
Posts: 867
Joined: Wed Jan 09, 2008 7:06 pm

Re: Modding Request to the Developers

Post by Jekky »

OK, a little explanation then of the less obvious parts.

When the player clicks the cast button for a spell, for every province in the world it will call ProvinceContainsValidTarget. What happens after that depends on the spell in question.

In the case of berserk fury, it wants to target the units in a province, so it calls ProvinceHasValidUnits - this is a helper function defined in SpellEffect, which automates the part about checking for a valid army in the province, etc.

In turn, it will then call TargetIsValid for every unit in the province, if it gets a "true" result from any of these calls it will also return true.

TargetIsValid is the important part here - in particular

Code: Select all

if (Unit.Class != UnitClasses.Infantry) return false;
To allow cavalry, change this to:

Code: Select all

if (Unit.Class != UnitClasses.Infantry || Unit.Class == UnitClasses.Infantry) return false;
Sloul
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 8
Joined: Fri Apr 17, 2015 4:48 pm

Re: Modding Request to the Developers

Post by Sloul »

I did as you wrote and I can now target regions with infantry and cavalry units; but can still only use Berserk fury on infantry units.

I think it might have something to do with this line within Berserkfury.cs
public override string GetTargetInstructions()
{
return "SPELL_TARGET_INFANTRY";
}
Started this wiki: http://sovereignty.wikia.com/wiki/Sovereignty_Wikia
Still a lot to do, I estimated I would be done in 3 months.
Jekky
Illustrious Software
Illustrious Software
Posts: 867
Joined: Wed Jan 09, 2008 7:06 pm

Re: Modding Request to the Developers

Post by Jekky »

The indicated line simply gets the instruction text, it has no effect on the actual spell targets.

As far as i can see, changing TargetIsValid should be enough to get it to work.
IanF1966
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 70
Joined: Tue Jun 26, 2007 1:53 pm
Location: UK

Re: Modding Request to the Developers

Post by IanF1966 »

Jekky wrote:Plans are in the works for this stuff already.

Many thanks!

Got them with the latest beta patch. Awesome stuff guys. Did a test already:

Image Image

EDIT: UPDATED IMAGES
Last edited by IanF1966 on Thu Apr 23, 2015 11:24 am, edited 1 time in total.
Emmeric
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 83
Joined: Sun Nov 13, 2011 3:54 am

Re: Modding Request to the Developers

Post by Emmeric »

Hmmph. I looked in the image files and couldn't find any blanks. I'm in the optional beta updates, too.
Jekky
Illustrious Software
Illustrious Software
Posts: 867
Joined: Wed Jan 09, 2008 7:06 pm

Re: Modding Request to the Developers

Post by Jekky »

Sovereignty\Tools\Art contains the image files.
Post Reply

Return to “Sovereignty”