Code:
The code should explain it enough. Parsec is clean, my question is, if you input the 'vector' of the surface, (ie across the bottem or the top) will it appear right in the game, and I'm too lazy to create the hitwave textures. (no ,its not a sprite, its going to be a flat 3do with animated surfaces. Else, a few donut 3dos with different scales)# Jedi Knight Cog Script # # crash_forcefield.cog # # Just a regular forcefield cog except now it creates a hitwave thingy so it will look like # the projectile sent a tremor through the forcefield. # # [DP (+SM)] # symbols message touched message damaged message startup message timer surface surf0 mask=0x408 surface surf1 mask=0x408 int victim=-1 local int player=-1 local int damaging=1 local int hit=-1 local flex maxDamage=10.0 flex minDamage=5.0 flex interval=0.25 flex damage local sound wav0=ForceFieldHum01.wav local sound wav1=ForceFieldHit01.wav local template sparks=+heavysmoke local template hitwave=+hitwave local end # ======================================================================================== code Startup: SetSurfaceFlags(surf0, 0x4000); SetSurfaceFlags(surf1, 0x4000); PlaySoundPos(wav0, GetSurfaceCenter(surf0), 1.5, 2.0, 10.0, 0x1); Return; # ........................................................................................ Touched: If(damaging == 0) Return; victim = GetSourceRef(); damage = (Rand() * (maxDamage - minDamage)) + minDamage; DamageThing(victim, damage, 0x2, victim); PlaySoundPos(wav1, GetSurfaceCenter(surf0), 0.5, 1, 10, 0); If(!IsMulti()) CreateThing(sparks, victim); damaging = 0; SetTimer(interval); Return; # ........................................................................................ Damaged: If(GetParam(1) == 1) { player=GetThingParent(GetSourceRef()); If(GetThingType(player) != 10) Return; damage = (Rand()*(maxDamage - minDamage)) + minDamage; DamageThing(player, damage, 0x1, player); } hit = GetSourceRef(); CreateThingAtPos(hitwave, GetThingSector(hit), GetThingPos(hit), GetSurfaceNormal(surf0)); Return; # ........................................................................................ Timer: damaging = 1; Return; end
------------------
The Sniper Missions. Current project, The Sniper Missions
The Magician Saber System.
[This message has been edited by Descent_pilot (edited August 14, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms
Completed
Judgement Day (HLP), My level pack
SATNRT, JK Pistol Mod, Aliens TC, Firearms
Completed
Judgement Day (HLP), My level pack