on_player_placed_wire / on_player_put_item_in_chest
Posted: Sat Jun 23, 2018 3:21 am
I would like to request an event:
on_player_placed_wire
contains:
player :: the player that placed the wire
wire :: the type of wire placed
end_point_1 :: one of the entities connected by the wire
end_point_2 :: the other entity connected by the wire
circuit_network :: the circuit network this wire connects to (not sure if this is even a thing that is recorded, just putting it here for completeness sake)
I intend to use this to make it so that whenever a wire is placed, I get a new wire of the same type for free put into my hand, effectively making wires free beyond the initial crafting cost, I also intend to increase the crafting cost as some self-imposed balance. I'm just fixing the fact that I am annnoyed by the fact that simply experimenting with circuit networks deletes resources from the world and that I can run out of wire while experimenting, forcing me to go get more. tiny amounts, sure, but enough to trigger mini-OCD.
I would only really need the event itself, the player that placed it and to know what type of wire it is, the endpoint/circuit network data just seems like highly related information that others might be interested in using.
I cannot do this with the currently available tools as literally the only event that triggers when placing wires is on_player_cursor_stack_changed, however, it is as far as I can tell impossible to distinguish between:
1. losing an item from your cursor stack because you used it to connect 2 entities with a wire.
2. losing an item from your cursor stack because you put 1 wire into a chest.
both of these actions will only trigger exactly 1 event (on_player_cursor_stack_changed) and your cursor changes the same way for both actions (stack amount -1), therefore rendering these actions indistinguishable.
arguably, it might also be sensible to have the event:
on_player_put_item_in_chest
contains:
player :: the player that put the item in the chest
item :: the item put in the chest
chest :: the chest the item was put into
I don't need it, but someone else might.
on_player_placed_wire
contains:
player :: the player that placed the wire
wire :: the type of wire placed
end_point_1 :: one of the entities connected by the wire
end_point_2 :: the other entity connected by the wire
circuit_network :: the circuit network this wire connects to (not sure if this is even a thing that is recorded, just putting it here for completeness sake)
I intend to use this to make it so that whenever a wire is placed, I get a new wire of the same type for free put into my hand, effectively making wires free beyond the initial crafting cost, I also intend to increase the crafting cost as some self-imposed balance. I'm just fixing the fact that I am annnoyed by the fact that simply experimenting with circuit networks deletes resources from the world and that I can run out of wire while experimenting, forcing me to go get more. tiny amounts, sure, but enough to trigger mini-OCD.
I would only really need the event itself, the player that placed it and to know what type of wire it is, the endpoint/circuit network data just seems like highly related information that others might be interested in using.
I cannot do this with the currently available tools as literally the only event that triggers when placing wires is on_player_cursor_stack_changed, however, it is as far as I can tell impossible to distinguish between:
1. losing an item from your cursor stack because you used it to connect 2 entities with a wire.
2. losing an item from your cursor stack because you put 1 wire into a chest.
both of these actions will only trigger exactly 1 event (on_player_cursor_stack_changed) and your cursor changes the same way for both actions (stack amount -1), therefore rendering these actions indistinguishable.
arguably, it might also be sensible to have the event:
on_player_put_item_in_chest
contains:
player :: the player that put the item in the chest
item :: the item put in the chest
chest :: the chest the item was put into
I don't need it, but someone else might.