A few issues I hope someone can help with

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!)
User avatar
AshHouswares
Posts: 86
Joined: Fri Jun 03, 2022 11:31 am
Graphics Processor: Not Listed

A few issues I hope someone can help with

Post by AshHouswares »

I recently had an idea. Is there a way to make rain fall around only the player paun as an alternative to making rain on the entire level?

Secondly, how do I lower the draw distance? I want more fog, like for example, a PS1 game has. I do not want the entire level visible if you look straight ahead. I want the draw distance much, much lower.

Also, is there a setting I can do or change to make the HUD SIZE always the size I choose without giving an option to change it? I want it set to the size just before full screen, so it shows bits on the screen of items and things but not a full hud.

Finally, I'm having a DIALOG issue I cannot seem to solve. In my dialogue lump, I have two seperate conversations (which are used for reading journals in the game). The first one works fine but the second one is completely inactive. It doesn't nothing no matter how much I try. Not sure why. I set the object to "conversation id = 2" AND made it match up with the id in the dialogue lump. However, both conversations in the lump both use the actor "openjournal". Would this be an issue? I'm sure I've done this successfully before using the same conversation actor in the previous level.
User avatar
difficultoldstuff
Posts: 35
Joined: Fri Jul 17, 2020 5:38 am
Operating System Version (Optional): Windows 7
Graphics Processor: nVidia with Vulkan support

Re: A few issues I hope someone can help with

Post by difficultoldstuff »

Hey there!

I might be able to help you out with the first problem, about the rain around the player, as I did exactly that in my upcoming mod. Raining on the entire level WILL kill the performance, so that's a good idea to limit it to some radius coordinates around the player pawn. You might also considering a custom pooling cycle for the rain effect entities to get it even faster without constantly spawning and destroying new objects.

So, let's see:

Step 1 - spawn your rain object.
Step 2 - choose a random position around the player in a given radius.
Step 3 (optional) - check if the ceiling surface of the sector in that position has the sky texture.
Step 4 - if so, move the rain object to that position.
Step 5- get wet.

Sharing my own random radius function, because why not. Granted, it might not be fastest or perfect in any way.

Code: Select all

Vector2, float GetRandomPosOnRadius(float _radStart, Vector2 _center, float _radEnd = 0)
{
        float _rad = _radStart;
        
        if (_radEnd != 0)
        {
            _rad = frandom(_radStart, _radEnd); // GET RANDOM RADIUS IN RANGE
        }
        
        float _angle = frandom(0, 360);
        
        float newX = _center.x + cos(_angle) * _rad;
        float newY = _center.y + sin(_angle) * _rad;
        
        return (newX, newY), _angle;
}

Return to “Scripting”