[ACS] SetPointer (builds on SetActivator extension)

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] SetPointer (builds on SetActivator extension)

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

by FDARI » Mon Jun 13, 2011 4:57 am

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.

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

by Graf Zahl » Mon Jun 13, 2011 4:23 am

Added, but this required quite a bit of cleanup. Static functions in headers should be a big No-No.

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

by Demolisher » Sat Jun 11, 2011 10:54 am

Came buckets.

[ACS] SetPointer (builds on SetActivator extension)

by FDARI » Sat Jun 11, 2011 6:03 am

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 62 times

Top