NS's Decorate Resource: Using Arc of Death from a Monster

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!
Post Reply
User avatar
NeuralStunner
 
 
Posts: 12326
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

NS's Decorate Resource: Using Arc of Death from a Monster

Post by NeuralStunner »

Using Arc of Death from a Monster:
I've made this incredible discovery today. I figured it could in handy to someone else...

Sure, you can do this:

Code: Select all

		MAGE F 0 A_CustomMissile ("LightningCeiling", 48, 0, 0, CMF_TRACKOWNER, 0)
		MAGE F 6 A_CustomMissile ("LightningFloor", 48, 0, 0, CMF_TRACKOWNER, 0)
But it just doesn't work quite right - the arc tends to pass right through enemies, and the two parts don't work together like they should. So how do you make it work?

The only codepointer that can pass the needed information is native to [wiki=Classes:MWeapLightning]MWeapLightning[/wiki]. But that's a hint: It doesn't necessarily have to be used from a weapon's Fire state. Let's inherit from that and make a new actor... but we add a twist:

Code: Select all

Actor ShotLightning : MWeapLightning
{
	+WEAPON.CHEATNOTWEAPON
	+WEAPON.NO_AUTO_SWITCH
	Weapon.AmmoGive 0
	Projectile
	Speed 32
	States
	{
	Spawn:
	Death:
		TNT1 A 0
		TNT1 A 1 A_MLightningAttack
		Stop
	}
}
That's right, it's a projectile. Now, to use the attack you simply add this wherever the monster would attack:

Code: Select all

		MAGE F 6 A_CustomMissile ("ShotLightning", 48, 0, 0, CMF_TRACKOWNER, 0)
Now as soon as the weapon/missile is fired, it fires a properly linked lightning pillar. Zap! Just don't get in the way. :twisted:

Note that this trick does not work with Frost Shards, about the only other weapon you'd want this trick for. That, however, could be simulated if you know all the angles/offsets for the fired FrostMissiles. (Incidentally, if anyone knows those, I would greatly appreciate having that info as well. =:) )

I may have some other tidbits later on. Enjoy!
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: NS's Decorate Resource: Using Arc of Death from a Monste

Post by Gez »

NeuralStunner wrote:(Incidentally, if anyone knows those, I would greatly appreciate having that info as well. =:) )
It'll be in the wiki eventually. But before documenting them, I'll finish the last [wiki=Classes:Beak]missing[/wiki] [wiki=Classes:BeakPowered]Heretic[/wiki] [wiki=Classes:Volcano]codepointers[/wiki]. Then it'll be Hexen's turn; and finally Strife's.
Post Reply

Return to “Resources”