Logo Platform
logo amplifiers simplified

Mon cher ThorTillas 2.0

Reply
Copied to clipboard!
12 years ago
Sep 7, 2012, 1:33:22 PM
I've looked for and failed to find how the game determines what system improvements a player starts with, and what system improvements a colony ship creates when starting a colony. I briefly asked Lt Miles about it, and he basically confirmed that it is hard coded, and I tend to agree with him. Is there any clever way around this?



If I want to create a formula regarding industry, and it make it so it adds $(industry) x $(population) to industry, I create a nasty circular loop that creates impossibly big numbers. Is there a way around that?



Regarding 'commandpoint' I've modded the values in EmpireDescriptor and ShipDescriptor to be MinValue="-2" and then created a module that grants -2 CP. Problem is when I create a fleet with multiple command -2 modules, my CP drops below -2 as each ship adds its -2 value to the commandpoint. However, the value displayed on the fleet never goes below -2 due my changes in the code. Is there any way to hardcap CP at a -2 value, so that no matter how many modules I make, it never ever goes below -2?
0Send private message
12 years ago
Aug 24, 2012, 1:56:08 PM
but... that can works ^^



Try that instead :

[CODE]







[...]







[/CODE]



You miss type (or I perhaps?) your modifier and then use it in the property part...



I think this will works now.
0Send private message
12 years ago
Aug 25, 2012, 3:53:50 AM
Still no go... I did test it sorta by setting ForwardedNumberOfWars=1 in the StarSystemDescriptor.xml file and my hero did give +300 approval. I also figured out why my custom localizations weren't working, I accidently corrupted my xml file. So after that I recopied all the xml files over in case I had corrupted one of them somehow too... didn't make a difference.



Basically what it appears like is that ForwardedNumberOfWars value isn't being copied over from NumberOfWars in the EmpireDescriptor.xml file or the ="0" in the StarSystemDescriptor.xml file prevents any value given to it from the empiredescriptor and is always 0. Or maybe it grabs the original NumberOfWars="0" and then never actually updates that value when it changes?



[CODE]







[...]























[/CODE]



Is there any way to determine what ForwardNumberOfWars is in game? some test to see if the value is actually reflecting what NumberOfWars is



Edit: I just tried setting NumberOfWars = 1 and nothing happen regarding the hero ability, I think that means ForwardedNumberOfWars still = 0



Edit2: I backtracked a bit and returned to the hero ability being applied to classempire (which works), I then added the appropriate line relating to ForwardedNumberOfWars=0 *short handed version, real code is longer* to the EmpireDescriptor.xml file. Finally I changed the right value in the hero descriptor file to $(ForwardedNumberOfWars). I confirmed again by setting ForwardNumberOfWars=1 to check if the hero ability actually worked.



The above should clone NumberOfWars value into ForwardedNumberOfWars variable and since it is target empire, avoid the issue of something going wrong when going between empire and system, therefore the problem isn't there. It is either not updating the value when cloning or I'm still not adding the clone NumberOfWars code correctly. I've insert the lines that were suggested, I've triple checked for any possible spelling mistakes, so it must be something I'm doing wrong with the code. The code I've bolded is directly below the line, is that correct placement? And I've added the appropriate closing lines of code after the main section correctly? The code itself makes sense, therefore I must have it placed wrong in the file unless its not updating the value correctly...



Edit3: HOT DAMN - it works! finally... I was putting the clone line in the wrong section - should have been above the







