on_player_fast_transferred Problem

Place to get help with not working mods / modding interface.
Selmak-TokRa
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Feb 18, 2017 9:52 pm
Contact:

on_player_fast_transferred Problem

Post 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
User avatar
mat1k
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat Dec 22, 2018 8:48 am
Contact:

Re: on_player_fast_transferred Problem

Post 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.
Selmak-TokRa
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Feb 18, 2017 9:52 pm
Contact:

Re: on_player_fast_transferred Problem

Post 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
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: on_player_fast_transferred Problem

Post 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.
Selmak-TokRa
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Feb 18, 2017 9:52 pm
Contact:

Re: on_player_fast_transferred Problem

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15997
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_player_fast_transferred Problem

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Selmak-TokRa
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Feb 18, 2017 9:52 pm
Contact:

Re: on_player_fast_transferred Problem

Post by Selmak-TokRa »

ok thanks,
then i must look for an other way.
User avatar
mat1k
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat Dec 22, 2018 8:48 am
Contact:

Re: on_player_fast_transferred Problem

Post 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
Post Reply

Return to “Modding help”