LightwaveAlice Posted March 17, 2019 I've been working on a power weapon powerup using PowerWeaponLevel2 that simulates Skulltag's Spread Rune. I have gotten it to work, however I had to make a "fake" rocket launcher that inherits from the original in order to make that and the spread rocket launcher sister weapons. Is it possible to make the vanilla weapons sister weapons instead of having to make entirely new ones that inherit from them? I feel like it would save me a lot of time from coding and editing all my maps for my megawad if I could do that. Any alternate methods of making a spread powerup are also welcome. Here's my code so far. Actor SpreadSphere : PowerupGiver { +CountItem +NoGravity +Inventory.AutoActivate +Inventory.AlwaysPickup Inventory.MaxAmount 0 Powerup.Type PowerWeaponLevel2 Powerup.Duration 1050 Inventory.PickupMessage "Spreadsphere!" States { Spawn: WOND ABC 6 Bright Loop } } Actor SpreadRocketLauncher : RocketLauncher { +POWERED_UP Weapon.AmmoGive 0 Weapon.SisterWeapon RocketLauncher States { Fire: MISG B 8 A_GunFlash MISG B 0 A_FireProjectile("Rocket",-15) MISG B 0 A_FireProjectile("Rocket",0) MISG B 12 A_FireProjectile("Rocket",15) MISG B 0 A_ReFire Goto Ready Flash: MISF A 3 Bright A_Light1 MISF B 4 Bright MISF CD 4 Bright A_Light2 Goto LightDone } } Actor FakeRocketLauncher : RocketLauncher { Weapon.SisterWeapon SpreadRocketLauncher } 0 Share this post Link to post
Empyre Posted March 18, 2019 Actor FakeRocketLauncher : RocketLauncher replaces RocketLauncher { Tag "Rocket Launcher" Weapon.SisterWeapon SpreadRocketLauncher } With this, wherever the map has a rocket launcher, it will automatically be replaced by your FakeRocketLauncher. If you want to replace the pistol or fist, it won't be as simple. You will have to make a custom player class that starts with your pistol and your fist, and make sure that the player plays as that class. 0 Share this post Link to post
LightwaveAlice Posted March 18, 2019 1 hour ago, Empyre said: Actor FakeRocketLauncher : RocketLauncher replaces RocketLauncher { Tag "Rocket Launcher" Weapon.SisterWeapon SpreadRocketLauncher } With this, wherever the map has a rocket launcher, it will automatically be replaced by your FakeRocketLauncher. If you want to replace the pistol or fist, it won't be as simple. You will have to make a custom player class that starts with your pistol and your fist, and make sure that the player plays as that class. That helps with the map editing bit, but I would still like to not have to replace it at all. As for the fist and pistol, it would be kinda pointless to apply it to a melee weapon and why use the pistol when pretty much every other gun is way more effective anyway? Thanks for the suggestion tho. Not ideal, but useful if I can't find any other solution. 0 Share this post Link to post
Gez Posted March 18, 2019 7 hours ago, Empyre said: With this, wherever the map has a rocket launcher, it will automatically be replaced by your FakeRocketLauncher. Yes, but that's only half the battle since for weapons you also need to deal with weapon slots. For example, if a player uses idkfa, they'll get both the normal and the "fake" rocket launchers if you don't redefine the player class entirely. This is very cumbersome but there is no way to change default properties other than what you can do with DeHackEd. And DeHackEd cannot handle ZDoom properties like sister weapons, blood colors, etc. 0 Share this post Link to post
LightwaveAlice Posted March 18, 2019 10 hours ago, Gez said: Yes, but that's only half the battle since for weapons you also need to deal with weapon slots. For example, if a player uses idkfa, they'll get both the normal and the "fake" rocket launchers if you don't redefine the player class entirely. This is very cumbersome but there is no way to change default properties other than what you can do with DeHackEd. And DeHackEd cannot handle ZDoom properties like sister weapons, blood colors, etc. Yeah, I really wish there was a better way to do this. Plus I can't figure out how to get the hitscan weapons to spread like the projectile weapons. :( 0 Share this post Link to post
Empyre Posted March 18, 2019 4 hours ago, Skully Boots said: Yeah, I really wish there was a better way to do this. Plus I can't figure out how to get the hitscan weapons to spread like the projectile weapons. :( https://zdoom.org/wiki/A_FireBullets Use the FBF_EXPLICITANGLE flag, and the Horizontal and Vertical angles you set will use used as explicit angles, rather than a spread. You can make formulas using the Random(min,max) function if you want there to still be a random element. As an example, to shoot a SSG 15 degrees to the left as one of the three angles of the spread, you would do this: TNT1 A 0 A_FireBullets (Random(-5.6,5.6)-15, Random(-3.5,3.6), 20, 5, "BulletPuff",FBF_EXPLICITANGLE) The normal spread is 11.2 and 7.1, so I halved them for the random functions. For the right side, you would use +15 instead of -15. This will help you find the angles and other numbers for the other weapons' attacks: https://zdoom.org/wiki/Classes:DoomWeapon 0 Share this post Link to post
LightwaveAlice Posted March 21, 2019 On 3/18/2019 at 6:30 PM, Empyre said: https://zdoom.org/wiki/A_FireBullets Use the FBF_EXPLICITANGLE flag, and the Horizontal and Vertical angles you set will use used as explicit angles, rather than a spread. You can make formulas using the Random(min,max) function if you want there to still be a random element. As an example, to shoot a SSG 15 degrees to the left as one of the three angles of the spread, you would do this: TNT1 A 0 A_FireBullets (Random(-5.6,5.6)-15, Random(-3.5,3.6), 20, 5, "BulletPuff",FBF_EXPLICITANGLE) The normal spread is 11.2 and 7.1, so I halved them for the random functions. For the right side, you would use +15 instead of -15. This will help you find the angles and other numbers for the other weapons' attacks: https://zdoom.org/wiki/Classes:DoomWeapon Thanks, that's pretty useful for the hitscan weapons. 0 Share this post Link to post
Empyre Posted March 21, 2019 49 minutes ago, Skully Boots said: Thanks, that's pretty useful for the hitscan weapons. I have discovered that you will need to use FRandom, instead of Random, which is for integers only. 0 Share this post Link to post
LightwaveAlice Posted March 28, 2019 On 3/21/2019 at 1:34 AM, Empyre said: I have discovered that you will need to use FRandom, instead of Random, which is for integers only. Ah okie, thanks 0 Share this post Link to post