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

(Specials Parser)Allow Tag Field #4866

Open
MichaelCourtney opened this issue Feb 7, 2024 · 2 comments
Open

(Specials Parser)Allow Tag Field #4866

MichaelCourtney opened this issue Feb 7, 2024 · 2 comments
Labels
category:feature The Issue/PR describes or implements a new game feature. component:content scripting The Issue/PR deals with the FOCS language, turn events or the universe generator. component:game mechanic The Issue/PR deals with the currently used or planned game mechanics.

Comments

@MichaelCourtney
Copy link
Contributor

Feature request

Idea

Allow a tags field on specials

Gain

Provide easy reference to a group of specials in the locations field. In particular I'd like to be able to reference a group of specials in monster_fleets.inf as this would allow the guards placed in scripting to be automatically placed by the normal monster placement function during universe generation.

@MichaelCourtney MichaelCourtney added the category:feature The Issue/PR describes or implements a new game feature. label Feb 7, 2024
@geoffthemedio
Copy link
Member

reference a group of specials in monster_fleets.inf

Could you write an example script you want to write and explain what it should do?

@geoffthemedio geoffthemedio added component:content scripting The Issue/PR deals with the FOCS language, turn events or the universe generator. component:game mechanic The Issue/PR deals with the currently used or planned game mechanics. labels Feb 8, 2024
@MichaelCourtney
Copy link
Contributor Author

MichaelCourtney commented Feb 8, 2024

reference a group of specials in monster_fleets.inf

Could you write an example script you want to write and explain what it should do?

Sure. Something along the lines of:

MonsterFleet
    name = "SM_GUARD_1"
    ships = [
        "SM_GUARD_1"
    ]
    spawnrate = 6
    spawnlimit = 9999
    location = And [
        Not Contains Monster
        HasTag name = Guard_1
        Not WithinStarlaneJumps jumps = max(2, (NamedIntegerLookup name = "MIN_MONSTER_DISTANCE")) condition = Contains And [
            Planet
            OwnedBy affiliation = AnyEmpire
        ]
    ]

with the eligible specials having the tag Guard_1. Currently you have to list every special like this:
https://github.com/freeorion/freeorion/blob/master/default/scripting/monster_fleets.inf#L193-L197

What it would do, is the same as this:
https://github.com/freeorion/freeorion/blob/master/default/scripting/specials/planet/monster_guard.macros#L15-L26

except it would occur during universe_generation, be logged during universe_generation and be affected by galaxy monster frequency settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:feature The Issue/PR describes or implements a new game feature. component:content scripting The Issue/PR deals with the FOCS language, turn events or the universe generator. component:game mechanic The Issue/PR deals with the currently used or planned game mechanics.
Projects
None yet
Development

No branches or pull requests

2 participants