[engine] Add filters for attack_ and defense_weight
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
Re: [engine] Add filters for attack_ and defense_weight
It doesn't seem to work.
Whatever the formula, the number of attacks is always 0. At first I was experimenting with attributes of the self variable - do note that there was never a crash or a warning of trying to access non-existent stuff, but the number of attacks was always 0.
Then I tried this trivial stuff as in the attachment in the spoiler, and still 0. Regardless of extra ""-s or ()-s.
(This is on 1.14.5 on Debian)
I mean, it's suitable for my case - to help the AI choose weapons enhanced with custom weapon specials:
The macro of the special could consist of the tag(s) that's doing the actual effects, and next to it a tag, an enhanced disable then?... to modify the attack_weight and defense_weight if different filters match.
There is still the question of multiple matches then, but I think that's solved with the specials? I mean for example I can already put in as many non-cumulative
In conclusion yes, if there was a specials tag that could modify weighting and had access to filters, that would also be a satisfactory solution.
Whatever the formula, the number of attacks is always 0. At first I was experimenting with attributes of the self variable - do note that there was never a crash or a warning of trying to access non-existent stuff, but the number of attacks was always 0.
Then I tried this trivial stuff as in the attachment in the spoiler, and still 0. Regardless of extra ""-s or ()-s.
(This is on 1.14.5 on Debian)
example:
I guess so. Provided that the specials tag has access toCeltic_Minstrel wrote: ↑February 21st, 2019, 2:02 pm So anyway, what you're saying is that if the weighting could be accessed through specials, then you wouldn't need this feature?
[filter_opponent]
and [filter_self]
. I mean, it's suitable for my case - to help the AI choose weapons enhanced with custom weapon specials:
The macro of the special could consist of the tag(s) that's doing the actual effects, and next to it a tag, an enhanced disable then?... to modify the attack_weight and defense_weight if different filters match.
There is still the question of multiple matches then, but I think that's solved with the specials? I mean for example I can already put in as many non-cumulative
[damage]
's as I want, and have half of them match at the same time. I think the first match is applied and the rest is ignored? Or the other way around, the last is on and the others are ignored, I'm not sure now, but the point is that there's a fixed approach. In conclusion yes, if there was a specials tag that could modify weighting and had access to filters, that would also be a satisfactory solution.
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Re: [engine] Add filters for attack_ and defense_weight
I use calculated strikes amount as https://github.com/ProditorMagnus/Agele ... rn.cfg#L35
(Use base value of 0 and add instead of multiply for some use cases)
(Use base value of 0 and add instead of multiply for some use cases)
- Celtic_Minstrel
- Developer
- Posts: 2214
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [engine] Add filters for attack_ and defense_weight
Ah, I see, Ravana is talking about something different — formulas in weapon special keys. That was added for 1.14, yes, but in
If
[attack]
directly it won't work.If
[disable]
were allowed to change an attack's weighting arbitrarily, the final weighting would most likely be some form of cumulation of all [disable]
specials, similar to how it's done for other specials like [damage]
. If I recall correctly, that means:- The last special with
value=
wins. - After that, all specials with
multiply=
ordivide=
are applied. - Then all specials with
add=
andsub=
are applied.
cumulative=
key? Or one could be added to [disable]
specifically.Re: [engine] Add filters for attack_ and defense_weight
Yes, I misunderstood then.
I'd like to note, that it still wasn't in the wiki that formulas are accepted there, it is now.
I still have no idea what is easier to implement - make weighting accept formulas, or allow
I'd like to note, that it still wasn't in the wiki that formulas are accepted there, it is now.
It's what I meant, that there exists a fixed approach, and there won't be any ambiguity. ACeltic_Minstrel wrote: ↑February 22nd, 2019, 1:04 am
If[disable]
were allowed to change an attack's weighting arbitrarily, the final weighting would most likely be some form of cumulation of all[disable]
specials, similar to how it's done for other specials like[damage]
. If I recall correctly, that means:
- The last special with
value=
wins.- After that, all specials with
multiply=
ordivide=
are applied.- Then all specials with
add=
andsub=
are applied.
cumulative
might also make sense in this context, just as well as it does with [damage]
.I still have no idea what is easier to implement - make weighting accept formulas, or allow
[disable]
to access weighting and filters Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
- Celtic_Minstrel
- Developer
- Posts: 2214
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [engine] Add filters for attack_ and defense_weight
I clarified the requirement of enclosing parentheses, but... I'm not sure if that was the best place to put this. It likely also works in
swarm_attacks_max
for example (I haven't tested though), and it works in special abilities as well, not just weapon specials.Re: [engine] Add filters for attack_ and defense_weight
Hmm, is it safe to declare that all keys that expect a numeric value accept formula's as well? If that's the case, then this statement could go into the header.
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
- Celtic_Minstrel
- Developer
- Posts: 2214
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [engine] Add filters for attack_ and defense_weight
In abilities and weapon specials, I believe it's indeed the case that any key that expects a numeric value can also take a formula enclosed in parentheses. However, I'm not 100% certain of this, so maybe check with gfgtdf or something. In theory, even non-numeric keys could accept a formula if we wanted to implement that (though I don't think it'd be much use for enumerative keys).
Re: [engine] Add filters for attack_ and defense_weight
gfgtdf says he knows of no exceptions, so I edited the wiki accordingly. I placed the note on formulas into the "headers" of the ability and special keys.
Returning to the original topic - would it then be possible in the near or not-so near future to implement the feature for [disable] to access weighting?
Returning to the original topic - would it then be possible in the near or not-so near future to implement the feature for [disable] to access weighting?
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny