Vanilla Proto Issues

Discussion in 'General Modification' started by DarkStorm, Sep 10, 2019.

Remove all ads!
  1. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    So, I've been silently hacking away at ToEE again for a while, and while rewriting the entire proto parser, I came across a bunch of issues with vanilla protos (not Co8, I mean pure Vanilla Patch 2 goodness).
    Some of these have long been known, others, I am not so sure of. In this threat, I'd like to ask for your opinions on whether these should actually be fixed, even if they don't have any real impact (other than producing alot of log spam if ToEE were to validate the protos).

    Invalid item_wear_flags
    This one I have seen for almost every weapon. The following values are not valid item_wear_flags:
    1. OIF_WEAR_WEAPON_PRIMARY [Determining whether something can be equipped in main/off-hand is handled differently, not using these flags]
    2. OIF_WEAR_WEAPON_SECONDARY
    3. OWF_TWO_HANDED (Proto 4064, 4065, 4106, 4203, 4204, 4217, 4221 have this flag) [Looks still present in Co8], should be OIF_WEAR_2HAND_REQUIRED instead
    4. OIF_WEAR_RING_PRIMARY and OIF_WEAR_RING_SECONDARY (Lots of protos, only OIF_WEAR_RING is recognized)
    5. "OIF_WEAR_AMMO," (Simple typo, Protos 5004, 5008) [Looks fixed in Co8]
    Invalid String Condition Arguments
    If a condition argument is a string, it has to be put into single quotes, otherwise it is not going to be stored as an ELFHash.
    [w] Proto 4133 has bare text 'ef-Balor Sword' as condition argument. Should use single quotes.
    In this particular case it means the sword is missing the balor sword particle system. Fix is to put the string in single quotes. [Co8 still has this error]

    Unrecognized Critter Flags
    L0oots of protos have unrecognized critter flags that are actually monster subtypes (probably Arkanum leftover??, this is handled via monster categories now)
    Unrecognized flags:
    OCF_ANIMAL
    OCF_UNDEAD
    OCF_PLANT
    OCF_AIR
    OCF_EARTH
    OCF_FIRE
    OCF_WATER
    Seems pretty inconsequential.

    Misc:
    [w] Proto 2073 has invalid value for flags: 'OF_WATER_WALKING'
    There's OSF_WATER_WALKING, which is a spell flag and not a flag, so this is bogus (and ignored anyway).

    [w] Proto 3003 has invalid value for model_scale: .25
    Scale is in percent, so this is shit and should be 25. [Co8 still has this value]

    [w] Proto 14228 has invalid deity 'Beory'

    [w] Proto 14264 has invalid value for npc_flags: 'ONF_ALOOF'
    (and many more). ONF_ALOOF is not a valid NPC flag. Probably an Arkanum leftover.
     
  2. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    item_wear_flags - I KNEW it! I dropped these flags from my mind blades in places because I was getting no effect on primary/secondary with them. It would be nice to deprecate them so people aren't fooled and waste their time trying to make something work in a way that will never work.

    string conditions - Where exactly in code I write would this come up? Do you have an example? I enforce the convention on myself of always using double quotes for strings, never single quotes.

    Otherwise I'm of the mindset of it would be nice to fix all of the issues if possible. Getting rid of the inconsequential log spam can help narrow down log spam that matters more. I have noticed a lot of log errors whenever I debug with temple+ related to validating or being unable to find files in vanilla and co8.
     
  3. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    255
    I would be in favour of cleaning up the useless flags, not only in Vanilla, but also any still present in the Co8 mod as well, if only to prevent others from using them by mistake.
     
  4. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    @WinstonShnozwick At least in the vanilla proto this only seems to affect the balor sword and the particle system name passed to the "Item Particle System" condition. In the C/C++ code, it'll apply ELFHash to anything that is in single quotes, and store the hash in the condition args. If it's not quoted though, it'll just "bork" and store 0.

    I'll run my validation code against the current Co8 protos.tab as well. I have to get a clean install going first, though :)
     
  5. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,744
    Likes Received:
    375
    <sigh> This explains so much.

    What do you mean by 'fixed'? Removed from protos.tab? Yes, that should be done, but if you're still busy rewriting the game engine, I wouldn't call it your responsibility. Outsource - there's plenty of players here who mod their protos.tab, I'm sure.

    Do you have a log of of ToEE trying to validate everything? If not I have one somewhere, its mostly "this NPC does not have the prerequisite for feat x" over and over.
     
  6. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    I wouldn't waste time fixing imconsequential stuff. The Balor sword effect would be a nice fix I think (I guess no one has ever seen it?)
     
  7. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    Well, I want to fix even the inconsequential stuff so it doesn't spam my logfile :p
    The reasoning is this: In general I'd like to print warnings about misspelled or unknown flags.
    However, here's what I propose: I produce a fixing tool that can automatically fix 99% of the problems for a given protos.tab
    I think that's necessary because I want a fixed (non-co8) protos.tab, but also be able to fix the Co8 protos.tab with as little effort as possible.
    I'll look into doing that soon, but we should decide *how* we should fix certain things.

    For example: the creatures incorrectly flagged as OCF_UNDEAD, do we want to validate that they have the right monster category?
     
  8. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    255
    From an Icewind Dale conversion modding perspective, I 100% support this! KotB would also benefit from such treatment. :D
     
  9. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    Alright, for Vanilla, I've found the following fixable issues:
    https://gist.github.com/shartte/a0d87e4c2894d7359a342d817a5cdfb4

    I've added a check for the critter flags against the monster type/subtype. I.e. OCF_AIR vs. mc_subtype_air and printed warnings if they don't match. Per the rules, I think it doesnt matter. If a "fiendishly huge viper" is classified as a magical beast, anything animal related would NOT apply to it anymore, right?

    Current fixes my Python script applies:
    • Remove OIF_WEAR_WEAPON_PRIMARY
    • Remove OIF_WEAR_WEAPON_SECONDARY
    • Remove OIF_WEAR_RING_PRIMARY
    • Remove OIF_WEAR_RING_SECONDARY
    • Remove OCF_ANIMAL
    • Remove OCF_UNDEAD
    • Remove OCF_PLANT
    • Remove OCF_AIR
    • Remove OCF_EARTH
    • Remove OCF_FIRE
    • Remove OCF_WATER
    The only thing I don't know how to fix: WTF is up with the Beory deity. Should that just be old faith?


    (p.s.: Python script is here: https://gist.github.com/shartte/d4c1cb9fdc43805e7b23739117825a12 - needs Python 3.6)
     
  10. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    255
    According to this, Beory is a deity in her own right, the Old Faith is a collection of 5 Gods, one for each season and the Sun God overseeing all. As it doesn't function in ToEE as a usable deity, I would assume changing it to The Old Faith would be acceptable.
     
  11. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,744
    Likes Received:
    375
    Also yes to replacing Beory with Old Faith.

    Are we confident something like "OCF_UNDEAD" or "OCF_PLANT" never shows up in a spell that only affects (or doesn't affect) undead and/or plants?

    EDIT: Some of the stuff I modded used mc_type_plant instead, probably why it worked. I'll have to get out the laptopt to check exhaustively.

    2nd EDIT: None of this stuff seems used - the main critter flag that gets used seems to be OCF_MUTE - but this just means they're all available to be used by modders :) I marked Axer as OCF_MECHANICAL for some reason - can't remember why.
     
    Last edited: Sep 13, 2019
  12. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Good to know I haven't been doing anything that could cause this to be a problem.
     
  13. Rana271

    Rana271 Member

    Joined:
    May 23, 2019
    Messages:
    19
    Likes Received:
    0
    How do you check the files, what validator?
     
  14. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    @Rana271: I have a C# implementation in a yet unreleased reimplementation of temple.dll in C#
     
    anatoliy and Rana271 like this.
  15. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    Rana271 likes this.
Our Host!