Apologies if this has a simple solution, as I'm pretty new to DECORATE. I wanted to make a projectile that, on impact, would explode into a cloud of smaller projectiles. I used A_SpawnItemEx in order to apply the offsets required to spawn the smaller projectiles outside of the surface that they hit and the velocities to make them move at the appropriate angles. My readings on the wiki didn't find me any sort of flags or parameters that could be used to make this operation relative to the larger projectile's direction, so I instead made different states that would give the smaller projectiles the appropriate spawn offsets and velocities for the different directions (North, South, East, West, NE, NW, SE, SW).
I changed the Death state to perform non-anonymous A_JumpIf operations based on the larger projectile's angle, with each of the resulting states spawning the projectiles and Goto-ing a new state that was identical to the original Death state. For testing purposes, I assigned very visibly different projectiles to the different directions, which revealed very strange behavior. I'm fairly certain that my angle checks were set up correctly, but even so, I redid/revised them, with each set of checks exhibiting similar odd behavior. I also tried three different possible sets of returned values for the angle, as I don't know which one DECORATE uses. I tried the usual standard (0 ->360 degrees), the kind used by GetAngle (-180 -> 180 degrees) and the byte angle values (0 -> 255). Each of these also only yielded the strange behavior.
I actually didn't use GetAngle, as I don't think there are any flags that I could use that would make the measurement with only the larger projectile itself in mind, rather than the angle from the projectile to some target assigned by the flag. The checks looked something like this:
A_JumpIf(Angle < 45 | Angle > 315, "SplodeToTheWest") for hitting a surface after flying east
A_JumpIf(Angle > 45 & Angle < 135, "SplodeToTheSouth") for hitting a surface after flying north
etc...
I would like to be informed of the important details that I've missed here, such as what values the Angle variable uses or certain flags/alternative operations that I could've used to spawn the smaller projectiles relative to the larger one and its direction. Alternatively, I would like to know if there are any expressions I could use to jump to the projectile-spawning states based on the larger projectile's position relative to the nearest linedef, since I could use something like that instead. I've looked through the wiki, but haven't found anything that would help me achieve this. I figured the more experienced Doom gurus might know of something that I missed or some set of other operations that would do the same thing as what I need.
ADDITIONAL DETAILS THAT MAY OR MAY NOT BE IMPORTANT:
- The larger projectiles are spawned from A_FatAttack3, which is aimed at the player
- The Death state and projectile-spawning states have been properly separated, as the Death state ends with Stop after the angle checks
- The projectile-spawning states are also separated from each other and the actual Death state, as they all end by Goto-ing the real Death state
- If the angle of the larger projectile is set manually by way of A_SetAngle, the checks work, so I figured the problem might be the values given naturally
- A_SpawnProjectile cannot be used, as it spawns the projectiles in the wall and cannot apply the offsets required to prevent that
Thank you in advance