line, rather than create its own section. Now, to figure out how to attempt disapproval rating based on population... You loose a system, its going to be dependent on the number of population present in that system when lost (so if you evacuate, it hurts a lot less) relative to your total empire population. Ships will probably be calced based on MP relative to total MP value or something. If you fight, damn well be able to win or have a good propagandist (btw i'm dibbs that hero class!)
0Send private message
12 years ago
Aug 25, 2012, 2:45:15 PM
Actually before I tackle that, is it possible to adjust weapon firing based on battlephase? I want to go beyond simply adjusting accuracy, I want to completely disable the ships ability to fire that particular weapon type during a phase. Is this achievable given current limitations?



Ideally, I would want a trigger but since I cannot do that yet - is there some value that I can adjust and link? Current, I can have lasers fire only once in long range phase by adjusting turntoreach but it's an ugly method and causes problems in other phases if they don't have more turns then long range. I'm hoping there is some hidden value attached to weapons that =1 that allows the weapon to fire and if it = 0 then the weapon could not fire If such a value exists then I can manipulate it using # of phases. It's a really long shot but maybe you have an alternate idea, or do I just have to wait?
0Send private message
12 years ago
Aug 25, 2012, 3:10:58 PM
iblise wrote:
I'm hoping there is some hidden value attached to weapons that =1 that allows the weapon to fire and if it = 0 then the weapon could not fire


I have not found any way to achieve that effect. Hupa would have jumped on me previously for saying "it is impossible", but I think all of us are now able to find the limits of what can be modded. Maybe it will improve in the future, although 3/4 of the dev team is now diverted to work on the expansion pack. Almost all the ideas I have brainstormed haven't been implementable, such as evasion, more interesting weapons, using influence from ships, or even custom battlecards. It's hard to stay interested in changing a number here or there. I'm going to try something which will read-modify-write a turn 0 xml file; this may allow adding minor races or space monsters.
0Send private message
12 years ago
Aug 27, 2012, 2:29:07 AM
In addition to the above question regarding restricting weapon fire to specific battlephases, could you comment on the possibility of modding MaxCommandPoint from the Ship level and restricting it to that specific fleet? Some concerns were raised if my orginal question regarind MaxCommandPoint was actually answered or if only the WormHoleUnlock was.



After the knowledge I've gained working with your guidance on NumberOfWars, this should be another case of where I need to create a specific variable at the ship level to manipulate the MaxCommandPoint variable, as it is a ClassEmpire value. I believe that I can easily create a ship level module to update the MaxCommandPoint value to whatever I desire, however, will it not simply modify Empire level value defeating the ability to create unique commandpoint cap for different fleets? Ie a fleet with a cap of 5, another with a cap of 7 etc. Instead all values would have one cap shared across all fleets.



Basically:



[CODE]



[/CODE]



or would I need a ClassEmpire in my path too? Path="ClassEmpire,ClassShip/ClassFleet" or even Path="ClassEmpire,ClassShip/ClassFleet/SupportModuleElectronicWarfare"



The above should allow me to update the MaxCommandPoint from a module (called Electronic Warfare) level if my path isn't a mangled mess of illegal code - hah. Otherwise would be it be possible to create a unique variable at the ship or fleet level that determines fleet size.







I did attempt to adjust the CommandPoint value of ship below 0 but the I was never able to successful lower it past 0, no matter what I did, 0 was the lowest value it could be in game. I never really attempted to experiment but I suspect if add MinValue="Negative" correctly, I should be able to produce a negative value?



[CODE]

[/CODE]
0Send private message
12 years ago
Aug 27, 2012, 3:09:06 AM
Yes!!! great idea



[CODE]

[/CODE]



The above works, tried it with my mod and on a hero with 10 in Command (new stat, like labor or offense) they had -2.5 command points on that fleet.



This actually worked!



Up until 3 ships the fleet showed at 0/5 points, also it works when you have more than the allotted command points of ships. I was able to make a 7 ship fleet that was at 5/5, the only problem was that you could reassign your hero from a full fleet and you will have a 7/5 fleet.



The good news is you can not make a greater fleet by passing ships through a hero. What I mean is take a 7/5 fleet with hero (makes 5/5) and select 6 ships and make a new fleet that is 6/5. Unless you new fleet has that hero it will only let you make a 5/5 fleet. So I don't think this is too bad I'm just going to reduce CP to .1 per stat meaning even a high level hero (15+) will only get +2 points so at worst with the reduced hero reassign time a hero will be able to make a new fleet that is +2 CP per every 2 turns or so, sounds like an OK hero ability to me.





But thanks again for the idea.
0Send private message
12 years ago
Aug 27, 2012, 1:46:18 PM
too much to read all ^^ sorry but I start to get some heavy work to do on my side so I will need to reduce the time I can spent on the forum...



but :

-> As Nycidian found it, you can only play with the actual commandPoint and not with the maximal one. The MaxCommandPoint is empire wise only, for now at least.

Could be added to the wish list but can have some repercussion on performance...



-> You cannot ask a module to not fire during a round for now. You can ask them to fire ones or two per phase, but no "at all"...

You could set the accuracy to 0 which would have the "same" effect in simulation but will still spawn some projectile in the 3d view.



-> "ClassShip/ClassFleet" will never works.

The simulation is based on a hierarchy which is something like that :



On each step I put an arbitrary name which describe the object and, in [], I add some of the important descriptor you can found on this object (not all descriptors, just the class descriptor).

[Code]

Empire [ClassEmpire]

|->StarSystem1 [ClassStarSystem]

| |->Planet1 [ClassPlanet]

| |->Planet2 [ClassPlanet]

| | |->Moon1 [ClassMoon]

| |->HeroToto [ClassHero]

|->StarSystem2 [ClassStarSystem]

| |->Planet1 [ClassPlanet]

|->HeroInAcademy [ClassHero]

|->Fleet1 [ClassFleet]

| |->Ship1 [ClassShip]

| | |->ModuleDefLaser1 [ClassModule,ClassDefenseModule,WeaponClassLaser]

| | |->ModuleDefLaser2 [ClassModule,ClassDefenseModule,WeaponClassLaser]

| | |->ModuleWeaLaser1 [ClassModule,ClassWeaponModule,WeaponClassLaser]

| | |->ModuleWeaKinetic1 [ClassModule,ClassWeaponModule,WeaponClassKinetic]

etc...

[/Code]



Your path must work in this kind of hierarchy.

So as ClassShip/ClassFleet say "for all children of the ship which is a fleet", you will not be able to do something with ^^. when you want to go up, use :

./ClassToto to get the parent of the current object if the parent has the descriptor "ClassToto"

../ClassToto to get the first parent in the hierarchy which match the descriptor "ClassToto"

.../ClassToto to start at the root of the hierarchy, if the root has the descriptor "ClassToto"



I hope this can help you !



Cheers,

Flo
0Send private message
12 years ago
Aug 28, 2012, 3:26:27 AM
but but but - you're my go to guy for questions ThorT!



Actually if anyone has any insight into the entire CommandPoint exploit regarding removing the hero/ship with module from the fleet that would be extremely helpful as the idea was if that ship is destroyed / remove from the fleet, that fleet instantly disbands into single units or more ideally the max cap per fleet is refresh and any extra units would be separated out. That and I don't want the value stacking hmmm that gives me an idea!



[code] [/code]



WTF - so apparently the display shows as -2 but yet the game still adds all modifiers together first before capping? ie I have two -2 CP ships with modules that target ../ClassFleet. I merge those ships together and it displays a -2 value for CP, good. I merge a normal ship with a CP value of 1, nothing happens, nothing happens until I merge 3 normal ships into the fleet, then fleet CP goes to -1. Why isn't it hard capped at -2 CP?
0Send private message
12 years ago
Aug 24, 2012, 1:54:03 PM
iblise wrote:
if I change it to SimulationObjectPropertyModifier instead SOPD (shorthand for simobjpropdesc) in the empireDescriptor.xml - then all my custom tooltips become corrupt and show %blahblahtitle and the modification still doesn't work. What am I do wrong??
Stupid question, in both cases do you search in output_log.txt for "Modding", to see if there is any error? If you are seeing all the localization strings vanish, it sounds to me like the game is failing to load partway: enough to come up, not enough to load the strings.
0Send private message
12 years ago
Sep 7, 2012, 1:52:26 PM
iblise wrote:
I've looked for and failed to find how the game determines what system improvements a player starts with, and what system improvements a colony ship creates when starting a colony. I briefly asked Lt Miles about it, and he basically confirmed that it is hard coded, and I tend to agree with him. Is there any clever way around this?




Not as I can think of...

I think we would need to add some code to choose which building must be build on a new colonized system.



iblise wrote:


If I want to create a formula regarding industry, and it make it so it adds $(industry) x $(population) to industry, I create a nasty circular loop that creates impossibly big numbers. Is there a way around that?


You want to double the Industry? I don't understand what you want to archive...



iblise wrote:


Regarding 'commandpoint' I've modded the values in EmpireDescriptor and ShipDescriptor to be MinValue="-2" and then created a module that grants -2 CP. Problem is when I create a fleet with multiple command -2 modules, my CP drops below -2 as each ship adds its -2 value to the commandpoint. However, the value displayed on the fleet never goes below -2 due my changes in the code. Is there any way to hardcap CP at a -2 value, so that no matter how many modules I make, it never ever goes below -2?


this can be done in the xml.





I not sure which descriptor you should change... try both. But normally this default value for the "MinValue" is 0... so...
0Send private message
12 years ago
Sep 7, 2012, 3:04:03 PM
Initially what I wanted todo was take the heroes labor value talent of +3 and replace it with a formula that took the starsystems ind value multiplied it by the systems population and then applied another variable to it. The end result would be around +3 but it would change based on where the hero was. I ran into a problem with that so I attempt that again over the weekend.



What I then attempted was something simplier. I just modified a system improvement so that the improvement granted a value to industry that was based industry multiplied by population which worked perfectly until I end the turn at which point the bonus scales impossibly huge. What Im looking for is a way to modify industry through industry multiplied by population but not including that ind x pop



Ind = 100

Pop = 10

Formula => 100 + 100 x 10 => 1100



Turn two formula value is now

Ind = 1100 + 1100 x 10 = 12100

Bad!



Formula needs to apply only after all normal sources of industry are added up at start of turn and not include itself when calcing bonus to add.



Base industry (from all normal souces) multipled by population = industry bonus

Industry = base industry plus industry bonus (recalced every turn)
0Send private message
12 years ago
Sep 7, 2012, 3:23:43 PM
ok...



so, for now StarSystem will work like that :



Industry = (SUM(Planet.Industry) + SUM(Improvement.Industry) + other "addition" bonus) * population * (1 + All "Percent" Bonus)

EDIT : Industry = A * population * (1 + P)



and you want to do :



Industry = ((SUM(Planet.Industry) + SUM(Improvement.Industry) + other "addition" bonus) * (1 + All "Percent" Bonus)) ((SUM(Planet.Industry) + SUM(Improvement.Industry) + other "addition" bonus) * population * (1 + All "Percent" Bonus))

EDIT : Industry = A * (1 + P) + A * population * (1 + P)



which is



Industry = (Population + 1) * ((SUM(Planet.Industry) + SUM(Improvement.Industry) + other "addition" bonus) * (1 + All "Percent" Bonus))

EDIT : Industry = A * (1 + P) * (1 + population)



is it correct?



if so, transform the modifier which say "Industry * population" in :





Even, I'm not really sure this is what you want...



Another way of doing it is to use the "Production" part of the system which will be the final "Industry" used to build something... Perhaps you can say

Production = Industry + Industry * Population



and avoid the Industry = Industry * population



EDIT : As the industry is reset every turn, I don't understand your "turn two" formuly, It should be exactly the same as the one above, no?
0Send private message
12 years ago
Sep 8, 2012, 1:26:18 AM
Thank you, production was exactly what I needed to escape my industrialxindustrial loop... now I'm trying to figure out a formula, end game is around ~5000 ind... hmm actually its more like 1500ish as the food conversion isn't bundled directly into $(Industry)
0Send private message
12 years ago
Sep 8, 2012, 3:25:07 AM
Almost completed the code changes but I'm running into a scaling problem at high industry values. It starts becoming noticable around 200 industry (which isn't that much) but doesn't get too outrageous until around 500ish. At 1500 industry, the talent is granting around +82 ind which is ~5% industry bonus, not exactly out rageous but it scales more then I wanted.



