Achievement events + per_game property, etc...

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Achievement events + per_game property, etc...

Post by aubergine18 »

Would it be possible to get:

* An `on_player_achievement` event, with `event.achievement = <achievement-name>` and `player_index = <number>` properties
* Achievement prototype properties `per_game = <boolean>` (default: `false`) and `hidden = <boolean>` (default: false)

If `per_game = true` then each time a new game is started the achievement is reset. If `hidden = true` the achievement doesn't appear to player, it's purely for event triggering & scripting.

I think this could open up quite a lot of potential for modders, because achievements will allow tracking and notification of certain things that would otherwise be very painful or gruesome for mods to implement themselves.

For example, a per-game 'build-entity-achievement' could be used as one-time trigger - mod no longer needs to worry about state, as game is already handling that internally. It would be very useful for tutorials and scenarios, progression of story, etc.

Imagine also if some new achievement types were added to take advantage of `per_game` property, for example a `discovery_achievement` where prototype specifies name and type of thing to be discovered. Now I can get one time events when player discovers a specific terrain (tile type), decoration, entity, enemy, etc... Script could then provide hits to player - for example, on first discovery of water player told that fish = food = restore health. To have a Lua script work out when the first time player encounters something will be slow and clunky; but I bet there's really fast way to do it in C.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Achievement events + per_game property, etc...

Post by aubergine18 »

`discovery_achievement` could be evaluated when chunks are generated to avoid lag
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Post Reply

Return to “Modding interface requests”