ACS CheckProximity

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!)

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: ACS CheckProximity

Re: ACS CheckProximity

by septicpig » Fri Jul 03, 2020 12:42 pm

That's because you weren't logged in at the time you made the post; you were posting as a guest.
LOL thank you Blue Shadow, I thought I was logged in at the time I made the post but I must have been half asleep and confused myself and never properly signed in.
As a final question: have you tried standing near the imp for a second or so?
I have, yes. I am certain it is Zandronum limitations at this point as I have had a lot of success with other ACS scripting/editing at this point.

Thank you for your time and assistance, Jarewill!

Re: ACS CheckProximity

by Jarewill » Thu Jul 02, 2020 12:32 am

septicpig wrote:I did some deeper research and sadly, I think CheckProximity is missing from Zandronum's engine. I started suspecting it was the source port because I have exhuasted all other possibilities. So, I'm assuming you are using GZDoom? Zandronum 3.0 runs on a much older version of GZDoom apparently and it prevents all sorts of advanced features from carrying over. SO SAD. This should probably be on the Wiki. Maybe I will try to edit it.
Yes, I'm using GZDoom.
It seems Zandronum doesn't support this function, as the script ran fine for me.

As a final question: have you tried standing near the imp for a second or so?
The script restarts every second, so it doesn't update instantly when there's an imp around.

If that doesn't work, then Zandronum might simply not support it. Sorry.

Re: ACS CheckProximity

by Blue Shadow » Wed Jul 01, 2020 7:37 pm

septicpig wrote:(I have no idea why it says my name is Nigel Sablingmone and I cannot edit the message, but I am the original poster.)
That's because you weren't logged in at the time you made the post; you were posting as a guest.

Re: ACS CheckProximity

by septicpig » Wed Jul 01, 2020 6:56 pm

I did some deeper research and sadly, I think CheckProximity is missing from Zandronum's engine. I started suspecting it was the source port because I have exhuasted all other possibilities. So, I'm assuming you are using GZDoom? Zandronum 3.0 runs on a much older version of GZDoom apparently and it prevents all sorts of advanced features from carrying over. SO SAD. This should probably be on the Wiki. Maybe I will try to edit it.

Here is the attached .wad if you want to try it anyway, but I think I the case is closed unless you know of some miracle cure.

Thank you for your help and for helping me reach a conclusion to this!
Attachments
proxtest.wad
(2.08 KiB) Downloaded 14 times

Re: ACS CheckProximity

by septicpig » Wed Jul 01, 2020 3:14 pm

OMG it works for you? That is a huge relief, first of all.

Yes, I do have zcommon.acs included. I have a few other scripts that are working so I know the scripting area in Doom Builder X compiles and runs when the map starts, or on ENTER. Also I have a script in my wad's A_START A_END markers that works. And this CheckProximity script is running, too, because the "else" in the "if" conditional returns, so I know the script runs and is trying the function, I just can't tell if the function is being recognized or not. I don't think I saw anything in the console about it, but maybe I should look again.

I don't know how to check if the script is named BEHAVIOR. Should I open my .wad in Slade3 and look for that? I have not read about BEHAVIOR before, I will look that up. Is this the default script name for a map's local script? I normally edit local map scripts directly through a map builder.

Could you tell me what "environment" setup you are using? Builder/ACC/Source Port/etc? Are you testing the map by launching the "test map" feature of a builder? Any info would be helpful. I feel like maybe something on my end is not configured right, or I'm using an outdated version of something. It is strange that the wiki example running in vanilla doom2.wad on Zandronum 3.0 doesn't work.

As soon as I get to my computer later today I will check into the BEHAVIOR thing and also upload the ProximityCheck test.wad with the wiki example I am running.

Thanks for the assistance thus far!

Re: ACS CheckProximity

by Jarewill » Wed Jul 01, 2020 2:31 pm

Weird, the script works fine for me.

I have a few questions:
- Does the script start with this line?

Code: Select all

#include "zcommon.acs"
It's usually needed for scripts, though the script just wouldn't compile without it normally.

- Is the compiled script named "BEHAVIOR"
It should name itself that automatically if compiling the script in a wad with a map, but it might have not.

If both of those are true, then could you post your map?

Re: ACS CheckProximity

by septicpig » Wed Jul 01, 2020 10:26 am

(I have no idea why it says my name is Nigel Sablingmone and I cannot edit the message, but I am the original poster.)

I should start over with describing my problem. I was up late and lost the ability to explain myself clearly. Sorry! I was going a bit nuts trying to get this to work. :D

I am using Doom Builder X 2019.1 and running a test level with DOOM2.wad in Zandronum.
I placed a player and an Imp on the map, and used the example code from the wiki to test CheckProximity:

https://zdoom.org/wiki/CheckProximity

Code: Select all

Script "Shotgunguy_Checker" Enter
{
    if (CheckProximity(0, "DoomImp", 256.0, 1))
    {
        Print(s:"There's an imp somewhere around!");
    }
    else
    {
        Print(s:"There are no imps around.");
    }

    Delay(35);
    restart;
}
But when compiling this and testing it, the condition never responds with True condition, i.e. "There's an imp somewhere around!", it always returns "There are no imps around."
Also I noticed that the CheckProximity function is not highlighted and has no tooltip helpers when writing it in like other things. I made sure I have the latest ACC. I dont know how to update the config for syntax highlighting but I'm assuming that isn't causing the issue. I also read on another thread that this function needs to be used in DECORATE and not in ACS but that is not information available on the Wiki, it appears to be for ACS. But I'm starting to consider other causes at this point.

What could be preventing this from evaluating correctly? I can't figure out what the missing link is.
If it is helpful I can upload my test map, but again, it is just an imp in a room with the WIki script compiled.

Re: ACS CheckProximity

by Jarewill » Tue Jun 30, 2020 12:57 am

What exactly are you trying to do?
The only off thing I see with this is that it has SetActivator(0, AAPTR_NULL); there.
That sets the activator of the script to be the world instead of the player.
And I don't think it's quite possible to check if there's a medikit nearby, if there's no actor that checks it at all.

ACS CheckProximity

by Guest » Tue Jun 30, 2020 12:27 am

Hello

I am trying to get the distance of something to the nearest player in Doom. When I walk near the Medikit it still prints NOPE. I'm not sure where this is going wrong. I was able to give inventory to myself within this script, but I'm not sure if that is a good test to see if SetActivator is working. I was wondering if this is possible in ACS without any ZScript:

```
Script 2 ENTER
{
SetActivator(0, AAPTR_NULL);
if (CheckProximity(0, "Medikit", 256.0, 1, CPXF_ANCESTOR))
{
Print(s:"YUP!");
}
else
{
Print(s:"Nope.");
}
delay(35);
restart;
}
```

Top