Temple+ New Feats

Discussion in 'General Modification' started by WinstonShnozwick, Sep 18, 2016.

Remove all ads!
  1. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
  2. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    That's the dump file. Doesn't it produce a log file?
     
  3. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Whoops, I think this is it.
     
  4. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    That could be the problem, I'd start by looking there.
     
  5. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Pretty sure that one's present in Co8 too, shouldn't cause the crash.

    Since the last thing in there is the Feats system, you should check your feat files. You should be able to just debug it too (get used to it, that's part of the dev process).
     
  6. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    It is definitely in my feat .txt files. I renamed the feats folder of my mod so it wouldn't detect and the game launched.
    Trying the files one at a time, it seems like most of the feats are ok but for some reason Speed of Thought is making it crash.

    Yep, Speed of Thought is the problem.
    Code:
    name: Speed of Thought
    flags: 2097152
    prereqs: 4 13 300 1
    description: As long as you are psionically focused and not wearing heavy armor, you gain an insight bonus to your speed of 10 feet.
    prereq descr: Power point reserve, Wis 13
    I edited the file so the second line was only "prereqs:", removing the codes and values, and it worked. So for some reason, it breaks the game when it sees anything on the prereqs line, because every other feat .txt had no prereqs codes/values.

    This line in feat.cpp is what makes it crash when it reads values in prereqs
    Code:
    featSpec.prereqs[prereqCount++].featPrereqCode = atol(ch);
     
    Last edited: Nov 22, 2016
  7. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    I think I fixed it. The vector capacity was 0 and needed to be resized or pushed back to resize, it was previously trying to access out of bounds because the vector started with no size.

    The original code in the feat.cpp that was giving errors
    Code:
    else if (!_strnicmp(lineContent, "prereqs:", 8))
                {
                    auto prereqCount = 0;
                    auto prereqArgCount = 0;
                    for (auto ch = lineContent + 8; *ch != 0; ch++)
                    {
                        if ( *ch == ':' || *ch == ' ' || *ch == '\t')
                            continue;
                      
                        if (prereqArgCount < prereqCount)
                        {
                            featSpec.prereqs[prereqArgCount++].featPrereqCodeArg = atol(ch);
                        }
                        else
                            featSpec.prereqs[prereqCount++].featPrereqCode = atol(ch);
    
                        // advance till next piece of content
                        while (*ch && *ch !=  ' ' && *ch != '\t')
                            ch++;
                    }
                }
    Here's the modification that got it to the main menu of the game without error.
    At the top of the getnewfeatsfromfile function add the variable
    Code:
            FeatPrereq featPrereq;
    Code:
    else if (!_strnicmp(lineContent, "prereqs:", 8))
                {
                    auto prereqCount = 0;
                    auto prereqArgCount = 0;
                    for (auto ch = lineContent + 8; *ch != 0; ch++)
                    {
                        if ( *ch == ':' || *ch == ' ' || *ch == '\t')
                            continue;
                      
                        if (prereqArgCount < prereqCount)
                        {
                            if (featSpec.prereqs.capacity() <= prereqArgCount)
                            {
                                featPrereq.featPrereqCodeArg = atol(ch);
                                featSpec.prereqs.push_back(featPrereq);
                                prereqArgCount++;
                            }
                            else
                                featSpec.prereqs[prereqArgCount++].featPrereqCodeArg = atol(ch);
                        }
                        else
                        {
                            if (featSpec.prereqs.capacity() <= prereqCount)
                            {
                                featPrereq.featPrereqCode = atol(ch);
                                featSpec.prereqs.push_back(featPrereq);
                                prereqCount++;
                            }
                            else
                                featSpec.prereqs[prereqCount++].featPrereqCode = atol(ch);
                        }
    
                        // advance till next piece of content
                        while (*ch && *ch !=  ' ' && *ch != '\t')
                            ch++;
                    }
                }
     
    Sitra Achara likes this.
  8. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    Cool, does it work in game? What happens when you throw the bastard sword? Oh and congrats too. :D
     
    Last edited: Nov 22, 2016
  9. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Haven't consoled in levels of soulknife yet, obj.make_class(stat_level_soulknife, n) says obj and make_class aren't defined, I think I need to import something in the console first.

    Tried calling imports that modifier files have and then calling, but still undefined.

    Got it, needed game.party[x].make_class(stat_level_soulknife, x)
     
    Last edited: Nov 22, 2016
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Good work!
     
  11. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Well I've got soulknife levels in game now.

    Mind Blade seems to work. Psychic Strike however, when I get level 3 soulknife, immediately shows the portrait buff. It's like the argument for the modifier is initialized to a different value so it starts out as imbued, how do I make it so the args are set to an initial value when the modifier is created?

    @Allyx - You will be happy to know that you were right. It is indeed possible to make weapons without animations be thrown.

    To make it work, you need to give a value in the range property AND you need to give weapon ammo type as well. I gave throwing axe and dagger to test two different kinds of ammo type. Throwing axe and dagger ammo types both work.
     
    Last edited: Nov 22, 2016
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Modifiers are iniyed with 0 unless specified otherwise.
    I think modifiers associated wih feats may put values in one or more of the first 3 args, I'll check when back home.
     
  13. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    Sweet, might be worth testing if throwing dagger gives +1 bonuses to Halflings attack bonuses, I assume throwing axe doesn't.
     
  14. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Update on the weapon type
    dagger makes it turn into a dagger while it is thrown, don't use this!

    edit: Wrong on the throwable not needed. Throwing axe changes the model in flight as well

    Throwable doesn't seem to work. I get the ability to throw it at least.

    Also, OF_OFF put in the proto fields doesn't make it kill itself on unequip for some reason.
     
    Last edited: Nov 22, 2016
  15. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    254
    :D Weird about the throwing dagger property bit, but at least it works, and doesn't require new animations.

    I'm just glad I was useful for something in this thread - 99% of all you two have said has gone way over my head lol.

    OF_off doesn't destroy a mob, it's still there, just invisible and non-interactive. You can unset OF_off to bring it back.
     
    Last edited: Nov 22, 2016
Our Host!