create_entity{... amount=float} sets amount to 50

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

create_entity{... amount=float} sets amount to 50

Post by Mylon »

See the last console command and the resource amount:
http://i.imgur.com/NJXslrv.png

I can do "game.player.selected.amount=100.5" just fine and I get a more reasonable rounded value, but passing any non-int value via create_entity() yields 50.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: create_entity{... amount=float} sets amount to 50

Post by orzelek »

Mylon wrote:See the last console command and the resource amount:
http://i.imgur.com/NJXslrv.png

I can do "game.player.selected.amount=100.5" just fine and I get a more reasonable rounded value, but passing any non-int value via create_entity() yields 50.
You'll need to round those by yourself.
From quite some time RSO has floor on any amounts passed to API - using anything floating point there ended up at same value.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13220
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: create_entity{... amount=float} sets amount to 50

Post by Rseding91 »

Resource entities don't support non-int values for amount as they store "amount" as an unsigned 32 bit number.

Anyway, it works as you're asking for 0.15 because of unrelated changes.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”