Arwel Posted May 6, 2022 I need to customize SuperShotgun to use my custom SSGPuff subclass of BulletPuff. The problem is that SSG uses https://zdoom.org/wiki/A_FireShotgun2 in its Fire state, which doesn't accept puff as parameter, so I need to define my own A_FireShotgun2_CustomPuff action duplicating existing one, but with minor modifications. So, how do I do that? I tried placing such action in decorate file, but it didn't work, I also tried putting in zscript file in multiple ways, which seemed to compile once, but then, this action is not visible from decorate file where I declare my CustomSSG and override its states. 0 Quote Share this post Link to post
Gez Posted May 6, 2022 To use ZScript stuff in DECORATE, your DECORATE actor needs to inherit from your ZScript actor. 1 Quote Share this post Link to post
Arwel Posted May 6, 2022 5 minutes ago, Gez said: To use ZScript stuff in DECORATE, your DECORATE actor needs to inherit from your ZScript actor. Thank you! In case anyone wonders, the working structure is: zscript: class SuperShotgunWithActions : SuperShotgun { action void A_FireShotgun2_CustomPuff() { // ... } } decorate: actor CustomSSG : SuperShotgunWithActions replaces SuperShotgun { ... } 1 Quote Share this post Link to post
ramon.dexter Posted May 9, 2022 You actually dont need decorate here. You can completely define the whole weapon directly in zscript. 0 Quote Share this post Link to post
Arwel Posted May 9, 2022 1 hour ago, ramon.dexter said: You actually dont need decorate here. You can completely define the whole weapon directly in zscript. Is it possible to define states in zscript? Here is what I do in decorate: actor CustomSSG : SuperShotgunWithActions replaces SuperShotgun { States { Fire: SHT2 A 3 SHT2 A 7 A_FireShotgun2_CustomPuff SHT2 B 7 SHT2 C 7 A_CheckReload SHT2 D 7 A_OpenShotgun2 SHT2 E 7 SHT2 F 7 A_LoadShotgun2 SHT2 G 6 SHT2 H 6 A_CloseShotgun2 SHT2 A 5 A_ReFire Goto Ready // unused states SHT2 B 7 SHT2 A 3 Goto Deselect } } 0 Quote Share this post Link to post
ramon.dexter Posted May 9, 2022 (edited) class CustomSSG : SuperShotgunWithActions replaces SuperShotgun { States { Fire: SHT2 A 3; SHT2 A 7 A_FireShotgun2_CustomPuff(); SHT2 B 7; SHT2 C 7 A_CheckReload(); SHT2 D 7 A_OpenShotgun2(); SHT2 E 7(); SHT2 F 7 A_LoadShotgun2(); SHT2 G 6(); SHT2 H 6 A_CloseShotgun2(); SHT2 A 5 A_ReFire(); Goto Ready; // unused states SHT2 B 7; SHT2 A 3; Goto Deselect; } } No problem. Edited May 9, 2022 by ramon.dexter 1 Quote Share this post Link to post
Arwel Posted May 9, 2022 1 hour ago, ramon.dexter said: ... No problem. Thanks, this way it's less messy. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.