Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
In this thread I'll try to consolidate and post minor bits of interesting ACS, shaders and visual effects that I come up with while working on other projects.
Starting out with dynamic hudmessage rotation in the form of a compass.
It uses the alpha channel as an argument for the angle of rotation. Only works in the GZDoom 1.x renderer, including Zandronum and Gloome at the moment.
Offset rotation for projectile weapons
Spoiler:
If you aim straight up, projectiles are normally fired from the middle of the screen. This makes the projectile spawn a bit in front of you (below the screen) instead. Particularly useful for 3d model plane projectiles which would otherwise be invisible.
A_spawnitemex
(
"rocket",
-sin(pitch)*12, //spawns missile 12 units in front of player when looking straight up.
0, //spawns in the middle of the screen. This should be a positive value if you have an angled gun sprite I think.
height/2, //height at where the projectile spawns. I put half the playere's height here for the sake of simplicity.
cos(pitch), //how much the horizontal speed of the projectile is multiplied. It's 0 when you look straight up.
0,
-sin(pitch), //multiplier for vertical speed. 1.0 when you look straight up.
0,
SXF_MULTIPLYSPEED
)
Last edited by kodi on Tue May 24, 2016 4:24 pm, edited 1 time in total.
Well, then I'm sorry to break this to you but this doesn't work with 2.x. :S Moreover, Graf is slowly bringing back a fallback renderer into GZDoom so very soon there will be no more need for separate 1.x and 2.x branches - everything will be merged into 1 program and GZDoom will automatically "downgrade" the renderer to the shaderless pipeline if it detects that your system can't run the latest OpenGL. What that all finally amounts to is that your effect won't work with users who use the main GZDoom renderer, it will only work with users who use GZDoom's fallback renderer...
(If you look at the recent commits on the GZDoom repo, almost the whole bulk of it lately has been nothing but work on said fallback renderer)