[ACS] SetPointer (builds on SetActivator extension)

Moderator: GZDoom Developers

Post Reply
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

[ACS] SetPointer (builds on SetActivator extension)

Post by FDARI »

New function: bool SetPointer(int assign_slot, int tid[, int pointer_selector[, int flags]])

Assign slot: Select what pointer to assign, out of target, master and tracer. (AAPTR_TARGET,AAPTR_MASTER,AAPTR_TRACER)
Tid: Tid of actor to point to. (First actor found is chosen)
Pointer_Selector: Optional; copy one of the selected actor's pointers instead of pointing directly to it.
Flags: Flags that affect the pointer operation (optionally skipping some safeguards)

Return value: Returns true if a non-null pointer was found (using the combination of tid and pointer_selector), false otherwise.

Related modifications:

This patch builds on changes made in SetActivator extended with AAPTR. This patch duplicates the other patch, and adds the new function.

Less evidently related modifications:

When scripting my demo, it transpired that [wiki]GetActorViewHeight[/wiki] cannot take tid 0 as a parameter (as of around version 2.4.1). Fixing this was as simple as to write "activator" instead of "NULL" as the default result from looking up a single actor by TID. Since I needed/wanted it for the demo, I made the change. I can make a patch without this change if that is preferred.

The demo
Doom imps with most wicked tracing projectiles. Inspired by some reference to path-tracing corner-turning projectiles in quake.
Attachments
setpointer_setactivator.zip
(3.36 KiB) Downloaded 58 times
SuperTracerImps.pk3
(2.95 KiB) Downloaded 61 times
User avatar
Demolisher
Posts: 1749
Joined: Mon Aug 11, 2008 12:59 pm
Graphics Processor: nVidia with Vulkan support
Location: Winchester, VA
Contact:

Re: [ACS] SetPointer (builds on SetActivator extension)

Post by Demolisher »

Came buckets.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49245
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [ACS] SetPointer (builds on SetActivator extension)

Post by Graf Zahl »

Added, but this required quite a bit of cleanup. Static functions in headers should be a big No-No.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: [ACS] SetPointer (builds on SetActivator extension)

Post by FDARI »

I'm reviewing your solution for a quick lesson on how better to avoid code duplication. Separate source file, I see. This makes very much sense. And the inlineable class & instance-specific code... is an inline function of that class. Simple lessons in the end. You also opted not to keep masquerading COPY_AAPTR with a define, which makes sense. It had become a pointless intermediate definition.

I don't know if there's anything else I should pick up on.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”