Modifying rocket silo stats (items launched "count")
Posted: Sun Oct 28, 2018 5:51 am
Hi, I'm trying to access the count for each tracked items in rocket silo stats.
I tried various things:
1-
player.force.items_launched["orbital-ion-cannon"] = player.force.items_launched["orbital-ion-cannon"] - 1
2-
local count = player.force.items_launched["orbital-ion-cannon"] - 1 -- any number here, doesn't do anything at all
player.force.set_item_launched("orbital-ion-cannon", count)
any help would be great.
Edit: if I could call some function that initiates right after the rocket is launched, but before the event.on_rocket_launched (that still has access to the rocket entity. that would work too since i can change swap/remove the rocket item that was launched.... but that seems like a long shot
I tried various things:
1-
player.force.items_launched["orbital-ion-cannon"] = player.force.items_launched["orbital-ion-cannon"] - 1
2-
local count = player.force.items_launched["orbital-ion-cannon"] - 1 -- any number here, doesn't do anything at all
player.force.set_item_launched("orbital-ion-cannon", count)
any help would be great.
Edit: if I could call some function that initiates right after the rocket is launched, but before the event.on_rocket_launched (that still has access to the rocket entity. that would work too since i can change swap/remove the rocket item that was launched.... but that seems like a long shot