Weapon Improvement
- cmw1986
- Topic Author
- Wraith
- Posts: 17
I have a weapon that needs fixing to behave how I want for it to do.
My weapon is fireworks that are supposed to stop an enemy in its tracks when the enemy comes across one after the player places one on the ground (the enemy also enters and stays in pain state without taking any pain/damage which is what I already have so far). Then the firework is supposed to activate itself and launch straight up into the sky and take the enemy along with it! (which eventually blows up and kills the enemy). Sound pretty cool, eh?!.
How do I go by accomplishing this task?. What actually really needs to be fixed with the weapon's codes is probably just the FireworksLighting actor, but I could be wrong. Here are the current codes for the fireworks and an enemy (replaces rifle zombies) to help you with this neat idea:
Please Log in or Create an account to join the conversation.
- MagicWazard
- Moderator
- Posts: 808
Also, for real long posts like this, you may want to spoiler out the contents, so as to prevent the need to perform lots of scrolling.
Please Log in or Create an account to join the conversation.
- cmw1986
- Topic Author
- Wraith
- Posts: 17
@Blue Shadow: do you know what to do about my request/problem here?...
Peace!
-cmw1986
Please Log in or Create an account to join the conversation.
- MagicWazard
- Moderator
- Posts: 808
*Right before the firework projectile "dies" and spawns its pyrotechnic effects, set its damage type to a new type (e.g. "FireworkDeath") using A_SetDamageType. Ensure it deals at least 1 point of damage using this new type.
*Give your monster a pain chance of 256 for the new damage type "FireworkDeath". Also give it a new pain state; Pain.FireworkDeath.
*In the monster's Pain.FireworkDeath state, set the monster's mass to 0 using A_SetMass; give the monster the NOGRAVITY flag using A_ChangeFlag; then, use ThrustThingZ to launch it into the air. Once it reaches an appropriate height (matching the firework pyrotechnics' height), you can then have the monster kill itself somehow.
Please Log in or Create an account to join the conversation.
- cmw1986
- Topic Author
- Wraith
- Posts: 17
Please Log in or Create an account to join the conversation.
- cmw1986
- Topic Author
- Wraith
- Posts: 17
@Blue Shadow: with your skill at coding, I'm hoping you can help me solve my problem with my situation here. Do you have any ideas how to fix this issue I'm having?.
Please Log in or Create an account to join the conversation.
- Blue Shadow
- Administrator
- Posts: 1129
Please Log in or Create an account to join the conversation.
- MagicWazard
- Moderator
- Posts: 808
Please Log in or Create an account to join the conversation.
- cmw1986
- Topic Author
- Wraith
- Posts: 17
MagicWazard wrote: In the meanwhile, I came up with an idea:
*Right before the firework projectile "dies" and spawns its pyrotechnic effects, set its damage type to a new type (e.g. "FireworkDeath") using A_SetDamageType. Ensure it deals at least 1 point of damage using this new type.
*Give your monster a pain chance of 256 for the new damage type "FireworkDeath". Also give it a new pain state; Pain.FireworkDeath.
*In the monster's Pain.FireworkDeath state, set the monster's mass to 0 using A_SetMass; give the monster the NOGRAVITY flag using A_ChangeFlag; then, use ThrustThingZ to launch it into the air. Once it reaches an appropriate height (matching the firework pyrotechnics' height), you can then have the monster kill itself somehow.
With this being said, can you show me an updated example of the DECORATE codes in my first post?. After that, I'll test it out and let you know the results sometime later on...
-cmw1986
Please Log in or Create an account to join the conversation.
- MagicWazard
- Moderator
- Posts: 808
cmw1986 wrote: With this being said, can you show me an updated example of the DECORATE codes in my first post?. After that, I'll test it out and let you know the results sometime later on...
-cmw1986
Maybe I wasn't clear--when I said a "working" version, I didn't mean one that "worked correctly"; just something that ran that I could play with to see what happened. Barring that, may you at least post the sprites you're using for the fireworks? That would make it much easier to try ideas out, especially if the rest of the DECORATE hasn't changed yet.
Please Log in or Create an account to join the conversation.