Page 1 of 1
[ACS] Way For Player To Fire Projectile?
Posted: Sat May 21, 2022 12:13 pm
by Chubbs
Hi all. I'm trying to get a universal subweapon system to work and I did through Decorate, but I wasn't satisfied with it and wanted something that could be done at any time. I implemented the graphics through ACS with no problem, but now I'm trying to figure out a way to actually get the player to fire the projectiles.
I see that there is SpawnProjectile but it doesn't seem to work for me when being activated by the player and also even if I did get it to work I'm not sure it would account for the player's angle and pitch. Any ideas? Thanks!
Re: [ACS] Way For Player To Fire Projectile?
Posted: Sat May 21, 2022 6:54 pm
by Blue Shadow
Probably the easiest solution is to give the player a CustomInventory item that calls A_FireProjectile in its Pickup state.
Re: [ACS] Way For Player To Fire Projectile?
Posted: Sun May 22, 2022 12:54 am
by Chubbs
Blue Shadow wrote:Probably the easiest solution is to give the player a CustomInventory item that calls A_FireProjectile in its Pickup state.
This worked PERFECTLY! I didn't know that you could use CustomInventory in such a way. Thank you!
Re: [ACS] Way For Player To Fire Projectile?
Posted: Sun May 22, 2022 12:57 am
by Chubbs
Just in case anyone is looking at this later and wondering:
Here's the Decorate
Code: Select all
actor SubWeaponFire: CustomInventory // Credit to Blue Shadow on Zdoom forums for answering my question with this solution!
{
states
{
Spawn:
TNT1 A -1
stop
Pickup:
TNT1 A 0 A_FireCustomMissile ("Subweapon",Frandom(-0.25,0.25),0,-4,16,0,Frandom(-0.15,0.15))
stop
}
}
And this is what's in the ACS Script
Code: Select all
If(GetPlayerInput(-1, INPUT_BUTTONS) & BT_USER1)
{
GiveInventory("SubWeaponFire",1);
TakeInventory("SubWeaponAmmo",2);
}