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

Custom Entity System #317

Closed
UltimaOath opened this issue Oct 30, 2021 · 7 comments
Closed

Custom Entity System #317

UltimaOath opened this issue Oct 30, 2021 · 7 comments
Labels
priority: normal Normal priority status: confirmed Confirmed by a maintainer type: improvement Add or adjust a feature

Comments

@UltimaOath
Copy link
Collaborator

UltimaOath commented Oct 30, 2021

Was working on this behind the scenes for LM4, but might as well drop it here for whomever wants the mantle. It was my attempt at a Custom Entity making tool, prob. for it's own file customentities.yml or similar.
I wanted to find a way that we could make some baby steps into the custom entity field, and help reduce our dependency on 3rd party plugins which require more solution chasing than they're worth in my opinion. I believe this might be some of the first baby steps if possible:

Essentially when an entity of the entitytype spawns, should all checks say this should be a custom entity, we would override the default attributes of that entity, apply it's unique name, and level it under whatever rules it would have levelled under otherwise, again unless the custom-entity condition is checked and that custom entity would get it's own multipliers.

# Any entity can be customized, even if otherwise
# LM would not level them (custom passive values, etc.)

custom-entities:
# Any attribute not listed will assume the EntityType's default value.

  custom_AlphaZombie:
    entity_type: ZOMBIE
    entity_name: 'Alpha Zombie'
    base_attributes: #These settings set the value of the default base attributes for the custom entity.
      max-health: 30-35
      movement-speed: 0.25-0.26
      attack-damage: 5.0-5.5
      armor-bonus: 2.0-3.0
      armor-toughness: 0-1.0
      zombie-spawn-reinforcements: 0.25
    use-droptable-id: dropTable #establishes additional drops to this CustomEntity separate from any other setting; does not override default

  custom_BetaZombie:
    entity_type: ZOMBIE
    entity_name: 'Beta Zombie'
    base_attributes:
      max-health: 100
      movement-speed: 0.10
      attack-damage: 10
      armor-bonus: 5
      armor-toughness: 5
      zombie-spawn-reinforcements: 1.0


# This is how it would be implemented through the rules system. Since the entitytype is listed for each custom entity, the `conditions:` check for entities should not be required. We can however make limitations such as biomes, time of day, etc. This would allow for a varied array of entities that have different skillsets.
  alpha-zombie-rule:
    enabled: true
    description: 'CustomEntity - AlphaZombie'
    conditions:
      chance: 0.5
    apply-settings:
      use-custom-entity: ['custom_AlphaZombie']

# I believe we could also include a condition check to determine if the entity was one of the custom entities, and then apply different multipliers to those entities should we need to.
conditions:
  custom-entities: ['custom_BetaZombie']
apply-settings:
  multipliers:
    etc:
@UltimaOath

This comment has been minimized.

@lokka30 lokka30 added priority: unknown Needs triage status: on hold Other things need to be resolved before progress can continue status: unassigned target version Needs a future version assigned to it status: unconfirmed Needs confirmation status: waiting for approval Waiting for approval from maintainers labels Jan 9, 2022
@UltimaOath

This comment was marked as outdated.

@lokka30 lokka30 added status: confirmed Confirmed by a maintainer and removed status: unconfirmed Needs confirmation status: unassigned target version Needs a future version assigned to it status: on hold Other things need to be resolved before progress can continue priority: unknown Needs triage status: waiting for approval Waiting for approval from maintainers labels Jan 18, 2022
@lokka30 lokka30 added the priority: normal Normal priority label Jan 18, 2022
@lokka30

This comment was marked as outdated.

@lokka30 lokka30 closed this as completed Jan 18, 2022
@lokka30 lokka30 changed the title Soft CustomEntity Reconstruction System Custom Entity System Nov 6, 2022
@lokka30
Copy link
Member

lokka30 commented Nov 6, 2022

@UltimaOath @stumper66

LM4 Entity Templates

About

This system allows admins to configure a named template of stats a mob will receive upon application of that template.
Essentially, the Entity Template System allows admins to spawn in 'custom entities'.

Note that the current implementation idea described below does not add any new features, it just utilises the capabilities of the Functions system. The idea of the Entity Templates system was conceptualised by Oath, naming it the "Soft CustomEntity Reconstruction System", in the LM3 era. This idea takes a different approach to Oath's original idea, as LM4 has added an additional layer of logic – functions – to LM3's Rules system. Therefore, it accomodates the entity templates without it requiring a special section.

Configuration

settings.yml
functions:
  - function: "alpha-zombie-template"
    processes:
      - process: "apply-template"
        do:
          - action: "set-buffs"
            use-presets: [ "extreme-challenge" ]
          - action: "set-packet-label"
            formula: "&fLvl. %entity-level% &c&lAlpha Zombie"
            visibility-methods: ["TARGETED", "ATTACKED", "MELEE"]
            visibility-duration: 10s
          - action: "set-death-label"
            formula: "&fLvl. %entity-level% &c&lAlpha Zombie"

Usage

Via /lm summon

The structure of the summon sub-command, as of writing, is unknown. Therefore, a guaranteed syntax cannot be provided.

However, the summon sub-command should allow a list of functions to be called upon the summoning of the mob.

Via an LmFunction

Simply call the template function:

- action: "run-function"
  id: "alpha-zombie-template"

The mob in the context of that function call will then receive the template's stats.

@lokka30 lokka30 reopened this Nov 6, 2022
@lokka30
Copy link
Member

lokka30 commented Nov 6, 2022

Closing this unless Oath is not satisfied :)

@lokka30 lokka30 closed this as completed Nov 6, 2022
@UltimaOath
Copy link
Collaborator Author

UltimaOath commented Feb 21, 2023

Now four months later the only thing I have to add would be to include a mechanism which allows the base-attribute itself to also be modified prior to any multipliers being applied. For example:

functions:
  - function: "alpha-zombie-template"
    processes:
      - process: "apply-template"
        do:
        # Do this:
          - action: "set-base"
              bases:
                - base: "max-health"
                  base-formula: "5"
          # or this:
          - action: "set-base"
            use-presets: [ "glass-cannon" ]
            
          - action: "set-buffs"
            use-presets: [ "extreme-challenge" ]
          - action: "set-packet-label"
            formula: "&fLvl. %entity-level% &c&lAlpha Zombie"
            visibility-methods: ["TARGETED", "ATTACKED", "MELEE"]
            visibility-duration: 10s
          - action: "set-death-label"
            formula: "&fLvl. %entity-level% &c&lAlpha Zombie"
            
            
            
  - preset: 'glass-cannon'
    bases:
      - base: 'health'
        enabled: true
        types:
          in-list: ['MAX_HEALTH']
        base-formula: '5'

      - base: 'attack-damage'
        enabled: true
        types:
          in-list: ['ATTACK_DAMAGE']
        base-formula: '5 + (%entity-level-ratio%)'

@lokka30
Copy link
Member

lokka30 commented Feb 21, 2023

Now four months later the only thing I have to add would be to include a mechanism which allows the base-attribute itself to also be modified prior to any multipliers being applied. For example:

This would be separate to the custom entity system - simply achieved via something along the lines of a set-attributes-base action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: normal Normal priority status: confirmed Confirmed by a maintainer type: improvement Add or adjust a feature
Projects
None yet
Development

No branches or pull requests

2 participants