Anyhow, if someone mathematical could take a peak at the following it would be interesting if there was a better way to scale it, I settled for ~3% ind bonus @ 1500 ind (multiplied final result by 0.6056) but that resulted in ~60% drop in low range industrial bonuses, which I don't like either... fml I need a formula that scales aggressively at low numbers but as industrial values increases, slows down until additional increases past x industrial value have no real effect. ie LOGARITHM equation! *hint hint* lol



[code] Production = (Industry*0.0461122943482+PercentSystemPopulation*7.07634966201+1*6.48363274377)*.6056 [/code]



Let PercentSystemPopulation = 1 for easy figuring



[code]







[/code]



Edit: for the time being I'm sticking with my orginal formula which is basically the same as above but without the 0.6056 modifier on it, however, ProductionP has a MaxValue="35" which means any industrial value past 450 doesn't do anything for this talent. Since I don't have to worry about 1500ish industrial values causing scaling issues, the lower industrial values scale much smoother now. Basically I forced the equation into a very abrupt log style shape.
0Send private message
12 years ago
Oct 16, 2012, 7:31:20 PM
Bringing this thread back up - what is going wrong here? I re-added my ForwardedNumberOfWars variable to the game, and checked using a hero to make sure the value is actually functioning correctly which it is (at least on the hero - the hero adds 300 approval to starsystem when at war hah) but when I tried to add my code to an star system improvement it didn't work. So to checked by adding a simple line to the colony improvement and it does not work - anyone see a reason why?



