Hi folks,
I'm looking to add a smelting system to my game, and am not too sure what the best way is to do it.
I would like to have a system where you place an item into an event (using Select Item), then it runs for a while with a little animation, and when it is done, you can interact with it again to collect the items.
I was hoping there would be a plugin out there to do something like this, but I can't seem to find one.
My current plan, since my game has a time system, would be to:
- Select the item
- If it is suitable, change self switch to a new state with the smelting animation, and run a smelting common event via switch.
- The common event would record the starting time to a variable, then run as a parallel process checking every 120 frames or so to see if the current time is >= the (starting time + smelting duration for that item). If it is, it changes the smelter to a complete stage.
- When the player interacts with the smelter in the complete stage, it gives the proper smelted items based on what was put in, and then reverts to its initial state.
This system has a big problem though - I would need many duplicate common events for every possible smelter to do this, and I intend to allow the player to make many smelters. Each smelter would need its own separate parallel common event so that it can still update while on other maps, and it would need to know which common event is dedicated to it specifically (or which common event is free).
I can get around the redundant variables needed with a self-variable plugin, and I can re-use the switch that initiates the common event, but if the player can place 50 smelters, I need 50 separate parallel events, as I can't just keep re-running the same one, as far as I know.
Does anyone have any ideas for a way to implement this? Has anyone done it before?
If I intended to stay on the same map, I would just give the event a page with a parallel event, but I need it to keep updating while the player does other things and leaves the map.
All I need is to add item + fuel to an event, and have that event update its self-switch after X time has passed even while on other maps.
Thanks!
I'm looking to add a smelting system to my game, and am not too sure what the best way is to do it.
I would like to have a system where you place an item into an event (using Select Item), then it runs for a while with a little animation, and when it is done, you can interact with it again to collect the items.
I was hoping there would be a plugin out there to do something like this, but I can't seem to find one.
My current plan, since my game has a time system, would be to:
- Select the item
- If it is suitable, change self switch to a new state with the smelting animation, and run a smelting common event via switch.
- The common event would record the starting time to a variable, then run as a parallel process checking every 120 frames or so to see if the current time is >= the (starting time + smelting duration for that item). If it is, it changes the smelter to a complete stage.
- When the player interacts with the smelter in the complete stage, it gives the proper smelted items based on what was put in, and then reverts to its initial state.
This system has a big problem though - I would need many duplicate common events for every possible smelter to do this, and I intend to allow the player to make many smelters. Each smelter would need its own separate parallel common event so that it can still update while on other maps, and it would need to know which common event is dedicated to it specifically (or which common event is free).
I can get around the redundant variables needed with a self-variable plugin, and I can re-use the switch that initiates the common event, but if the player can place 50 smelters, I need 50 separate parallel events, as I can't just keep re-running the same one, as far as I know.
Does anyone have any ideas for a way to implement this? Has anyone done it before?
If I intended to stay on the same map, I would just give the event a page with a parallel event, but I need it to keep updating while the player does other things and leaves the map.
All I need is to add item + fuel to an event, and have that event update its self-switch after X time has passed even while on other maps.
Thanks!