Page 1 of 1
on_player_fast_transferred Problem
Posted: Sun Jul 28, 2019 8:44 am
by Selmak-TokRa
Hello,
I have a problem with the event "on_player_fast_transferred".
Anywer on the Forum or redit (I can't remember) I have read, that this event triggers if the player transfer items with ctrl/shift from an inventory to another. Is this right?
In my code it does nothing.
Code: Select all
local function OnPlayerFastTransferred(event)
ConsoleOutput("fast transfer event")
end
script.on_event(defines.events.on_player_fast_transferred, OnPlayerFastTransferred)
Thanks for help
Re: on_player_fast_transferred Problem
Posted: Sun Jul 28, 2019 8:56 am
by mat1k
If i recall, ConsoleOutput() sends the text to the lua console used to start the game. If you start the game normally it goes nowhere.
Use game.print("fast transfer event") instead to print to the in-game chat.
Re: on_player_fast_transferred Problem
Posted: Sun Jul 28, 2019 10:07 am
by Selmak-TokRa
The ConsoleOutput() function print it to the in-game-console/chat.
To ignore my function, I have changed it in game.print("fast transfer event"). Result: nothing happend
Re: on_player_fast_transferred Problem
Posted: Sun Jul 28, 2019 10:35 am
by DaveMcW
It worked for me using game.print().
Your info.json or folder name may be broken, resulting in the mod doing nothing. Check %appdata%/factorio/factorio-current.log to see if the mod was loaded.
Re: on_player_fast_transferred Problem
Posted: Sun Jul 28, 2019 3:35 pm
by Selmak-TokRa
I got it. But it does not what I want.
I thought it triggers if both Inventories are open and the items were transfered over the GUI with ctrl/shift.
IMO is this also a fast transfer.
Re: on_player_fast_transferred Problem
Posted: Mon Jul 29, 2019 4:35 am
by Rseding91
Selmak-TokRa wrote: Sun Jul 28, 2019 3:35 pm
I got it. But it does not what I want.
I thought it triggers if both Inventories are open and the items were transfered over the GUI with ctrl/shift.
IMO is this also a fast transfer.
"fast transfer" is the name associated with ctrl + click to transfer an item to/from an entity when the GUI is not opened.
"Stack transfer" is the name used for all GUI versions of transferring items of which there are no events.
They are both just internal names we used for the logic which then got used for the lua event and key bindings.
Re: on_player_fast_transferred Problem
Posted: Mon Jul 29, 2019 2:40 pm
by Selmak-TokRa
ok thanks,
then i must look for an other way.
Re: on_player_fast_transferred Problem
Posted: Mon Jul 29, 2019 6:12 pm
by mat1k
Selmak-TokRa wrote: Mon Jul 29, 2019 2:40 pm
ok thanks,
then i must look for an other way.
If you tell us what your trying to achieve. Someone may already have code to do it they are willing to share