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.
Searching For References
Re: Searching For References
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.
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.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: Searching For References
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?robot256 wrote: ↑Sun Sep 06, 2020 3:39 pmThere 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.
Re: Searching For References
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.
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.
Re: Searching For References
Thanks for elaborating on how those effects are made,now i have better understanding on how modules work from scripting perspectivesparr wrote: ↑Sun Sep 06, 2020 4:49 pmThe 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.