[SOLVED] [ACS] Problem with Thing_ProjectileIntercept

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.

[SOLVED] [ACS] Problem with Thing_ProjectileIntercept

Postby Void Weaver » Fri Nov 15, 2019 1:54 pm

For a some reason Thing_ProjectileIntercept doesn't work in my case. Where is mistake here?

Test actors:
Code: Select allExpand view
ACTOR IntImp : DoomImp replaces DoomImp
{
States
{
Missile:
TROO EF 8 A_FaceTarget
TROO G 3 A_GiveToTarget("TIDChanger") //Test line to be sure that target's TID different from 0. It changes player TID but Thing_ProjectileIntercept still not work
TROO G 3 ACS_NamedExecute("InterceptionStrike",0)
Goto See
}
}

ACTOR TIDChanger: CustomInventory
{
+INVENTORY.ALWAYSPICKUP
Inventory.MaxAmount 0
States
{
Pickup:
TNT1 A 0 Thing_ChangeTid(0,FindUniqueTid(0,0))
Stop
}
}

ACTOR IntCacoBall : CacodemonBall
{
SpawnID 666
}


ACS itself:
Code: Select allExpand view
#include "zcommon.acs"

Script "InterceptionStrike" (void)
{
int TargetTid=GetActorProperty(0,APROP_TargetTID); //Here it should receive shooter's target TID
int InterceptTid=Thing_ChangeTID(TargetTid,UniqueTID(0,0)); //Here it should change its target's TID to an unique one
Thing_ProjectileIntercept(0,666,255,InterceptTid,0); //Now projectile should be fired but it doesn't
PlaySound(0,"brain/pain"); //Test line
Delay(35*5); //Test line, time gap
Thing_ChangeTID(InterceptTid,TargetTid);
}
Last edited by Void Weaver on Sun Nov 17, 2019 8:10 am, edited 1 time in total.
User avatar
Void Weaver
Keeper of the Diablo bestiary storage Also amateur DECORATE-spaghetti weaver ಠ_ಠ
 
Joined: 18 Dec 2014

Re: [ACS] Problem with Thing_ProjectileIntercept

Postby Blue Shadow » Sat Nov 16, 2019 1:30 pm

Void Weaver wrote:
Code: Select allExpand view
int InterceptTid=Thing_ChangeTID(TargetTid,UniqueTID(0,0));

Thing_ChangeTID always returns true (1), not the newly set TID, as you may think.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: [SOLVED] [ACS] Problem with Thing_ProjectileIntercept

Postby Void Weaver » Sun Nov 17, 2019 8:14 am

Oh, thank you very much! ^_^

Now it works perfect:
Code: Select allExpand view
Script "InterceptionStrike" (void)
{
int TargetTid=GetActorProperty(0,APROP_TargetTID);
Thing_ChangeTID(TargetTid,UniqueTID(0,0));
int InterceptTid=GetActorProperty(0,APROP_TargetTID);
Thing_ProjectileIntercept(0,666,255,InterceptTid,0);
Thing_ChangeTID(InterceptTid,TargetTid);
}

I guess that Thing_ChangeTID return meaning should be pointed into its wiki article.
---
Btw, there is a some ACS way to change spawn height of missile fired by Thing_ProjectileIntercept? I've managed to did Thing_ProjectileIntercept shot with taking spawn height into account fully on deco but solution is quite spaghettysh.
User avatar
Void Weaver
Keeper of the Diablo bestiary storage Also amateur DECORATE-spaghetti weaver ಠ_ಠ
 
Joined: 18 Dec 2014

Re: [SOLVED] [ACS] Problem with Thing_ProjectileIntercept

Postby Blue Shadow » Sun Nov 17, 2019 12:45 pm

Void Weaver wrote:I guess that Thing_ChangeTID return meaning should be pointed into its wiki article.

I don't see a valid reason to do so.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: [SOLVED] [ACS] Problem with Thing_ProjectileIntercept

Postby Void Weaver » Sun Nov 17, 2019 12:57 pm

But why? o_0
User avatar
Void Weaver
Keeper of the Diablo bestiary storage Also amateur DECORATE-spaghetti weaver ಠ_ಠ
 
Joined: 18 Dec 2014


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest