Temple+ Modding Question

Discussion in 'General Modification' started by _doug_, Feb 21, 2018.

Remove all ads!
  1. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Just to add a nugget of information - the anim goals aren't animations, they're basically state machine controllers for game objects. They can trigger various things, such as animations obviously, but also events, scripts, other anim goals, etc.
     
    anatoliy likes this.
  2. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    anatoliy likes this.
  3. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Would it be ok to add a performAttack to the python_object? I have some spells from the Warmage spell list on my ToDo that actually require a normal to hit instead of a touch attack.

    I would copy/paste the perform_touch_attach and change it to (and hope it works):
    Code:
    static PyObject* PyObjHandle_PerformAttack(PyObject* obj, PyObject* args) {
        auto self = GetSelf(obj);
        if (!self->handle) {
            return 0;
        }
        D20Actn action(D20A_STANDARD_ATTACK);
        int isMelee = 0;
        if (!PyArg_ParseTuple(args, "O&|i:objhndl.perform_attack", &ConvertObjHndl, &action.d20ATarget, &isMelee)) {
            return 0;
        }
    
        // Build a to-hit action, do hit processing and return the result
        action.d20APerformer = self->handle;
        if (!isMelee) {
            action.d20Caf = D20CAF_RANGED;
        }
        action.data1 = 1;
    
        combatSys.ToHitProcessing(action);
        d20Sys.CreateRollHistory(action.rollHistId1);
        d20Sys.CreateRollHistory(action.rollHistId2);
        d20Sys.CreateRollHistory(action.rollHistId0);
        return PyInt_FromLong(action.d20Caf);
    }
    EDIT: Hmm, there would be D20A_STANDARD_RANGED_ATTACK, so I should entirely drop the ranged part I guess
     
    anatoliy likes this.
  4. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    I also would like to list things which I believe would be nice to improve in T+:
    • Trip attack to use weapon bonuses;
    • Trip attack to be single attack not standard action;
    • Introduce Grapple mechanics!
    • Allow Natural attacks to be mixed with regular ones (with weapon).
     
  5. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    We should either add obj.has_los_blocked(target, flags) or modify obj.has_los(target, ignore_conditions = False).

    Similarly to UiPicker::pickerLosBlocked.

    I'm really tired of creating many workarounds for that when scripting tactics for blind foes.
     
    Shiningted likes this.
  6. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Is it possible to get a set_param function for
    Code:
    py::class_<DispatcherCallbackArgs>(m, "EventArgs")
    At the moment I only have a get_param function, but sometimes it would be helpful to have a set_param function as well, like the set_arg function.
     
    anatoliy likes this.
  7. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    What is the intended use case?
    You're aware that the params are static variables, i.e. not per instance, right? As such I definitely won't add that to EventArgs.
     
  8. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Can you clarify exactly what you need?
     
  9. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    I think you can do all that python-side.
    1) Create a D20Action object, set its properties as needed
    2) Call its method "to_hit_processing": d20a.to_hit_processing()
    3) Use game.create_history_from_id(d20a.roll_id_0) etc
     
    anatoliy likes this.
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    BTW: I'm in covid jail rn, so got some free time at last :p
     
    August and anatoliy like this.
  11. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Ok.

    Thank you Sitra, will test this with a few new spells for the Warmage :)

    Hope you and your family is fine *fingers crossed*
     
  12. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    All the important Covid data seems to be coming from Israel, so pls report your symptoms accurately!

    O and get well too.
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Thanks!

    I'm currently dying. My last wish is for KotB 1.2 to come out ;)
     
    August likes this.
  14. Pygmy

    Pygmy Established Member Supporter

    Joined:
    Oct 8, 2010
    Messages:
    751
    Likes Received:
    81
    Ha Boris has more or less promised us that we won't have to isolate after a positive test from next Thursday....
     
  15. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    For example - on critter's start_combat (his round start) I will evaluate foes:
    * foes_threatening
    * foes_adjacent
    * foes_can_sense
    * foes_can_los
    * foes_could_be_approached

    Now, for archers it's my decision, whether they should target invisible targets (or anyone when it's blinded). npc.has_los() will check if critter actually has ability to see, which does not suit me. I need npc.has_los_blocked() kind of method which will have code similar to PickerLosBlocked.

    Currently I have written sorting of targets and invisible ones are at the bottom, so are picked last by AI. But if only one left, archers would be thinking that they have no LOS, instead of they have LOS but also will have miss chance.

    By RAW enemy archers would know, that there is someone. But to pinpoint would have to either hear or huge spot check.
    I'm considering adding "prev turn location" for PCs in the future to determine, whether NPC should check where PCs are so they can target them. But for now let's consider that NPC know exactly where they are.
     
    August likes this.
Our Host!