Page 1 of 1

Help- Can't find Factions ranks in OpenCS

Posted: 12 Nov 2017, 08:23
by Grilly
I need to create a new faction for a mod and I'm using OpenCS exclusively since, to my knowledge, Tes3CS does not work in Linux even under Wine.

I can create the faction and set up the favored attributes and skills and even reaction from other factions. However, I can't name the pcrank for each rank level. I opened some of the factions already in the game to see if there was a way to rename pcrank levels and I can't seem to find it. So since I'm apparently blind could someone please let me know where to look. Also, if it hasn't been implemented yet, let me know so I can put that in a bug report.

Re: Help- Can't find Factions ranks in OpenCS

Posted: 12 Nov 2017, 10:27
by DestinedToDie
Hey yeah, seems like we're missing faction ranks or I can't find them.

Re: Help- Can't find Factions ranks in OpenCS

Posted: 12 Nov 2017, 11:10
by Grilly
Thanks for getting back to me. I'll put in the bug report.

Re: Help- Can't find Factions ranks in OpenCS

Posted: 22 Nov 2017, 02:41
by Grilly
I did some digging in the source code. There is a file at esmtool/record.cpp

Code: Select all

template<>
void Record<ESM::Faction>::print()
{
    std::cout << "  Name: " << mData.mName << std::endl;
    std::cout << "  Hidden: " << mData.mData.mIsHidden << std::endl;
    std::cout << "  Attribute1: " << attributeLabel(mData.mData.mAttribute[0])
              << " (" << mData.mData.mAttribute[0] << ")" << std::endl;
    std::cout << "  Attribute2: " << attributeLabel(mData.mData.mAttribute[1])
              << " (" << mData.mData.mAttribute[1] << ")" << std::endl;
    for (int i = 0; i < 7; i++)
        if (mData.mData.mSkills[i] != -1)
            std::cout << "  Skill: " << skillLabel(mData.mData.mSkills[i])
                      << " (" << mData.mData.mSkills[i] << ")" << std::endl;
    for (int i = 0; i != 10; i++)
        if (mData.mRanks[i] != "")
        {
            std::cout << "  Rank: " << mData.mRanks[i] << std::endl;
            std::cout << "    Attribute1 Requirement: "
                      << mData.mData.mRankData[i].mAttribute1 << std::endl;
            std::cout << "    Attribute2 Requirement: "
                      << mData.mData.mRankData[i].mAttribute2 << std::endl;
            std::cout << "    One Skill at Level: "
                      << mData.mData.mRankData[i].mSkill1 << std::endl;
            std::cout << "    Two Skills at Level: "
                      << mData.mData.mRankData[i].mSkill2 << std::endl;
            std::cout << "    Faction Reaction: "
                      << mData.mData.mRankData[i].mFactReaction << std::endl;
        }
    std::map<std::string, int>::iterator rit;
    for (rit = mData.mReactions.begin(); rit != mData.mReactions.end(); ++rit)
        std::cout << "  Reaction: " << rit->second << " = " << rit->first << std::endl;
    std::cout << "  Deleted: " << mIsDeleted << std::endl;
}
It looks to me like this is the bit that sets up the window for us to edit the factions but as you can see, there is no PCRANK listed here, which is what the game uses as FACTION RANKS. A bit further down in the code I found:

Code: Select all

template<>
void Record<ESM::DialInfo>::print()
{
    std::cout << "  Id: " << mData.mId << std::endl;
    if (mData.mPrev != "")
        std::cout << "  Previous ID: " << mData.mPrev << std::endl;
    if (mData.mNext != "")
        std::cout << "  Next ID: " << mData.mNext << std::endl;
    std::cout << "  Text: " << mData.mResponse << std::endl;
    if (mData.mActor != "")
        std::cout << "  Actor: " << mData.mActor << std::endl;
    if (mData.mRace != "")
        std::cout << "  Race: " << mData.mRace << std::endl;
    if (mData.mClass != "")
        std::cout << "  Class: " << mData.mClass << std::endl;
    std::cout << "  Factionless: " << mData.mFactionLess << std::endl;
    if (mData.mFaction != "")
        std::cout << "  NPC Faction: " << mData.mFaction << std::endl;
    if (mData.mData.mRank != -1)
        std::cout << "  NPC Rank: " << (int)mData.mData.mRank << std::endl;
    if (mData.mPcFaction != "")
        std::cout << "  PC Faction: " << mData.mPcFaction << std::endl;
    // CHANGE? non-standard capitalization mPCrank -> mPCRank (mPcRank?)
    if (mData.mData.mPCrank != -1)
        std::cout << "  PC Rank: " << (int)mData.mData.mPCrank << std::endl;
    if (mData.mCell != "")
        std::cout << "  Cell: " << mData.mCell << std::endl;
    if (mData.mData.mDisposition > 0)
        std::cout << "  Disposition/Journal index: " << mData.mData.mDisposition << std::endl;
    if (mData.mData.mGender != ESM::DialInfo::NA)
        std::cout << "  Gender: " << mData.mData.mGender << std::endl;
    if (mData.mSound != "")
        std::cout << "  Sound File: " << mData.mSound << std::endl;
Someone mentioned the capitalization issue but I honestly don't know what this part of the code does and I haven't found "DialInfo" in the editor yet. In any case, it doesn't look like this part of the code actually lets you edit anything. Therefore, it seems that the faction template above is really what needs to be changed since people will want to edit faction ranks in the faction window anyway.

Re: Help- Can't find Factions ranks in OpenCS

Posted: 22 Nov 2017, 20:42
by Atahualpa
When I was working on the editor almost a year ago, I also wanted to include faction ranks. However, I didn't have the time to finish the job -- as well as several other content-related tasks. Maybe after the current release phase...

Anyway, I also created a list which contains all the data fields we need and their current status. E.g., there are a bunch of wrong data types / value ranges assigned to certain fields. If need be, I can share the list with you guys.