Feature - Implemented add type proxy for skills

ckb

Minion
Staff member
Currently there are proxy fields for skills including: libram, buff, combat, song, expression

That is 5 things, but there are 10 skill types from classskills.txt:
# Type can be:
# 0 (Passive)
# 1 (Noncombat item summon)
# 2 (Noncombat healing)
# 3 (Noncombat non-shruggable effect)
# 4 (Noncombat shruggable effect)
# 5 (Combat)
# 6 (One-at-a-time Noncombat Song)
# 7 (Combat/Noncombat healing)
# 8 (Combat/Passive)
# 9 (One-at-a-time Noncombat Expression)

It would be nice to have access to all this info via proxy fields rather than having to read in all of classskills into a big map.

See my related post here.

Thanks,
ckb
 

lostcalpolydude

Developer
Staff member
I would consider that a useless feature without first changing the data file to use words (maybe a comma-separated list) instead of arbitrary numbers. Changing the data file handling to use a human-readable comma-separated list would be a bit of work.

Your initial thread doesn't give any explanation about why this would be useful compared to the already-existing proxy fields.
 

ckb

Minion
Staff member
I guess I don't know if this would be totally useful other than in this one case where I am working on a skills relay page and I think it might be nice to sort by type.
The thing I that I find most irksome is that there are these two different locations for information, and they are in different formats, and they give slightly different details.

the proxy field will tell me if it is a libram skill, but the classskills info will not.
the classskills info will tell me if it is a One-at-a-time Noncombat Song, but the proxy field will not.

I am not 100% sure I have run through all the scenarios where one will matter more or less than another, but I can think of at least one instance where it might be useful. In the meantime, I can just load classskills.txt into a big map, and perhaps we can use this thread as the start of a conversation on the subject of data formatting.
:)

ckb
 

fronobulax

Developer
Staff member
The thing I that I find most irksome is that there are these two different locations for information, and they are in different formats, and they give slightly different details


IIRC the dev team has taken one of three actions when it appears that data is spread across multiple files and the equivalent of a JOIN is required to make them easier to use. One has been to take no action because there is no strong case to do so. One has been to provide the equivalent of a VIEW (is that a facade pattern?) in Ash so that a scripter deals with an Ash function and not a collection of maps and files. One has been to refactor the data files so that the data is organized accord to use.

Since I am working in a shop that lives by loose coupling and always favors a Java interface, my knee knee reaction is to hide the files and formats from the scripter behind some kind of Ash function.

"irksome" - The "A word for 2014"? :)
 

Darzil

Developer
I guess the tricky thing here is if you are already planning to create a useful skills relay page, which presumably will include information about what a skill does, or it wouldn't be very useful, then you'll already be having to add lots of information not in mafia. These categories sometimes change when the skills do not, so there probably isn't a great advantage in using them. If I were adding a sort for a relay script it'd be more like one for passive/combat/non-combat/both, another for attack/heal/buff/song/expression rather than a single set of types as Mafia uses internally.

(eg, I may well add a once per combat category, and track these in an array or list in FightRequest rather than what we do now, which is tracking some of them. There are a lot more than there once were. It no longer matters for relay browser buttons, as I changed it to use the presence of the skill in the dropdown to determine if it were usable. But would be good to handle it more generally. )
 

ckb

Minion
Staff member
I guess the tricky thing here is if you are already planning to create a useful skills relay page, which presumably will include information about what a skill does, or it wouldn't be very useful, then you'll already be having to add lots of information not in mafia.

Actually, Mafia is already ripe with bountiful information about all kinds of stuff, so there is very little that needs to be added manually.

skill id is know, class can be found from proxy .class (or by knowing the skill id and how the kills are organized), skill type is available per classskills.txt above, mp cost is from mp_cost(), and number of turns per cast is turns_per_cast(), the resultant effect from to_effect(), and the details about this effects are from the modifiers() functions, and the image for this effect is available via effect proxy .image.
Any limits to casting are tracked by mafia, as are current availability of each skill.

So really the only detail I am planning on using that is awkward is the skill type from classskills.txt Though I can get this via a file_to_map(), it would be prettier if there were another way to access this info.

ckb
 

ckb

Minion
Staff member
I am bumping this again as I find myself wanting to know skill type in a script (This for mood balancing).
The key is to not try to define a mood with multiple One-at-a-time Noncombat Songs or multiple One-at-a-time Noncombat Expressions.

An ash function of
int skill_type ( skill )

would be sweet. In the meantime, I will continue to import and parse all of classskills.txt

Edit: looks like I was working on this last one exactly 3 years ago today! Happy New year.
Edit 2: also, at exactly the same time of day. Now I am freaking myself out. How do I party? By working on Mafia scripts. Maybe I need to get out more.
 

ckb

Minion
Staff member
Maybe this happend some time in the last 3 years and I never noticed, but apparently there are now proxy fields for $skills:
.song
.expression
.walk

This should solve my issues. And someone can mark this request implemented. Thanks from the past!
 

heeheehee

Developer
Staff member
Also, .combat, .passive, .buff, and .summon give you... most of the rest of the categories. Nothing explicitly specifies categories 2-4, 7 (but you can call to_effect(skill) to get 3/4, I guess).
 

ckb

Minion
Staff member
Sweet!
I saw this yesterday, and remembered making this feature request long ago... I was just about to look it up when I saw it here. Thanks Veracity!
 
Top