Skip to content

Python builtin tpdp module

Dude McDude edited this page Sep 30, 2016 · 31 revisions

Under Construction


The tpdp module is a new Temple+ builtin module used for exposing many ToEE data types. You can see the contents by typing in the game console

import tpdp
dir(tpdp)

Or, just check out the CPP file:
python_dispatcher.cpp

Data Types

BonusList

Methods

  • add(value, bonus_type, mesline_num) - adds a bonus entry. Will show a line from bonus.mes in the roll breakdown.
  • add(value, bonus_type, text) - adds a bonus entry. Will show the specified text in the rolls breakdown.
  • add_from_feat(value, bonus_type, mesline_num, feat_enum) - adds a bonus entry. Specifies the feat as the case.
  • add_from_feat(value, bonus_type, mesline_num, feat_text_id) - adds a bonus entry. Specifies the feat as the case. (uses the string as feat ID - meant for use with the new Temple+ feats)
  • set_overall_cap(flags, new_cap_value, new_cap_type, mesline_num) - sets an overall cap for a bonus type (use 0 to cap all types)
  • get_sum()
  • add_zeroed(mesline_num) - adds a null bonus (used for indicating nullified bonuses, e.g. Dex bonus nulled from Flatfooted)
  • add_cap(bonus_type, cap_value, mesline_num) - adds a cap for a particular bonus type

AttackPacket

Members:

  • target (PyObjHandle)
  • attacker (PyObjHandle)

Methods:

  • get_flags() (gets the D20CAF flags)
  • set_flags(flags) (sets the D20CAF flags)
  • get_weapon_used() (returns PyObjHandle of the weapon used in this attack)
  • is_offhand_attack()

DamagePacket

Members:

  • bonus_list
  • flags
  • attack_power (See D20DAP_ flags)
  • critical_multiplier (integer; 1 by default, gets increased by various things)

Methods:

  • add_dice(dice, damType, damageMesLine)

SpellEntry

SpellPacket

TurnBasedStatus

D20Action

Members

  • performer (PyObjHandle)
  • target (PyObjHandle)
  • spell_id
  • data1 (generic piece of data used for various things depending on context, action type etc.)
  • flags (see D20CAF_ flags)
  • path
  • action_type (see D20A_ constants)
  • loc
  • anim_id

Methods:

  • query_can_be_affected_action_perform(obj) - can obj be affected by the action (returns 1 by default, can return 0 due to things like Sanctuary, Ethereality, etc)

D20SpellData

MetaMagicData

Event Objects

EventArgs

This is the "args" in the various callbacks. The class name is a bit of a misnomer - this is mostly used for exposing the Modifier args.

Methods

  • get_arg(n) - gets the value of modifier arg n
  • set_arg(n, value) - sets the value of modifier arg n
  • condition_remove() - removes the modifier

EventObjD20Query

Used for d20_query calls.

  • return_val - integer return value for the d20_query.
  • data1 - generic piece of data. Can be a C++ pointer to another object.
  • data2 - second generic piece of data
  • get_spell_packet() - Used for CasterLevelMod events to get a SpellPacket from the data1 field

EventObjD20Signal

  • data1 - generic piece of data. Can be a C++ pointer to another object (such as D20Action).
  • data2 - second generic piece of data
  • return_val - integer return value. Not really used as a return value, but you can manipulate it nonetheless for communicating with other callbacks.

EventObjBonusList

EventObjObjectBonus

EventObjSavingThrow

EventObjAttack

Used in ET_OnToHitBonusBase, ET_OnToHitBonus2, ET_OnGetAC and ET_OnGetAcModifierFromAttacker

Members

EventObjDamage

Used for adding damage dice and bonuses. Belongs to events ET_OnDealingDamage and ET_OnDealingDamage2.

Members

EventObjGetAttackDice

Used for getting the critter's attack dice

EventObjD20Action

Used for D20 Action Checks/Performance events and obtaining number of attacks (base/bonus/natural)

EventObjTurnBasedStatus

EventObjSpellEntry

EventObjSpellCaster

Used for retrieving spell caster specs. New for Temple+!

EventObjTooltip

Tooltip event for mouse-overed objects.

EventObjEffectTooltip

Used creating status effect indicators in the party portrait row and their associated tooltips.

Methods

  • append(effect_type_id, spell_enum, text)
    effect_type_id - up to 91 is for buffs, 92 thru 167 is for ailments, and the rest are for status effects (icons inside the portrait)
    spell_enum - use -2 for non-spells
    text - freeform text

EventObjObjectEvent

Used for Object Events (triggered by entering/leaveing AoE)

EventObjModifier

EventObjDispelCheck

Dispel Check Event

EventObjImmunityTrigger

Used for triggering the immunity handling query

EventObjMoveSpeed

Used for getting move speed, and also for model size scaling with Temple+.

EventObjGetAbilityLoss

Used for Ability Loss status

EventObjReflexSaveThrow

Used for Reflex Save throws that reduce damage.

Clone this wiki locally