Page 1 of 1
create_entity{... amount=float} sets amount to 50
Posted: Mon Jan 30, 2017 6:46 pm
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.
Re: create_entity{... amount=float} sets amount to 50
Posted: Mon Jan 30, 2017 6:48 pm
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.
Re: create_entity{... amount=float} sets amount to 50
Posted: Mon Jan 30, 2017 7:10 pm
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.