Legacy:ShockBeamEffect

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 18:28, 22 January 2003 by imported>Tarquin
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
UT2003 :: Actor >> xEmitter >> ShockBeamEffect (Package: xWeapons)

Properties

vector HitNormal 
HunterKiller: The HitNormal is an orthogonal vector to the hit location. Like, If you are facing a wall, and you shoot it, the hit location vector is a line from you to the wall. The normal of this line is the wall. (I thought I should explain this somewhere) :)

Methods

AimAt (Vector hl, Vector hn) 
  • Set HitNormal property;
  • Tell the clients to create the visual effects if not a Dedicated Server;
SpawnEffects ( ) [simulated] 

In resume, this function finds where the effects should came from (like, the tip of the weapon's barrel)

  • If we are in 1st person, the muzzle flash spawn point is got from the Weapon GetEffectStart function;
  • In 3rd person, it uses the WeaponAttachment GetTipLocation function
  • Spawn some effects in the hit location, aligned to the hit normal;

This are the effects spawned in the hit location

And this is the beam itself:

<uscript>

  Coil = Spawn(class'ShockBeamCoil',,, Location, Rotation);
  if (Coil != None)
   {

Coil.mSpawnVecA = mSpawnVecA;

   }

</uscript>

HunterKiller: Remembering: Location was set in the muzzle flash routines, and is the tip of the weapon. mSpawnVecA is the HitLocation. With this set, you will have a beam getting out from your weapons tip to the desired location.


Known Subclasses

Comments

HunterKiller: Following Wormbo advices. ;)

Wormbo: Some more adjustments... ;) We usually use "; functionname (parameters) : description" for function declarations. Use the ... tags if you need to put really complex stuff into the description part. Stuff like "What's a HitNormal" should be explained in a place like the vector introduction on the UnrealScript Lessons page. Maybe a page for explaining details that would be a good idea? (A discussion about this can be found at Guidelines On General Style.)