Object module

Module for controlling game objects.

Functions

  • trx.objects.swap_mesh(obj1_id, obj2_id, mesh1_num, mesh2_num)

    Swaps the given meshes of the given objects.
    Examples:

    • trx.objects.swap_mesh(trx.catalog.objects.O_PIERRE, trx.catalog.objects.O_LARSON, 8, 8)

      Pierre now has Larson's head, and vice-versa
  • trx.objects.swap_mesh(obj1_id, obj2_id)

    Similar to above, but this will swap out all meshes rather than specific ones. This works best when both objects have the same mesh count; if one object has fewer meshes than the other, the minimum count will be used.
    Examples:

    • trx.objects.swap_mesh(trx.catalog.objects.O_PIERRE, trx.catalog.objects.O_LARSON)

      Pierre and Larson's meshes are fully swapped
    • trx.objects.swap_mesh(trx.catalog.objects.O_PIERRE, trx.catalog.objects.O_WARRIOR_1)

      Pierre's 15 meshes are now of mutant type; the mutant's first 15 meshes are Pierre's, the rest are default.