A_RadiusGive and A_CheckProximity

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 ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: A_RadiusGive and A_CheckProximity

Re: A_RadiusGive and A_CheckProximity

by Elpoder_36 » Tue Jul 18, 2023 4:44 pm

Major Cooke escribió:
> The AAPTR_ system is completely deprecated with ZScript's presence. It only
> exists because at the time, there was no other way to access pointers. In
> ZScript, not only do you have access to pointers, you can create your own
> for any class you make.
>
> I advise you to learn how to work with ZScript instead.

Ah well well. I'm new to this editing stuff, I've been doing well with Slade (Decorate) and some ACS. I'll take the advice and go learn some Zscript which should be more complete.

I take this opportunity to ask, if also from Zscript or from Decorate it is possible to restrict to the "Friendlys" monsters the action of setting the target to another friendly or player, since in a standard way it can not be done to

Thanks for your answers!

Re: A_RadiusGive and A_CheckProximity

by Major Cooke » Tue Jul 18, 2023 12:06 am

The AAPTR_ system is completely deprecated with ZScript's presence. It only exists because at the time, there was no other way to access pointers. In ZScript, not only do you have access to pointers, you can create your own for any class you make.

I advise you to learn how to work with ZScript instead.

Re: A_RadiusGive and A_CheckProximity

by MartinHowe » Mon Jul 17, 2023 10:37 am

Sadly, it would be very hard to do this as ZScript stands. In C# we have predicates or callbacks and a yield mechanism. The best we can do right now is to use a block things iterator. The following is a snippet from code I'm using at the moment:

Code: Select all

void find_stuff(double radius)
{
    double radyus = (radius / MAPBLOCKUNITS); // input to the iterator is in these, not map units
    BlockThingsIterator bli = BlockThingsIterator.Create(self, radyus+self.radius);
    while (bli.Next())
    {
        actor mo = bli.thing;
        // Filter out ones you don't want
        if (Distance2D(mo) > raydius) continue; // needed as bli distances are approximate
        if (!mo.bIsMonster && !mo.player) continue;
        if (self.IsFriend(mo)) continue;
        if (mo == self) continue;
        if (mo.health <= 0) continue;
        if (!mo.bShootable) continue;
        if (!origin.CheckSight(mo)) continue;
        // Do stuff with each actor found
    }
}

A_RadiusGive and A_CheckProximity

by Elpoder_36 » Sun Jul 16, 2023 1:50 pm

I find myself often limited as I feel it lacks more filters or flags to be able to make it more specific to which actors I want the function to go to.
In the case of CheckProximity, it only filters by class, I would like very much that there is a condition for a certain item that the actor to check has, for example, If this or that actor nearby in a radius of 512 that has "item". In this way many more things could be done making this tool more useful.
In RadiusGive, let there be more filters too, or more flags like "closset" or better yet, have a new pointer called "AAPTR_GIVER" referring to the actor who gave the item to others and that information can be taken from the "use" of the item activated by those who received the item.
I feel these are very useful functions for those of us who edit, and need more filtering.
Thank you very much for reading this. Regards.

Top