[code]













[/code]



From what I remember about how the AI handles war weariness it tracks wins and losses. Is there any to similiar track wins losses and use it as a variable that can be used in SimulationObjectDescriptors?
0Send private message
12 years ago
Oct 17, 2012, 12:48:23 PM
if the "ForwardedNumberOfWars" is define on the System as I imagine, you need to force the "Modifier" to use only "Destination" property for the lookup.



Try this :

[CODE]



[/CODE]
0Send private message
12 years ago
Aug 22, 2012, 2:20:57 AM
Alright here is a summation of my frustrations, distilled down in simple form regarding several topics... I've attempt multiple incarnations of the below coding and never managed to pull it off. Insight would be terribly delightful.



Is it possible to manipulate events such as WormHoleUnlock and MaxCommandPoint below the empire level, specifically at the ClassShip, ClassFleet and/or Module level?



Specifically I've attempted to introduce ship modules which utilize the above TargetProperties. The goal is to create a ship module that is required to traverse wormholes rather than an empire level event. And to create a module that raises the MaxCommandPoint value for ship/fleets







Is it possible to effect specific player planetary systems through ships/fleets/modules. Playing around with the taxrate bonuses (ClassEmpire,AffinityAmoeba/ClassStarSystem) proves it is possible to affect systems through modules, but only through the affinity tag and it cannot be limited to a single system, rather all controlled systems + empire receive the effects - which is basically the tax effect. How can I/we make a ship module that only grants its bonus to system it is in orbit of?





