Searching For References

Place to get help with not working mods / modding interface.
Post Reply
Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Searching For References

Post by Suf »

Hi all
I've been searching for references regarding adding a new type to the game;example: type = "mining-tool",but it seems there's no references for adding such thing or how to even do it.So if that's possible to do any reference or link of how to make a custom type that would be fantastic.
Second thing i was searching for of how to make a custom module effect for example:effect = { speed = {bonus = 0.5}<<<what i'm trying to do is create a new one that is not in vanilla,but again i couldn't find references of how to create a custom effect.So if that's is also possible to make any reference or link would helps in making such a custom effect would be appreciated.
Thanks in advance.

robot256
Filter Inserter
Filter Inserter
Posts: 598
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Searching For References

Post by robot256 »

There is no such thing as a custom type in Factorio--it makes modding much simpler in the long run. There are many creative ways to reuse, repurpose, and combine existing types and use scripts to do new things.

For example, the Aircraft Realism mod uses type "car" with different collision masks and swaps the entities via script to simulate takeoff and landing.

Module mods add new combinations of the speed, productivity, and efficiency effects. Custom effects would have to be performed by your scripts based on the presence of your modules.

Your mod could use scripts to alter character modifiers in realtime (walking or mining speed) based on whatever criteria you choose, including the presence of dummy items that "cause" the effect. By default, mining speed is only altered by technology research.

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Searching For References

Post by Suf »

robot256 wrote:
Sun Sep 06, 2020 3:39 pm
There is no such thing as a custom type in Factorio--it makes modding much simpler in the long run. There are many creative ways to reuse, repurpose, and combine existing types and use scripts to do new things.

For example, the Aircraft Realism mod uses type "car" with different collision masks and swaps the entities via script to simulate takeoff and landing.

Module mods add new combinations of the speed, productivity, and efficiency effects. Custom effects would have to be performed by your scripts based on the presence of your modules.

Your mod could use scripts to alter character modifiers in realtime (walking or mining speed) based on whatever criteria you choose, including the presence of dummy items that "cause" the effect. By default, mining speed is only altered by technology research.
Thanks for the information,but where can i find the "speed"script or any of other effects modules so i can use it as a reference to make my own custom effect? or it seems i can just use the API page and its sub pages as reference to do just that?

sparr
Smart Inserter
Smart Inserter
Posts: 1330
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Searching For References

Post by sparr »

The three existing modules are not run by scripts. Their effects are applied by the game engine.

For a custom type the basic approach would be to create a new module with none of the standard bonuses, then in your mod you would check for the presence of the module and change the behavior of the entity the module is in.

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Searching For References

Post by Suf »

sparr wrote:
Sun Sep 06, 2020 4:49 pm
The three existing modules are not run by scripts. Their effects are applied by the game engine.

For a custom type the basic approach would be to create a new module with none of the standard bonuses, then in your mod you would check for the presence of the module and change the behavior of the entity the module is in.
Thanks for elaborating on how those effects are made,now i have better understanding on how modules work from scripting perspective :)

Post Reply

Return to “Modding help”