I'm making a mod that "gifts" the player with additional starting items. That part I think I've got a handle on.
I presume this effect happens any time a given character is first created in the game, e.g. Peter34 or Robert_the_XI or whatever. I'd like the mod to also send a series of short messages to the player when his character is first created, briefly explaining the items. If I just print to console using function print_all(text) then it'll be alot of spam seen by everyone.
What command do I use to do have the mod "talk" privately to each player? And is there some way I can delay the effect? Either just each of the 5 messages, or else have a combined delay so that the first item is gifted after 20 seconds accompanied by the text, then 20 seconds after that the 2nd item is gifted, and so forth.
Can I have the mod send a private message to player?
Re: Can I have the mod send a private message to player?
Hi,
Have you tried player.print (http://lua-api.factorio.com/latest/LuaP ... ayer.print)?
In the on plaer created event you get the actual player. The print method should just affect this one.
What kind ofmod are sou trying to create? I'm still looking for interested devs to join my modding team (currently only me)
Have you tried player.print (http://lua-api.factorio.com/latest/LuaP ... ayer.print)?
In the on plaer created event you get the actual player. The print method should just affect this one.
What kind ofmod are sou trying to create? I'm still looking for interested devs to join my modding team (currently only me)
Re: Can I have the mod send a private message to player?
Thanks, I'll try that!mojo2012 wrote:Hi,
Have you tried player.print (http://lua-api.factorio.com/latest/LuaP ... ayer.print)?
In the on plaer created event you get the actual player. The print method should just affect this one.
This mod is just one that gifts exactly 34 extra items to the players, to make the game start a bit easier and faster, and to demo some new items from two other mods (the Flare Capsules and even more so the Agent Orange Capsules, both by Ranakastrasz).mojo2012 wrote:What kind ofmod are sou trying to create? I'm still looking for interested devs to join my modding team (currently only me)
1 extra Burner Mining Drill
10 Raw Wood
1 Solid Fuel
16 Agent Orange Capsule
6 Flare Capsule
I think the gifting itelf is going to work fine, because I'm "cribbin'" from another mod which I know works. But I'd like the mod to be more user-friendly, and if possible I'd like a delay effect, so that the player is given the 5 gifts in order, with a delay of 10 or 15 or 20s between each, depending on what my testing suggests is best.
So it's really a very, very simple mod, and the reason I'm asking for help is that I am very new to modding Factorio (or indeed modding computer games in general).
Re: Can I have the mod send a private message to player?
If sou need more help, just drop me a Pm. I know hard it is to get into it ... I just recently started
- Ranakastrasz
- Smart Inserter
- Posts: 2167
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Can I have the mod send a private message to player?
Code: Select all
function globalPrint(msg)
local players = game.players
for x=1, #players do
game.players[x].print(msg)
end
end
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16