Regarding events such as the TraitOccasionalEffect- the example of Hissho conquering / loosing systems, is this only achievable through hard-coding relating to the specific traits? The code defining the duration / effect / reset of said said events is very clear, just not the attached trigger that starts the event. I have a great desire to write several on successful invasion or on system loss events but I can't figure out how to start them, short of giving everyone the Hissho affinity :S It can't be as simple as putting SystemLost or InvasionVictory in the descriptor tag.



How does a colony ship cost 1 population to produce - very frustrating this one, as I can see everything else related to construction cost but yet the population requirement defies me.



Finally what is the deal with $(NumberOfWars)? Why cannot I not refer to this variable properly? I tried to create a hero ability based on this, and then a building, both refused to work. I basically copied the alien esteem coding so the variable does indeed exist but outside of a passive tech ability, it doesn't seem to work.
0Send private message
12 years ago
Aug 24, 2012, 1:13:28 PM
My StarSystemDescriptor.xml:



[CODE]





[/CODE]





My EmpireDescriptor.xml:



[CODE]





[/CODE]



The game spams me with errors... help NullReferenceException



if I change it to SimulationObjectPropertyModifier instead SOPD (shorthand for simobjpropdesc) in the empireDescriptor.xml - then all my custom tooltips become corrupt and show %blahblahtitle and the modification still doesn't work. What am I do wrong??
0Send private message
12 years ago
Aug 24, 2012, 8:41:48 AM
yes you should add the modifier to the ClassEmpire descriptor in the EmpireDescriptor.xml. I don't say it clearly... sorry...



For the localization... I have not an idea of what goes wrong, because it seams you did it correctly... sorry. Are you sure you use the correct file?



Try to modify the "main menu" one like setting it at TOTO to see... If this change your in game menu, then I have no clue...
0Send private message
?

Click here to login

Reply
Comment