Thing_ProjectileIntercept and AAPTR_TARGET:

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!)
Post Reply
User avatar
Ravick
Posts: 2003
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Thing_ProjectileIntercept and AAPTR_TARGET:

Post by Ravick »

Hi there,


So, I'm making a monster that spawns a secondary actor transfering its own pointers to this actor, and then such actor calls Thing_ProjectileIntercept. As the intention was to make the actor aim at the monster's current target, my 'intuitive' first try was:

Code: Select all

TNT1 A 1 Thing_ProjectileIntercept (0,1544,240,AAPTR_TARGET,0)
The '1544' is the spawnid of the projectile, of course.
However, because projectiles use "target" pointer to get the monster tat shoots then, it tried to hit the monster itself. I took a look here but I could not get if actually there is way to expose the monster's target to Thing_ProjectileIntercept.

If I manage to arbitrary change player's TID to a number, and set this number to the code line, it works just fine. However, the map must have coop support with different TIDs. It also must be "Zscript-free" because of Zandronum compatibility, and... requirements of the dev team.


Is there a way to get it DECORATE side? I'm guessing I could use ACS and ACS ExecuteWithResult to get it, but I'd preffer to keep it DECORATE only, if possible.

Thanks in advance! :)
User avatar
krokots
Posts: 266
Joined: Tue Jan 19, 2010 5:07 pm

Re: Thing_ProjectileIntercept and AAPTR_TARGET:

Post by krokots »

Use "tracer" for storing the actor that is the current monster target. Transfer "target" pointer from monster, to "tracer" pointer in projectile. Then use AAPTR_TRACER instead AAPTR_TARGET.
User avatar
Ravick
Posts: 2003
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Re: Thing_ProjectileIntercept and AAPTR_TARGET:

Post by Ravick »

Oh, I thought that only seeker missiles use it. Thanks, Krokots! :o
Post Reply

Return to “Scripting”