Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Moderator:GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
You can only do playerpawn stuff if you have an actual playerpawn to work with. It can be done either way but know that you'll have to find A player pawn with the latter.
for (let i = index, a = borderAngle / 45.; a < 180.; i--, a += 45.)
{
}
I can't do this in ZScript? acc.exe allowed it... (specifically the last I-- and a += do not work; I can only assign one variable at the end here but not both. The initializer works fine)
Sure, I can declare them outside, but declaring the variables isn't the problem... the problem is assigning the two variables at the end.
Also, hopefully a simpler question: when you read an Actor's angle, the number can go below 0 and above 360. How do I wrap the values around so that I can reliably only get results between 0 and 360?
double ang = angle;
if (ang < 0) ang = 360.0-(ang % 360);
else ang = ang % 360;
Something like that. There might be a native function that does it however, and I'm not sure that % works on doubles in ZScript (in most languages it doesn't, but I remember that it kinda worked...)
In case % doesn't work,
Sorry to interrupt the backend talk, but does anyone know if an EventHandler has a function that can check a thing's state? I want to check to see if the currently dead actor has entered its xdeath state. In this context, e.thing.health < -e.thing.GetSpawnHealth() doesn't necessarily do the job since an actor's gibhealth property could change depending on its own gibhealth property or the gameinfo property. I apologize if this question has been asked already, I'm not sure what to search for in exact terms.
Migrating the question to this topic. Is it possible (yet)?
DenisBelmondo wrote:does anyone know if an EventHandler has a function that can check a thing's state? I want to check to see if the currently dead actor has entered its xdeath state. In this context, e.thing.health < -e.thing.GetSpawnHealth() doesn't necessarily do the job since an actor's gibhealth property could change depending on its own gibhealth property or the gameinfo property. I apologize if this question has been asked already, I'm not sure what to search for in exact terms.
Not that I know an eventhandler from a hole in the ground at this point, but would something like