- Beam:
- Start (Vector)
- End (Vector)
- nModelIndex (index - use GameEngine.PrecacheModel)
- mHaloIndex (index - use GameEngine.PrecacheModel)
- frameStart (integer)
- frameRate (integer)
- flLife (float - seconds for the beam to remain)
- width (integer)
- endWidth (integer)
- fadeLength (integer)
- noise (integer)
- red (integer 0-255)
- green (integer 0-255)
- blue (integer 0-255)
- brightness (integer 0-255)
- speed
- Dust:
- pos (Vector - position of the dust)
- dir (Vector - direction of the dust)
- size (float)
- speed (float)
- EnergySplash:
- position (Vector)
- direction (Vector)
- bExplosive (bool)
- MetalSparks:
- position (Vector)
- direction (Vector)
- MuzzleFlash:
- vecOrigin (Vector)
- vecAngles (Vector)
- flScale (float)
- iType (integer)
- Ricochet:
- position (Vector)
- direction (Vector)
- Smoke:
- origin (Vector)
- modelIndex (index - use GameEngine.PrecacheModel)
- scale (float)
- framerate (float)
- Sparks:
- position (Vector)
- nMagnitude (integer)
- nTrailLength (integer)
- pvecDir (Vector - direction)
Here is a simple DeathBeam script I tried out:
Syntax: Select all
# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Python Imports
from Source import Misc
from Source import Player
# Core
from core import GameEngine
# Events
from events.decorator import Event
# =============================================================================
# >> GLOBAL VARIABLES
# =============================================================================
effects = Misc.GetEffects()
model = GameEngine.PrecacheModel('sprites/laserbeam.vmt')
# =============================================================================
# >> GAME EVENTS
# =============================================================================
@Event
def player_death(GameEvent):
victim = Player.PlayerOfUserid(GameEvent.GetInt('userid'))
killer = Player.PlayerOfUserid(GameEvent.GetInt('attacker'))
green = 0
if killer.GetTeamIndex() == 2:
red = 255
blue = 0
else:
red = 0
blue = 255
effects.Beam(victim.GetAbsOrigin(), killer.GetAbsOrigin(),
model, model, 0, 0, 20.0, 1, 1, 0, 0, red, green, blue, 255, 0)
http://steamcommunity.com/profiles/76561197970633142/screenshot/558698452561908099?tab=public
Do note, though, that while this is currently in the Misc structure, it will be moved out once we decide how to move forward with the structure on the C++ side. For future updates, if any functionality is in Misc, it is there for an undetermined time until it gets moved out, but it will be moved out at some point. If you create a script that uses Misc, be sure to keep up-to-date, so you know when you need to modify your script.
Note also, that the script above takes advantage of more new functionality available to us as of the latest updates. You can now use Player.PlayerOfUserid(<userid>) to get a userid's IPlayerInfo instance, Player.EdictOfUserid(<userid>) to get a userid's entity edict, and Player.PlayerOfIndex(<index>) to get a player's IPlayerInfo from their index.
Satoon