View Single Post
Old 12-09-19, 07:37   #540
TokyoSU
Member
 
TokyoSU's Avatar
 
Joined: Mar 2019
Posts: 687
Default

Quote:
Originally Posted by ChocolateFan View Post
What are these structures, TokyoSU?
  • LARA_ARM
  • StrAIInfo
  • StrLOT
  • StrBiteInfo
  • StrCreatureInfo
- LARA_ARM is in the name, it control the lara arm for the weapon (angle),
the current frame/anim, if lara lock a enemy and the flash_gun when firing (light).
Code:
struct LARA_ARM
{
    signed short *frame_base;
    signed short frame_number;
    signed short anim_number;
    signed short lock;
    signed short y_rot;
    signed short x_rot; // dont change this position x_rot is there !!
    signed short z_rot;
    signed short flash_gun;
};
- StrAIInfo is used by CreatureAIInfo(item, &AI), it set the maximum angle (x and y) for head/torso rotation in StrCreatureInfo (need to be assigned in the animation control), it set a distance between the target and the src, it set the fov for the entity (ahead) the enemy orientationH and the current zone/enemy zone (floor)
Code:
struct StrAIInfo
{
    short zone_number;
    short enemy_zone;
    long distance;
    long ahead;
    long bite;
    short angle;
    short x_angle;
    short enemy_facing;
};
- StrLOT is the structure used in StrAIInfo to set a pathfinding and control the AI (this entity can fly ? or set a path to lara).
Code:
enum TYPE_ZONE
{
    ZONE_SKELLY = 0,
    ZONE_BASIC = 1,
    ZONE_CROC = 2,             // it's underwater by default, but too much speed when moving up and down.
    ZONE_HUMAN = 3,
    ZONE_FLYER = 4,
    ZONE_SPIDER = 5,          // Customized don't use it
    ZONE_BIG_ENTITY = 6,   // Customized don't use it (for boss like trex)
    ZONE_UNDERWATER = 7 // Customized don't use it
};

struct StrBoxNode
{
    short exit_box;
    WORD search_number;
    short next_expansion;
    short box_number;
};

struct StrLOT
{
    StrBoxNode* node;
    short head;
    short tail;
    WORD search_number;
    WORD block_mask;
    short step;
    short drop;
    short zone_count;
    short target_box;
    short required_box;
    short fly;
    WORD can_jump : 1;
    WORD can_monkey : 1;
    WORD is_amphibious : 1;
    WORD is_jumping : 1;
    WORD is_monkeying : 1;
    PHD_VECTOR target;
    TYPE_ZONE zone;            // tr4 new enum.
};
- StrBiteInfo is used by CreatureEffect to set a point (pos) for the effect. (just x, y, z, mesh_number)
Code:
struct StrBiteInfo
{
    signed int x;
    signed int y;
    signed int z;
    signed int mesh_num;
};
- StrCreatureInfo is used for the creature, it control the head/torso rotation if used with CreatureJoint(), it set some flag like "alerted" or "reached_goal" and set a maximum turn when used with CreatureTurn(), and the last it set a target for the entity (lara by default).
Code:
struct PHD_VECTOR
{
    DWORD x;
    int y;
    DWORD z;
};

enum MOOD_TYPE
{
    MOOD_BORED,
    MOOD_ATTACK,
    MOOD_ESCAPE,
    MOOD_STALK,
};

struct StrCreatureInfo
{
    WORD joint_rotation[4];
    short maximum_turn;
    short flags;
    WORD alerted : 1;
    WORD head_left : 1;
    WORD head_right : 1;
    WORD reached_goal : 1;
    WORD hurt_by_lara : 1;
    WORD patrol2 : 1;
    WORD jump_ahead : 1;
    WORD monkey_ahead : 1;
    MOOD_TYPE mood;
    StrItemInfo* enemy;
    StrItemInfo ai_target;
    short unknown_field1;
    WORD item_num;
    PHD_VECTOR target;
    StrLOT LOT;
};
you can init this struct with "item->data" or "item->pZonaSaveGame"
i hope this can help to resolve your question

Last edited by TokyoSU; 12-09-19 at 07:51.
TokyoSU is offline   Reply With Quote