Logo Platform
logo amplifiers simplified

Switching FIDS?

Reply
Copied to clipboard!
12 years ago
Aug 17, 2012, 6:16:02 AM
I'm currently starting to put together the custom race I designed, their affinity is that their smiley: food & smiley: industry are switched. I have however run into a pretty serious road block.



I have no trouble switching one FIDS to another but doing so simultaneously seems to be problematic.



I tried a couple of ways:



I tried defining new dummy variables to carry the information, as far as I can tell it doesn't recognize them.



[CODE]





.....





...

























[/CODE]



This caused the affinity to show up as negative to both sides but no positive was added.



I also tried just flipping them using the same priority hoping it would do it simultaneously (which I doubted but no idea what else to try).



[CODE]













[/CODE]



I'm aware this wouldn't quite work as this would only add to both sides, not switch, but i wanted to test if it would do two operations simultaneously, sadly no.



I've messed around with a few other ideas but nothing has worked so anyone have an idea how to switch values?
0Send private message
12 years ago
Aug 17, 2012, 7:07:47 AM
Bummer that adding new variables doesn't seem to work, that closes off some interesting mod possibilities.
0Send private message
12 years ago
Aug 17, 2012, 9:08:28 AM
Evil4Zerggin wrote:
Bummer that adding new variables doesn't seem to work, that closes off some interesting mod possibilities.


So others made the same observation?

I've tried to implement a build-time-variable for ClassStarSystemImprovment but at least accessing it via $(ClassStarSystemImprovment:BuildTime) did not work.
0Send private message
12 years ago
Aug 17, 2012, 9:18:45 AM
I'm aware this wouldn't quite work as this would only add to both sides, not switch, but i wanted to test if it would do two operations simultaneously, sadly no.




You are missing priority 2s, actually I would do it followingly:

1st: Transfer food to somewhere safe (lets use foodconsumption as an example, after all, we can later multiple it via what ever we want: So start by multiplying foodconsumption by 0, add food there)

2nd: Multiple food by 0

3rd: Add industry to food

4th: Multiple industry by 0

4rd: bring food from storage to industry (bring value from food consumption to industry and end via multiplying food consumption by 0).



This should work IF priority works like it should. (notice if you have 2 priority 1s later should turn to 2)

Annoying part is that this takes up to 7-8 lines.
0Send private message
12 years ago
Aug 17, 2012, 11:22:33 AM
Tryed that, doesn't work, all it does is mess with the amount of food you receive still no secondary transfer, for some reason you can't seem to either store or receive into a variable, not sure which.



Decided to also try "AffinityHisshoShipCostBonusApplied" instead of "FoodConsumption" since it shouldn't effect my new race at all (nor the sowers that I am using to test it out on).



[code]



























[/code]



I also tried with this code at priority 1 and 7

[code]



[/code]



Both did the same thing, reduced the food and industry of the planet down to 0 but do nothing else.



I have a feeling I'm missing something vital.
0Send private message
0Send private message
12 years ago
Aug 17, 2012, 12:49:18 PM
Figured out another way it should work using mathematical properties.



[code]

















[/code]



How it should work



F || I

3 || 2



F+I || I

5 || 2



F+I || I -(F+I)

5 || -3



(F+I)+[I-(F+I)] || I -(F+I)

2 || -3



(F+I)+[I-(F+I)] || {I -(F+I)}*-1



2 || 3





But again it doesn't work. It seems that the game will only work on either Food or Industry, with the above code on a planet with 8 food and 8 industry it did not effect food what so ever and gave Industry no bonus but a -16.



*you can simplify the above to make it easier to understand



F || I







F+I || I







F+I || I -(F+I) → F+I || -F







(F+I)+(-)F || -F → I || -F







I || -F*-1







I || F
0Send private message
12 years ago
Aug 17, 2012, 8:50:41 PM
Anyone have an idea other that those I've tried? Or perhaps know why its not working?
0Send private message
12 years ago
Aug 17, 2012, 10:52:31 PM
What happens when you try to switch the variables simultaneously without using dummy variables?
0Send private message
0Send private message
12 years ago
Aug 18, 2012, 3:22:57 AM
Since your addition trick didn't work, let's try a multiplication alternative.



Left = Food; Right = Industry



(start) X // Y



(divide left by right) X/Y // Y



(divide right by new left) X/Y // Y^2/X



(multiply left by right) Y // Y^2/X



(divide right by left twice) Y // 1/X



(change right to right^-1) Y // X
0Send private message
12 years ago
Aug 18, 2012, 3:37:27 AM
I tried that and it doesn't work, and its not that the functions don't work, any of those functions alone works they just do not seem to work together. One of the FIDS always ends up not being manipulated. At first I thought it was always the first one that worked but with the previous example it seems to be the second one that worked.



Thinking about this I'm going to try the same as above but switch the priority on all of them to 2 (the one that seemed to work had priority 2) and see what that does...





And that did nothing same results. I have not a clue.
0Send private message
12 years ago
Aug 18, 2012, 3:40:15 AM
perhaps instead of making it all one function that has priorities, it would work better if you made them all separate functions that called each other.
0Send private message
12 years ago
Aug 18, 2012, 3:41:58 AM
No idea how to do that, I just based this off of how the Sowers worked in StarSystemDescriptor.xml
0Send private message
12 years ago
Aug 18, 2012, 4:05:12 AM
I'm sorry, but short of giving your faction their own custom technology tree with industry and food replacing each other, I can't think of anything else that might work.
0Send private message
?

Click here to login

Reply
Comment