cyber-menace Posted January 31, 2004 Is there anyway to use the GetActorProp to read the Health of a large group of monsters with the same tag. When I tried it only read the health of one random monster in the group. 0 Share this post Link to post
toxicfluff Posted January 31, 2004 I'd guess the best way of doing this would be with an array. I don't know the specific functions in Zdoom though, check the editing resource for how to do it. 0 Share this post Link to post
cyber-menace Posted January 31, 2004 There aren't too many enemies, so I decided to make a bunch of variables. example:minicybHP1 minicybHP2 minicybHP3 etc 0 Share this post Link to post
boris Posted January 31, 2004 cyber-menace said:There aren't too many enemies, so I decided to make a bunch of variables. example:minicybHP1 minicybHP2 minicybHP3 etc Eeewww! Use arrays! int bla[2]; bla[0] = 123; bla[1] = 456; like that. 0 Share this post Link to post
cyber-menace Posted January 31, 2004 I don't need this code anymore anyway. The health bar gets very inaccurte if too many enemies are applied to it. The overkill from enemies cause odd glitches. 0 Share this post Link to post
Linguica Posted February 1, 2004 If you have a big group why not just have the bar tell how many monsters are still alive? 0 Share this post Link to post
Graf Zahl Posted February 1, 2004 cyber-menace said:I don't need this code anymore anyway. The health bar gets very inaccurte if too many enemies are applied to it. The overkill from enemies cause odd glitches. You have to take into account that dead monsters can have negative health. So you cannot simply add the numbers. That will inevitably give incorrect results. 0 Share this post Link to post
toxicfluff Posted February 1, 2004 Graf Zahl said:You have to take into account that dead monsters can have negative health. So you cannot simply add the numbers. That will inevitably give incorrect results. Heh, you just inadvertently solved a problem I was having with the player's health bar in my project. 0 Share this post Link to post
chilvence Posted February 1, 2004 Hmm, can you not decide whether or not to factor in a monsters HP based on whether it is a positive number or not? 0 Share this post Link to post
Graf Zahl Posted February 1, 2004 chilvence said:Hmm, can you not decide whether or not to factor in a monsters HP based on whether it is a positive number or not? Of course you can. But you first have to know this fact before you can handle it. ;-) 0 Share this post Link to post
cyber-menace Posted February 1, 2004 Linguica said:If you have a big group why not just have the bar tell how many monsters are still alive? That's precisly what I did. There were 31 Monsters so I spread it out evenly along the bar. Much easier calculation... 0 Share this post Link to post
chilvence Posted February 1, 2004 Yeah, I'm thinking if you check each monsters health individually using a loop, you will be able to check whether their health is greater than 0 before adding it to the general catch all health variable. Would use up a lot of TID's though... 0 Share this post Link to post
cyber-menace Posted February 2, 2004 I'm fully aware of that. Luckily these are summoned monsters so I can have as many TIDs as I want... at least I can have A LOT of TIDs. I tried this before, but if you overkill a monster it won't record it and thus UNDERKILLING the monster instead. It's really quite wierd. I would need to add 2 or 3 lines of script per monster to fix this... and even then it would be too messed up... 0 Share this post Link to post
chilvence Posted February 2, 2004 Meh, I am unarmed for thinking about this. What would be the right command for reading a monsters health? 0 Share this post Link to post
Graf Zahl Posted February 2, 2004 chilvence said:Meh, I am unarmed for thinking about this. What would be the right command for reading a monsters health? health=GetActorProperty(tid, APROP_HEALTH); 0 Share this post Link to post