Temple+ New Feats

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

Remove all ads!
  1. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    That's a good idea. I have a suggestion, how about you add it yourself? Get your feet wet in adding python commands because I'm sure there will be lots of little requests like that.
    The commit is
    https://github.com/GrognardsFromHell/TemplePlus/commit/194b436e29ad6702b1a411e4ea332423c91407e4

    If Mind Blade is the name of the modifier, yeah.
     
  2. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    How many invisible inventory slots are there past the first 24? I looked through inventory.h/cpp but c0uldn't find anything.
     
  3. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    They 'end' at 200 (which is where the equipped inventory indices begin; btw don't mix this up with the EquiSlot enums, these are offsets relative to 200).
    There's actually more past the equipped slots, which belong to the unfinished 'bags'.
     
  4. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    I'm seeing a number of functions that are preceded by a "_", and they seem to stem back to the inventorysystem using rebase() for them. Is that tying the function directly to binary in the toee engine? Because it limits me from knowing more in depth how they work, like setitemparent for example, which just calls _setitemparent.
     
  5. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Yeah, the _ functions are calls to the engine. Gotta add descriptions to those.

    For your purposes you can check what the python command for item_get does and add it to item_wield.
     
  6. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Why would I need to modify item_wield? It's job is to remove from inventory, not add to it.
     
  7. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    I thought you wanted to make item_wield able to equip an item that is not currently in the inventory? To do that you first have to transfer it to inventory.
    Alternately you can modify item_get so that it takes an optional flags argument that tells it it's ok to put an item in the invisible slots.
     
  8. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    OH! So I can make either of the two fixes to solve it then?
     
  9. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Yes. Even better if you both :)
     
  10. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    I think in the wield modification, I want to check first if the item is in the inventory or not. Would using GetInventoryLocation be the best to do this? IE it returns 0 if item is not found in inventory.

    Also, given this line
    Code:
    (*inventoryArray)[i] = obj->GetObjHndl(invenField, i);
    If there was no item (empty inventory slot) at any point, would the value be equal to 0?
     
    Last edited: Nov 13, 2016
  11. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    I gave a pull request with the two changes discussed.
     
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Are you using Visual Studio? You had some glaring errors (undeclared result variable in ItemGet, and did not use ivnentory.GetParent for Wield)
     
  13. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    My version of VS 2015 kicked out of trial and wouldn't let me use it any more. I just edited in browser.
    I see my miss on inventory.getparent, but the result variable in itemget seems fine to me?
     
  14. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Eh? Why did you have to use a trial? Were you using an enterprise version or something? There's a free edition for non-commercial use.

    Editing in browser is a bad idea because you can easily miss errors like that.
    As for result, you declared it in an internal scope - it's undefined outside of the if (...){} clause. (this isn't Python...)

    Also I didn't even notice that SetItemParent is the same as inventory.ItemGet, heh.
     
  15. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Whoops, forgot that small stuff. Just pushed twice to master branch for the fixes.

    I used trial because that was the first version I found, I thought it was the free edition :confused:. Next weekend I'll be able to get access to my 2012 install disc for VS that should work.

    As for mind blade, it seems that with the changes, everything should work properly now hopefully. I just haven't made it recognized as the new weapon type yet, for that can I just put wt_mindblade in the protos.tab for weapon type?
     
Our Host!