D2Jk Posted August 9, 2014 Hello, I'll explain this a bit first. I made a custom flaregun for Heretic, which uses PoisonDamage, and a visual flare sprite that sticks to the monsters for the duration. In lack of a better way to implement this, I give the flare projectile a custom damagetype "Flare", and make the monsters always go to the Pain state when hit by this damagetype, in which they spawn the sticky flare sprite. Each monster uses their own customised sticky flare actor to ensure that the flare sprite sticks to the correct height (chest). Since the chest height is different for most monsters (heretic imp vs undead knight, for example), a little tweaking is necessary here. Here's a sample code for one of the monsters:PainChance "Flare", 256 ... Pain.Flare: TNT1 A 0 A_SpawnItemEx("StickyFlareMummy", 0,0,0 , 0,0,0 ,0, SXF_SETMASTER) Goto See The sticky flare actor for this monster: ACTOR StickyFlareMummy { ReactionTime 180 MONSTER +NOGRAVITY +NOCLIP States { Spawn: FLAR A 0 A_ReArrangePointers(AAPTR_MASTER) FLAR A 0 A_CountDown FLAR A 1 A_Warp(AAPTR_TARGET, 8,0,36, 0, WARPF_NOCHECKPOSITION | WARPF_INTERPOLATE) Loop } } Now, all this works well enough for skill levels 1-4 in Heretic, but for some strange reason not on skill 5 (black plague possesses thee); the sticky flare sprites just won't appear. I guess I would need to know what mechanics (?) exactly does the highest skill level change, that might disrupt the code above. Anyone? -- And as always, if someone has a smarter way to do these sticky flares, I'm all ears. If there was a lot of different monster types, it would get laborous to do it this way, as you have to customize the flare position for each monster type (though not for color variations and such, where the size/height doesn't change). Also, it would be great to have the flare to stick to where it actually hit the monster, not just to some predefined position like I'm doing here. But I realize that might not be easily accomplished. :-) 0 Quote Share this post Link to post
Blue Shadow Posted August 10, 2014 In that difficulty setting, a monster's ReactionTime is set to 0, normally; this is part of the "fast monsters" behavior in the highest difficulty settings. Your sticky flare actor is considered a monster, due to having the Monster combo flag, so it's affected. And since you're using ReactionTime as a counter, you know what happens when it reaches 0. The easiest solution for this, is to put the NEVERFAST flag on the sticky flare actor. This way, the ReactionTime will not be touched. 0 Quote Share this post Link to post
D2Jk Posted August 10, 2014 That did it! Such a simple fix too, thank you very much. :-) 0 Quote Share this post Link to post
D2Jk Posted September 15, 2014 I have the flares working almost 100% as planned. Recently I even made them check if there are multiple active on the actor, and if so, the sticky flare will use a different color. But there's one lasting problem still. If the red gargoyle is hit by the flare while it is charging at the player, he won't enter the Pain.Flare state at all, for some reason. In this case the visual flare won't appear, since it's spawned in the Pain.Flare state. This problem applies to all difficulty levels. Do you happen to know if the A_ImpMsAttack / A_SkullAttack functions are known to cause problems like this, by any chance? 0 Quote Share this post Link to post
Blue Shadow Posted September 15, 2014 D2Jk said:Do you happen to know if the A_ImpMsAttack / A_SkullAttack functions are known to cause problems like this, by any chance? A_SkullAttack sets a flag, which is called SKULLFLY. While having the flag, the actor will not enter its pain state among other things. 0 Quote Share this post Link to post
D2Jk Posted September 15, 2014 You sure are a knowledgeable fellow. :-) As for the problem, time to put the thinking cap on... EDIT: Just a bit of tweaking required still, but this seems to work: Missile: IMPX A 10 A_FaceTarget IMPX B 6 A_ImpMsAttack TNT1 A 0 A_ChangeFlag("SKULLFLY", 0) IMPX CBAB 6 A_JumpIf(velx == 0, "See") Goto Missile+3 Without the velocity check, the imp would not return to See state, even when stationary after hitting something. EDIT 2: This is fun too: Missile: IMPX A 5 A_FaceTarget IMPX B 5 A_SkullAttack(12) TNT1 A 0 A_ChangeFlag("SKULLFLY", 0) IMPX CBAB 5 A_JumpIfCloser(100, "StopCharge") TNT1 A 0 A_JumpIf(velx == 0, "See") Goto Missile+3 StopCharge: IMPX DDDD 1 A_ScaleVelocity(.85) TNT1 A 0 A_ChangeVelocity(velx,vely,0, CVF_REPLACE) Goto Melee They slightly slow down when close to their target, while at the same time preparing for the melee attack ("IMPX D" is the first sprite of the melee animation). If the target dodges, they fly past while still melee'ing. The A_SkullAttack here causes them to charge 100% of the time, unlike A_ImpMsAttack's 25% chance. Things get rather hectic in highest skill level, as they're constantly entering the Missile state as long as they can see their target. 0 Quote Share this post Link to post
Gez Posted September 15, 2014 D2Jk said:You sure are a knowledgeable fellow. :-) As for the problem, time to put the thinking cap on... EDIT: Just a bit of tweaking required still, but this seems to work: Missile: IMPX A 10 A_FaceTarget IMPX B 6 A_ImpMsAttack TNT1 A 0 A_ChangeFlag("SKULLFLY", 0) IMPX CBAB 6 A_JumpIf(velx == 0, "See") Goto Missile+3 You'd probably want to do that the other way around: Missile: IMPX A 10 A_FaceTarget IMPX B 0 A_ImpMsAttack IMPX B 6 A_ChangeFlag("SKULLFLY", 0) IMPX CBAB 6 A_JumpIf(velx == 0, "See") Goto Missile+3 So that A_ChangeFlag is called immediately after A_ImpMsAttack, and not six ticks later. 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.