by MartinHowe » Thu Jun 16, 2005 3:01 am
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).
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;
}
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 [b]being [/b]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).
[code]int hatees[4]={0,0,0,0};
void Hate_It (int hater, int hatee, int htype)
{
Thing_Hate(hater,hatee,htype)
hatees[hater]=hatee;
}
[/code]