Equation to convert value

Place to get help with not working mods / modding interface.
User avatar
yaim904
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Nov 17, 2021 11:26 pm
Contact:

Equation to convert value

Post by yaim904 »

How to convert the value of the effect in the corresponding time??

Code: Select all

[ 'construction-robotics' ] = {
	[ 'type' ] = 'technology',
	[ 'name' ] = 'construction-robotics',
	[ 'icon_size' ] = 256,
	[ 'icon_mipmaps' ] = 4,
	[ 'icon' ] = '__base__/graphics/technology/construction-robotics.png',
	[ 'effects' ] = {
		[ 5 ] = {
			[ 'type' ] = 'ghost-time-to-live',
			[ 'modifier' ] = 36288000,
		},
	},
	[ 'prerequisites' ] = {
		[ 1 ] = 'robotics',
	},
	[ 'unit' ] = {
		[ 'count' ] = 100,
		[ 'ingredients' ] = {
			[ 1 ] = {
				[ 1 ] = 'automation-science-pack',
				[ 2 ] = 1,
			},
			[ 2 ] = {
				[ 1 ] = 'logistic-science-pack',
				[ 2 ] = 1,
			},
			[ 3 ] = {
				[ 1 ] = 'chemical-science-pack',
				[ 2 ] = 1,
			},
		},
		[ 'time' ] = 30,
	},
	[ 'order' ] = 'c-k-a',
},
The time in the prototype is

Code: Select all

[ 5 ] = {
	[ 'type' ] = 'ghost-time-to-live',
	[ 'modifier' ] = 36288000,
},
But in the game the value is 168h
The question is: What equation is used to calculate this time?
Solo entiendo español, pero si tu también lo entiendes, escríbeme
:D
Everything i write in English is translated by google.
:D
coderpatsy
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Tue Apr 17, 2018 11:45 pm
Contact:

Re: Equation to convert value

Post by coderpatsy »

60 updates per second * 60 seconds per minute * 60 minutes per hour * 168 hours = 36288000
User avatar
yaim904
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Nov 17, 2021 11:26 pm
Contact:

Re: Equation to convert value

Post by yaim904 »

coderpatsy wrote: Sun Apr 24, 2022 3:16 am
your calculations are wrong

Code: Select all

36288000 / ( 60 ^ 3 ) = 216000
Solo entiendo español, pero si tu también lo entiendes, escríbeme
:D
Everything i write in English is translated by google.
:D
mmmPI
Smart Inserter
Smart Inserter
Posts: 3640
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Equation to convert value

Post by mmmPI »

yaim904 wrote: Sun Apr 24, 2022 2:43 am
The time in the prototype is
[ 'modifier' ] = 36288000,
But in the game the value is 168h
The question is: What equation is used to calculate this time?
(36288000/60)/3600=168

60 tick in 1 second, 3600 second in 1 hour

tick = game update
60 ups = 60 tick per second.
User avatar
yaim904
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Nov 17, 2021 11:26 pm
Contact:

Re: Equation to convert value

Post by yaim904 »

Now I understand
Thank you very much
Solo entiendo español, pero si tu también lo entiendes, escríbeme
:D
Everything i write in English is translated by google.
:D
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Equation to convert value

Post by FuryoftheStars »

yaim904 wrote: Sun Apr 24, 2022 8:57 am
coderpatsy wrote: Sun Apr 24, 2022 3:16 am
your calculations are wrong

Code: Select all

36288000 / ( 60 ^ 3 ) = 216000
You might want to run that through a calculator again. 36288000 / ( 60 ^ 3 ) is 168.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
User avatar
yaim904
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Nov 17, 2021 11:26 pm
Contact:

Re: Equation to convert value

Post by yaim904 »

FuryoftheStars wrote: Sun Apr 24, 2022 1:12 pm
I think you should check your calculation

Code: Select all

36288000 / ( 60 ^ 3 ) = 216000

But, this equation is fine.
mmmPI wrote: Sun Apr 24, 2022 9:17 am (36288000/60)/3600=168
Use a calculator and you will see who is right, after all it is mathematics.
Image
Solo entiendo español, pero si tu también lo entiendes, escríbeme
:D
Everything i write in English is translated by google.
:D
SoShootMe
Filter Inserter
Filter Inserter
Posts: 517
Joined: Mon Aug 03, 2020 4:16 pm
Contact:

Re: Equation to convert value

Post by SoShootMe »

yaim904 wrote: Sun Apr 24, 2022 5:36 pm I think you should check your calculation

Code: Select all

36288000 / ( 60 ^ 3 ) = 216000
You are seeing the result of the intermediate calculation (60^3 is 216000). Pressing "=" will show 168, or you need a better calculator.
pleegwat
Filter Inserter
Filter Inserter
Posts: 278
Joined: Fri May 19, 2017 7:31 pm
Contact:

Re: Equation to convert value

Post by pleegwat »

yaim904 wrote: Sun Apr 24, 2022 8:57 am
coderpatsy wrote: Sun Apr 24, 2022 3:16 am
your calculations are wrong

Code: Select all

36288000 / ( 60 ^ 3 ) = 216000
The meaning of the ^ operator varies from platform to platform. Yours applies xor; you just calculated 36288000/63.
User avatar
yaim904
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Nov 17, 2021 11:26 pm
Contact:

Re: Equation to convert value

Post by yaim904 »

SoShootMe wrote: Sun Apr 24, 2022 6:03 pm You are seeing the result of the intermediate calculation
you're right
I was seeing an intermediate value.
Solo entiendo español, pero si tu también lo entiendes, escríbeme
:D
Everything i write in English is translated by google.
:D
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Equation to convert value

Post by FuryoftheStars »

yaim904 wrote: Sun Apr 24, 2022 5:36 pm
FuryoftheStars wrote: Sun Apr 24, 2022 1:12 pm
I think you should check your calculation

Code: Select all

36288000 / ( 60 ^ 3 ) = 216000

But, this equation is fine.
mmmPI wrote: Sun Apr 24, 2022 9:17 am (36288000/60)/3600=168
Use a calculator and you will see who is right, after all it is mathematics.
Image
????
Calculator.png
Calculator.png (84.63 KiB) Viewed 2432 times

Edit: Ah, someone else pointed it out to you. K.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Post Reply

Return to “Modding help”