Getting hatee TID
Moderator: GZDoom Developers
Getting hatee TID
Ability to get hatee TID. Using this it'll be possible to control monsters behavior and write custom AI.
- Cutmanmike
- Posts: 11335
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
- MartinHowe
- Posts: 2027
- Joined: Mon Aug 11, 2003 1:50 pm
- Location: Waveney, United Kingdom
- Contact:
The request seems to be for a function to be added that takes any monster by its own TID and returns 0 if it is not hating something with Thing_Hate and otherwise returns the TID of the thing that is being hated.
For the custom AI of the Duke-style scurrying rats in my WIP "The Butchery", I used an array to store the hatee TIDs of each rat when set with Thing_Hate and I suspect that an array is the only way to do it right now (a grossly over-simplified example follows).
For the custom AI of the Duke-style scurrying rats in my WIP "The Butchery", I used an array to store the hatee TIDs of each rat when set with Thing_Hate and I suspect that an array is the only way to do it right now (a grossly over-simplified example follows).
Code: Select all
int hatees[4]={0,0,0,0};
void Hate_It (int hater, int hatee, int htype)
{
Thing_Hate(hater,hatee,htype)
hatees[hater]=hatee;
}
Couldn't it just return the TID of the thing it's trying to attack, regardless of whether it was it Thing_Hate'd to do so?MartinHowe wrote:The request seems to be for a function to be added that takes any monster by its own TID and returns 0 if it is not hating something with Thing_Hate and otherwise returns the TID of the thing that is being hated.