Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent entity rules #24

Open
SuperNeon4ik opened this issue Oct 13, 2024 · 3 comments
Open

Persistent entity rules #24

SuperNeon4ik opened this issue Oct 13, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@SuperNeon4ik
Copy link
Owner

SuperNeon4ik commented Oct 13, 2024

I would guess most qibs and entity rules are set up once and never changed, so a way to make them persist between reloads and restarts would be a very useful feature.

My ideas are:

  • Make a tag (ex.: noxutils.alwayspersist) that would always save the entity rules for the given entity.
  • Make a tag (ex.: noxutils.nopersist) that would always forget about the entity rules of the given entity on restart.
  • Make a persistentEntityRules config option that would work like giving the always persist tag to all entities (ignoring the no persist entities ofc)
  • Make a command (ex.: /noxesiumutils entityRules saveRules [entity]) which would same the current entity rules of an entity and even if they change, the next reload will apply the rules to the saved state.

This is currently just a mishmash of ideas and I have no clear logic yet. Any suggestions are appreciated!

@SuperNeon4ik SuperNeon4ik added the enhancement New feature or request label Oct 13, 2024
@SuperNeon4ik SuperNeon4ik self-assigned this Oct 13, 2024
@BlockybombDEV
Copy link
Contributor

Don't think there is a reason for a non persistent tag since the rules get forgotten anyways. Especially if there is an option to just ignore all of them

Might be bad for servers using a large amount of entities with rules, but you could have a file with an entity's uuid/world+id storing their entity rules.
Example:

{"persistentEntities":{
    "UUID": "f81d4fae-7dec-11d0-a765-00a0c91e6bf6",
    "World": "world",
    "Rules": {
        "QIB_BEHAVIOUR": "Boost",
        "QIB_WIDTH_Z": 2
    }
}}

@SuperNeon4ik
Copy link
Owner Author

Don't think there is a reason for a non persistent tag since the rules get forgotten anyways. Especially if there is an option to just ignore all of them

The non persistent tag is only going to be used when persistentEntityRules is true in the config. At least that was the idea in this case. Also what do you mean by "an option to ignore all of them"?

Might be bad for servers using a large amount of entities with rules, but you could have a file with an entity's uuid/world+id storing their entity rules.

This should theoretically be fine i think. I do agree that it should be saved in a readable file, that would make debugging easier, though I would want some other interface made with commands or tags for example, so it's not necessary to open the save-file each time you want to edit the rules.

Do you by any chance have an idea of how you see the persistence done?

@BlockybombDEV
Copy link
Contributor

The non persistent tag is only going to be used when persistentEntityRules is true in the config. At least that was the idea in this case. Also what do you mean by "an option to ignore all of them"?

I've probably interpreted it wrong when you said "ignoring the no persist entities ofc", you probably mean not giving their rules back if they have the tag.

This should theoretically be fine i think. I do agree that it should be saved in a readable file, that would make debugging easier, though I would want some other interface made with commands or tags for example, so it's not necessary to open the save-file each time you want to edit the rules.

You could have a command to set and check the saved rules for an entity. The way I currently do it, I just add a tag to the entity with the rule they're supposed to have like jumpPad which comes with a downside of going through all interaction entities. Don't think it's much of a downside if this happens on server start though unless it can't get to entities that haven't been loaded (has not been a problem for me yet)

I'm not an expert btw just thinking about things that could happen or cause issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants