Player level
Moderator: ickputzdirwech
Player level
Just an idea I got
What about having a system of player level (I mean, the ingame character).
You may gain XP with crafting, building, beating bitters, ...
And higher level you are, faster you can craft, more you can carry or more damage you do to bitters
What about having a system of player level (I mean, the ingame character).
You may gain XP with crafting, building, beating bitters, ...
And higher level you are, faster you can craft, more you can carry or more damage you do to bitters
Re: Player level
This levelling system is already implemented in the research tree.
You can already increase your armor and the damage you do using it. You can also increase the amount you can carry by researching toolbelt technology. With Bob's Mods, you can also directly increase your inventory space using research.
However, you can't increase your hand-crafting speed using research, only the factory crafting speed. But this is intentional, because the devs want to encourage you to automate and don't want to encourage hand-crafting.
You can already increase your armor and the damage you do using it. You can also increase the amount you can carry by researching toolbelt technology. With Bob's Mods, you can also directly increase your inventory space using research.
However, you can't increase your hand-crafting speed using research, only the factory crafting speed. But this is intentional, because the devs want to encourage you to automate and don't want to encourage hand-crafting.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Player level
The code for increasing hand crafting speed with research is there, I think...
if you want a personal level up system, it is possible for scripting to do that sort of thing... keep track of how many things you have hand crafted, increase your crafting bonus by X every X.
The problem with such mods is... it's not easy to write them in such a way to be friendly with other similar mods... you set the bonus to 5, how do you know a previous mod hadn't already set it to 10? what you really want to set is 15. You basically need a system where you can adjust the value relatively to account for what other mods do... I just haven't thought of the best way to do this yet.
if you want a personal level up system, it is possible for scripting to do that sort of thing... keep track of how many things you have hand crafted, increase your crafting bonus by X every X.
The problem with such mods is... it's not easy to write them in such a way to be friendly with other similar mods... you set the bonus to 5, how do you know a previous mod hadn't already set it to 10? what you really want to set is 15. You basically need a system where you can adjust the value relatively to account for what other mods do... I just haven't thought of the best way to do this yet.
Re: Player level
I guess it would be best if mod authors agreed to use a specific library mod that manages and keeps track of all skill bonuses and penalties. That way, all mods would only call functions in that library mod instead of changing the player's stats directly, and only the library mod would actually change the player's stats, taking the bonuses and penalties of all mods into account.bobingabout wrote:You basically need a system where you can adjust the value relatively to account for what other mods do... I just haven't thought of the best way to do this yet.
The main problem I see with that solution is that it would be hard to make mod authors agree on a specific library mod. Therefore, I think it would be best if Wube provided this interface directly in the game and added new features to this interface based on requests in the Modding Interface Requests sub-forum.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Player level
If there was some sort of library (function really) to change these values, so multiple mods can interface with them at the same time, I'd use it.
Basically, you just need a function where you give it your mod name(or other unique identifier for your access), and the value you would be setting, then it stores it under your name, and adds up all the names and sets the value. That way, as long as you use that function, you can't mess with what anyone else is doing.
the hard part is to get everyone to agree to use it.
Basically, you just need a function where you give it your mod name(or other unique identifier for your access), and the value you would be setting, then it stores it under your name, and adds up all the names and sets the value. That way, as long as you use that function, you can't mess with what anyone else is doing.
the hard part is to get everyone to agree to use it.
Re: Player level
Doesn't research already do this? As you build a better factory you get more research points to work with.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Player level
Except you're the only one with enough "community power" to make other peoples use your library, haha. At least i haven't seen a single library yet that is commonly used. And runtime libraries also suffer the challenge of being only accesible via remote.call() which is probably black magic to any sprouting modder. The main problem being that, even *if* there was a library for it, the library has no power to enforce itself and any badly written mod could easily break it for everyone. Unless you want to opt-in to use on_tick to fix the value every tick :). And there's also no clean way to undo the changes when the user removed the library.bobingabout wrote:If there was some sort of library (function really) to change these values, so multiple mods can interface with them at the same time, I'd use it.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Player level
If you raise stats via technology, then yes, that is automatically sorted, but you also have the abillity to modify the same stats per entity.bobucles wrote:Doesn't research already do this? As you build a better factory you get more research points to work with.
List starts here: https://lua-api.factorio.com/0.16.51/Lu ... d_modifier
So, if you want per force, do technology. if you want per player/entity, you use the lua.Control interface. This can be set on the Player (Which if I understand correctly, applies to the player, and when you change their character, say, on death, it persists to the new one) or per entity (change it directly on the character entity, and doesn't persist to others. I use this on my builder class to increase crafting speed, the issue is if someone else edits this value, you lose the entity specific scripted bonus).
And it's this per player/entity where you're literally just setting the value, rather than adding to a bonus, which can cause issues.
this can be partly solved if you just increment it each time (value = value + amount), but if you hard set a value (value = newamount) then if someone else edited it previous, it causes issues.
This could be present if you're implementing some kind of skill point spending system, and allow the player to apply, and redistribute those points, a "Respec" for example, you might want to reset it to 0... but what if someone else is doing something already and it's not actually 0 you want to reset it to (Like my builder class). You only want to zero your own addition to the stat, and that's where a function that does all this for you should come into play.
so to go back to the original request, monitor how much manual mining/crafting the player does and increase that bonus occasionally. This would want to be a per player basis, and as pointed out, would likely not be compatible with anything anyone else does unless you take into account that the number might not be whatever you've set it to (or increased it by).
Re: Player level
I think this mod can satisfy your requests:
https://mods.factorio.com/mod/RPGsystem
https://mods.factorio.com/mod/RPGsystem
Re: Player level
There's no way to detect the player's crafting speed? You can't do something like player.crafting_speed = player.crafting_speed + 5? (and yes I know those are the wrong names)
There are 10 types of people: those who get this joke and those who don't.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Player level
That will work, yes. That's pretty much the only safe way for you to do it, and works fine if you're incrementing, however...Jap2.0 wrote:There's no way to detect the player's crafting speed? You can't do something like player.crafting_speed = player.crafting_speed + 5? (and yes I know those are the wrong names)
what if you're using another mod that didn't do that? it resets your changes to zero when it updates the numbers. and while that is beyond control of your own mod, the other mod isn't really doing anything wrong either... at least as so far in that there's no rules against doing it, you just know that they'll break other mod compatibility if they do.