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

[Proposal] Matching based on adjacent values/nodes #98

Open
blowfishpro opened this issue Feb 20, 2018 · 1 comment
Open

[Proposal] Matching based on adjacent values/nodes #98

blowfishpro opened this issue Feb 20, 2018 · 1 comment

Comments

@blowfishpro
Copy link
Collaborator

blowfishpro commented Feb 20, 2018

Sometimes it's useful to conditionally modify nodes/values based not on their contents but based on other values/nodes at the same level. You can accomplish the same thing with multiple patches now, but it leads to duplication of similar patches and requires more scans of the game database (i.e. slower). Proposal is to allow a :WITH block that checks nodes/values at the same level. For example:

@PART[SomePart_x1|SomePart_x2]:FOR[MyMod]
{
    @mass = 1.2
    @mass:WITH[#name[SomePartx2]] *= 2
}

It should ideally work on both nodes and values, but not be applicable to root nodes since there's nothing "adjacent" to check against

@sarbian
Copy link
Owner

sarbian commented Feb 20, 2018

Seems fine and the syntax is already there

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

No branches or pull requests

2 participants