Spawning Conditions

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
Sir Robin
Posts: 399
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Spawning Conditions

Post by Sir Robin »

looks like you clipped off part of an IF statement. Check your code against what I posted and you'll see it
User avatar
Misery
Posts: 157
Joined: Sun Nov 04, 2018 4:57 pm

Re: Spawning Conditions

Post by Misery »

My apologies. I did fix it, but the error remains the same. The game isn't recognizing those two specific identifiers.
User avatar
Sir Robin
Posts: 399
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Spawning Conditions

Post by Sir Robin »

both identifiers are created in the IsPlayerLooking function

Code: Select all

    bool isPlayerLooking(int PlayNum)
    {
        if (!players[playnum].mo.CheckSight(self, SF_IGNOREVISIBILITY | SF_SEEPASTSHOOTABLELINES | SF_SEEPASTBLOCKEVERYTHING | SF_IGNOREWATERBOUNDARY)) return false;

        double PlayAng = players[playnum].mo.angle;  // PlayAng is created here
        double AngleToMe = players[playnum].mo.AngleTo(self);
        double AngleDiff = AbsAngle(AngleToMe, PlayAng); // AngleDiff is created here
        double PlayFovRange = players[playnum].fov / 2;

        return AngleDiff < PlayFovRange;
    }
 
so if it's not finding them it's because you changed something
User avatar
Misery
Posts: 157
Joined: Sun Nov 04, 2018 4:57 pm

Re: Spawning Conditions

Post by Misery »

Sir Robin wrote: both identifiers are created in the IsPlayerLooking function

so if it's not finding them it's because you changed something
Okay, so I guess maybe somethin' is case or space sensitive. I usually prefer to write a certain way to make it easier for me to read, but I'll keep workin' on it 'til I find the issue. Thank you again for the help.
User avatar
Misery
Posts: 157
Joined: Sun Nov 04, 2018 4:57 pm

Re: Spawning Conditions

Post by Misery »

Yes, I found what I missed. I didn't see the "return false;" you added to the if conditional 'cause the page cut if off. I thought the if conditional you were referrin' to was the one fore it. So it works now, but I have to revise the ACS if/else conditional. But that I can do. Thanks for the help. I think it's goin' to work now.

Return to “Scripting”