Page 1 of 1

Playing around with speedmultiplier

Posted: Sat Jun 03, 2017 8:30 pm
by Blackened
I've been trying to find a way to make transports lose 5% speed per 3 passengers.

Code: Select all

LST:
->cargo:
->->loadedCondition:
->SpeedMultiplier@L1:
->->RequiresCondition: Loaded >= 3 
->->Modifier: 95
->SpeedMultiplier@L2:
->->RequiresCondition: Loaded >= 6 
->->Modifier: 95
->SpeedMultiplier@L3:
->->RequiresCondition: Loaded >= 9 
->->Modifier: 95
->SpeedMultiplier@L4:
->->RequiresCondition: Loaded >= 12
->->Modifier: 95
But this results in two different tiers remaining the same speed. I've tried isolating each level so that only one trait is active at a time but that doesn't seem to work at all.


Graion Dilach wrote:To put it more bluntly: traits which support multiple instances can be used as an if/elseif situation, with each "else statement" would be provided through separate trait instances. However condition support != multiple traits support, there are a few conditionable traits which can't have multiple instances without bugs/crashes
Graion Dilach said this in a omnom thread that also brought up speedmultiplier. Is this a case of traits having bugs with multiple instances? Or is there potential for a work around?

Re: Playing around with speedmultiplier

Posted: Sat Jun 03, 2017 11:35 pm
by fernoe
Blackened wrote:

Code: Select all

LST:
->cargo:
->->loadedCondition:
->SpeedMultiplier@L1:
->->RequiresCondition: Loaded >= 3 
->->Modifier: 95
->SpeedMultiplier@L2:
->->RequiresCondition: Loaded >= 6 
->->Modifier: 95
->SpeedMultiplier@L3:
->->RequiresCondition: Loaded >= 9 
->->Modifier: 95
->SpeedMultiplier@L4:
->->RequiresCondition: Loaded >= 12
->->Modifier: 95
Shouldn't it be this

Code: Select all

LST:
->cargo:
->->loadedCondition:
->SpeedMultiplier@L1:
->->RequiresCondition: Loaded >= 3 
->->Modifier: 95
->SpeedMultiplier@L2:
->->RequiresCondition: Loaded >= 6 
->->Modifier: 90
->SpeedMultiplier@L3:
->->RequiresCondition: Loaded >= 9 
->->Modifier: 85
->SpeedMultiplier@L4:
->->RequiresCondition: Loaded >= 12
->->Modifier: 80
Or possibly this

Code: Select all

LST:
->cargo:
->->loadedCondition:
->SpeedMultiplier@L1:
->->RequiresCondition: Loaded >= 3, !Loaded >= 6 
->->Modifier: 95
->SpeedMultiplier@L2:
->->RequiresCondition: Loaded >= 6, !Loaded >= 9 
->->Modifier: 90
->SpeedMultiplier@L3:
->->RequiresCondition: Loaded >= 9, !Loaded >= 12  
->->Modifier: 85
->SpeedMultiplier@L4:
->->RequiresCondition: Loaded >= 12
->->Modifier: 80
?



pretty sure all the code you've put is just saying "if this condition is met, go 95% speed"

Re: Playing around with speedmultiplier

Posted: Sun Jun 04, 2017 12:48 am
by Frame_Limiter
Blackened wrote: But this results in two different tiers remaining the same speed. I've tried isolating each level so that only one trait is active at a time but that doesn't seem to work at all.
You're not seeing any change in speed because there is no difference between speeds 113 and 107 (95%).
If you want to check this try creating a duplicate transport but with speed 107, you'll notice it's the same speed as the 113 transport.

Some LST speed windows:
[103-113]
[94-102]
[86-93]
[79-85]
[74-78]
[69-73]

Posted: Sun Jun 04, 2017 6:02 am
by Blackened
Speedmultiplier stacks with previous ones. So with the 95--80 the final speed is actually 58% of the instead of 80.

I haven't tried that second option as I was using && by recommendation from Sircake but that didn't work. I'll try it with ! and see if I get any results.

Posted: Sun Jun 04, 2017 9:22 pm
by Graion Dilach
The multipliers support multiple trait instances.

Code: Select all

LST: 
->cargo:
->->LoadedCondition: Loaded
is what's missing from what I'd guess. The game doesn't know what the "Loaded" condition would be otherwise. If I'm correct that will fix the OP setup.

The other setup - condition expressions doesn't support commas, you need to use && for the and condition, so it should look like Loaded >= min && Loaded < max.

Posted: Mon Jun 05, 2017 4:16 am
by Blackened
Oops sorry I have LoadedCondition: Loaded just didn't transcribe that.

I've tried the min max but it doesn't work.

Posted: Mon Jun 05, 2017 6:09 am
by Blackened
trrrriiiippppllllleeeeeeeeeee post.

Re: Playing around with speedmultiplier

Posted: Mon Jun 05, 2017 6:28 am
by Blackened
Frame_Limiter wrote: You're not seeing any change in speed because there is no difference between speeds 113 and 107 (95%).
If you want to check this try creating a duplicate transport but with speed 107, you'll notice it's the same speed as the 113 transport.

Some LST speed windows:
[103-113]
[94-102]
[86-93]
[79-85]
[74-78]
[69-73]
This seems to be the root of the problem. I couldn't create a duplicate LST because the code refuses to cooperate (looking at you mysterious idle sequence)

I'd set the speed to 105 as the default was way too fast.
And so it would be:
105 (empty)
99.75(100 or 99)
94.5(95 or 94)
89.25(90)
84

As you said there is no difference between 100-94. I'll have to find another work around :(

Posted: Mon Jun 05, 2017 3:40 pm
by Frame_Limiter
105 is the same speed as 113 :) -- You need to set it to 102.

Your modifier needs to target a number within a different speed window or you'll simply end up with the same speed again.

113 - 10% = 101 (within the 94-102 range)
->SpeedMultiplier@L1:
-->Modifier: 90

To duplicate the transport:
LST.102:
->Inherits: LST
->RenderSprites:
-->Image: LST
->Buildable:
-->Description: LST-102
->Mobile:
-->Speed: 102
->Tooltip:
-->Name: Transport-102

Posted: Tue Jun 06, 2017 9:45 am
by Blackened
You're a saint if I haven't told you that yet.