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
Modifying rocket silo stats (items launched "count")
-
- Long Handed Inserter
- Posts: 92
- Joined: Sun Jun 18, 2017 2:21 pm
- Contact:
Re: Modifying rocket silo stats (items launched "count")
You will need to tell the silo script to update after you change the tracked items, there is a remote.call for it
-
- Long Handed Inserter
- Posts: 92
- Joined: Sun Jun 18, 2017 2:21 pm
- Contact:
Re: Modifying rocket silo stats (items launched "count")
sry i don't thin i follow.
are you saying that the count is within the tracked items list?
i don't see any update call for rocket-silo script there, unless it was added after 16.30 (thats the version i'm running)
Re: Modifying rocket silo stats (items launched "count")
ah right, I thought there was a specific remote.call for updating the GUIrobertpaulson wrote: ↑Sun Oct 28, 2018 8:04 pmsry i don't thin i follow.
are you saying that the count is within the tracked items list?
i don't see any update call for rocket-silo script there, unless it was added after 16.30 (thats the version i'm running)
You can just do the remove_tracked_item remote call with `""` as the parameter, it should refresh the GUI.
-
- Long Handed Inserter
- Posts: 92
- Joined: Sun Jun 18, 2017 2:21 pm
- Contact: