|
Hyper.nl Unreal Services The forum of Hyper.nl Unreal Services and the semi-offical resource for Winged Unicorn's Unreal mods
|
View previous topic :: View next topic |
Author |
Message |
TheEmperorStalwartUK
Joined: 11 Feb 2004 Posts: 261
|
Posted: Sun Jun 20, 2004 9:00 am Post subject: Shield Effect on ScriptedPawn |
|
|
I was just wondering about this recently how to do it, i've seen done before in mods like AKCoop and AKCoop 2 but unfornatly when I look up the code for the pawns that have a shield effect (When I mean a shield effect I mean something like the effect a ShieldBelt has on PlayerPawns) the code was ovisualy stripped. _________________ StalwartUK |
|
Back to top |
|
|
K죣èr_§kā&#
Joined: 10 Jul 2004 Posts: 164
|
Posted: Wed Oct 13, 2004 12:49 am Post subject: |
|
|
stalwart.......do u have any idea what the Return to Mars site is?I would like to see progress on it (dont tell me I wanna see the site for myself ;) ) _________________ K죣èr_§kaarj
-|-Mess with me and you get the clàw§-|-
www.freewebs.com/killerskaarjslair |
|
Back to top |
|
|
BOZO
Joined: 11 Oct 2004 Posts: 48
|
Posted: Thu Oct 14, 2004 6:28 am Post subject: |
|
|
Here is the code for the WizardHat from Crystal Castles. There are two classes that work together to do it. It has the same sort of effect I think you are looking for.
Code: |
//=============================================================================
// Crystal Castles (Total Conversion Mod for UnrealI)
// Shawn Downey aka. Unleaded
// Wolfgang Schloyer aka. }TCP{Wolf aka. <NDP>Scorpion aka. MiaTheChaotic
// Gerald Lance Tindall aka. <NDP>BOZO
// CODE NOT FOR REUSE WITHOUT PRIOR PERMISSION OF THE AUTHORS
//=============================================================================
// CCItems.WizardHat:
// makes owner invincible for a short amount of time
//=============================================================================
class WizardHat expands CCSpecialItem;
// 134 Vertices, 168 Triangles
// "timer" in Charge (seconds of invincibility left)
var WizardHatEffect MyEffect;
var() firetexture TeamFireTextures[4];
//var() texture TeamTextures[4];
var int TeamNum;
var() string ItemUseMessage;
var() bool bAutomaticallyActivate;
var name TempDamage;
//======================================================================================
// WizardHat.PlayPickupMessage()
//======================================================================================
function PlayPickupMessage(Pawn Other)
{
Other.ClientMessage(PickupMessage,'Pickup');
}// end function WizardHat.PlayPickupMessage
//======================================================================================
// WizardHat.PlayExpireMessage()
//======================================================================================
function PlayExpireMessage(Pawn Other)
{
Other.ClientMessage(ExpireMessage,'Pickup');
}// end function WizardHat.PlayExpireMessage
//======================================================================================
// WizardHat.PlayItemUseMessage()
//======================================================================================
function PlayItemUseMessage(Pawn Other)
{
Other.ClientMessage(ItemUseMessage,'Pickup');
}// end function WizardHat.PlayItemUseMessage
//=============================================================================
// WizardHat.Destroyed()
//=============================================================================
function Destroyed()
{
if ( Owner != None )
{
Owner.SetDefaultDisplayProperties();
}// endif
if ( MyEffect != None )
{
MyEffect.Destroy();
}// endif
Super.Destroyed();
}// end function WizardHat.Destroyed
//=============================================================================
// WizardHat.ActivateEffect()
//=============================================================================
function ActivateEffect(Pawn Other)
{
MyEffect = Spawn(class'CCItems.WizardHatEffect', Owner,,Owner.Location, Owner.Rotation);
MyEffect.Mesh = Owner.Mesh;
MyEffect.DrawScale = Owner.Drawscale;
if ( Level.Game.bTeamGame && (Other.PlayerReplicationInfo != None) )
{
TeamNum = Other.PlayerReplicationInfo.Team;
}else
{
TeamNum = 0;
}// endif
SetEffectTexture();
}// end function WizardHat.ActivateEffect
//=============================================================================
// WizardHat.SetEffectTexture()
//=============================================================================
function SetEffectTexture()
{
if ( TeamNum != 0 )
{
MyEffect.ScaleGlow = 0.5;
}else
{
MyEffect.ScaleGlow = 1.0;
}// endif
MyEffect.Texture = TeamFireTextures[TeamNum];
MyEffect.LowDetailTexture = TeamFireTextures[TeamNum];
}// end function WizardHat.SetEffectTexture
//--------------------------------------------------------------------------------------
//======================================================================================
// WizardHat:Idle2
//======================================================================================
state Idle2
{
//======================================================================================
// WizardHat:Idle2.BeginState()
//======================================================================================
function BeginState()
{
if(bHeldItem==True)
{
GoToState('DeActivated');
}else
{
GoToState('Sleeping');
}// endif
}// end function WizardHat:Idle2.BeginState
}// end state WizardHat:Idle2
//--------------------------------------------------------------------------------------
//======================================================================================
// WizardHat:Pickup
//======================================================================================
auto state Pickup
{
//======================================================================================
// WizardHat:Pickup.Touch()
//======================================================================================
function Touch( actor Other )
{
local Inventory Copy;
local Pawn P;
if ( ValidTouch(Other) )
{
P = Pawn(Other);
Copy=SpawnCopy(P);
Copy.LightEffect=LE_None;
Copy.LightType=LT_None;
Copy.LightBrightness=0;
Copy.bLightChanged=True;
if (Level.Game.LocalLog != None)
{
Level.Game.LocalLog.LogPickup(Self, P);
}// endif
if (Level.Game.WorldLog != None)
{
Level.Game.WorldLog.LogPickup(Self, P);
}// endif
PlayPickupMessage(P);
PlaySound(PickupSound,SLOT_Misc,255.0,True);
if ( Level.Game.Difficulty > 1 )
{
Other.MakeNoise(0.1 * Level.Game.Difficulty);
}// endif
GoToState('Idle2');
}// endif
}// end function WizardHat:Pickup.Touch
//======================================================================================
// WizardHat:Pickup.AnimEnd()
//======================================================================================
simulated function AnimEnd()
{
// Continue Looping
}// end function WizardHat:Pickup.AnimEnd
//======================================================================================
// WizardHat:Pickup.BeginState()
//======================================================================================
function BeginState()
{
LoopAnim('WalkingHat',0.25,0.25);
LightEffect=Default.LightEffect;
LightType=Default.LightType;
LightBrightness=Default.LightBrightness;
bLightChanged=True;
Super.BeginState();
}// end function WizardHat:Pickup.BeginState
//======================================================================================
// WizardHat:Pickup.EndState()
//======================================================================================
function EndState()
{
LightEffect=LE_None;
LightType=LT_None;
LightBrightness=0;
bLightChanged=True;
Super.EndState();
}// end function WizardHat:Pickup.EndState
}// end state WizardHat:Pickup
//----------------------------------------------------------------------------
//=============================================================================
// WizardHat:Activated
//=============================================================================
state Activated
{
ignores Activate;
//=============================================================================
// WizardHat:Activated.Timer()
//=============================================================================
function Timer()
{
Charge-=1;
if (Charge<=0)
{
UsedUp();
}// endif
if ( MyEffect != None )
{
MyEffect.Fatness = 255;
SetEffectTexture();
}// endif
}// end function WizardHat:Activated.Timer
//=============================================================================
// WizardHat:Activated.BeginState()
//=============================================================================
function BeginState()
{
bActive=True;
PlayItemUseMessage(Pawn(Owner));
SetTimer(1.0,True);
if(Owner.IsA('PlayerPawn'))
{
PlayerPawn(Owner).ClientPlaySound(ActivateSound);
}// endif
TempDamage=Pawn(Owner).ReducedDamageType;
Pawn(Owner).ReducedDamageType = 'All';
Pawn(Owner).disable('KilledBy');
ActivateEffect(Pawn(Owner));
}// end function WizardHat:Activated.BeginState
//=============================================================================
// WizardHat:Activated.EndState()
//=============================================================================
function EndState()
{
Pawn(Owner).ReducedDamageType = 'None';
Pawn(Owner).enable('KilledBy');
PlayExpireMessage(Pawn(Owner));
if(Owner.IsA('PlayerPawn'))
{
PlayerPawn(Owner).ClientPlaySound(DeActivateSound);
}// endif
}// end function WizardHat:Activated.EndState
Begin:
}// end state WizardHat:Activated
//----------------------------------------------------------------------------
//=============================================================================
// WizardHat:DeActivated
//=============================================================================
state DeActivated
{
//======================================================================================
// WizardHat:DeActivated.BeginState()
//======================================================================================
function BeginState()
{
local Pawn P;
bActive=False;
P=Pawn(Owner);
if(P.SelectedItem==None)
{
P.NextItem();
}// endif
if(bAutomaticallyActivate)
{
GoToState('Activated');
}// endif
}// end function WizardHat:DeActivated.BeginState
}// end state WizardHat:DeActivated
//----------------------------------------------------------------------------
//=============================================================================
// WizardHat:defaultproperties
//=============================================================================
defaultproperties
{
bAutomaticallyActivate=True
TeamFireTextures(0)=FireTexture'UnrealShare.Effect1.FireEffect1p'
TeamFireTextures(1)=FireTexture'UnrealShare.Effect1.FireEffect1u'
TeamFireTextures(2)=FireTexture'UnrealShare.Effect1.FireEffect1a'
TeamFireTextures(3)=FireTexture'UnrealShare.Effect1.FireEffect1e'
ExpireMessage="You are no longer invincible!"
PickupMessage="You got the Wizard's hat which can make you invincible!"
ItemUseMessage="You are now invincible!"
ItemName="The Wizard Hat"
Charge=30
RespawnTime=120.000000
DrawType=DT_Mesh
Mesh=LodMesh'CCItems.WizardHatM'
PickupViewMesh=LodMesh'CCItems.WizardHatM'
bRotatingPickup=True
Physics=PHYS_None
bAmbientGlow=True
AmbientGlow=255
ScaleGlow=255
LightEffect=LE_WateryShimmer
LightType=LT_Pulse
LightPeriod=60
LightRadius=7
LightBrightness=255
LightHue=245
LightSaturation=48
NetPriority=100.0
Texture=Texture'Engine.S_Inventory'
CollisionHeight=20
CollisionRadius=20
bAutoActivate=True
bActivatable=True
bDisplayableInv=True
bCanHaveMultipleCopies=False
Icon=Texture'CCItems.WIZ.WizardHatAni_A00'
PickupSound=Sound'CCItems.Pickups.WizardHatPickupSound'
ActivateSound=Sound'CCItems.Pickups.WizardHatActivateSound'
DeActivateSound=Sound'CCItems.Pickups.WizardHatDeActivateSound'
Texture=Texture'Engine.S_Inventory'
Role=ROLE_Authority
RemoteRole=ROLE_DumbProxy
}// end WizardHat:defaultproperties
|
----------------------------------------------------------------------------------------
Code: | //=============================================================================
// Crystal Castles (Total Conversion Mod for UnrealI)
// Shawn Downey aka. Unleaded
// Wolfgang Schloyer aka. }TCP{Wolf aka. <NDP>Scorpion aka. MiaTheChaotic
// Gerald Lance Tindall aka. <NDP>BOZO
// CODE NOT FOR REUSE WITHOUT PRIOR PERMISSION OF THE AUTHORS
//=============================================================================
// CCItems.WizardHatEffect:
// Invincibility Effect.
//=============================================================================
class WizardHatEffect extends Effects;
var Texture LowDetailTexture;
//======================================================================================
// WizardHatEffect.Destroyed()
//======================================================================================
simulated function Destroyed()
{
if ( bHidden && (Owner != None) )
{
Owner.SetDefaultDisplayProperties();
}// endif
Super.Destroyed();
}// end simulated function WizardHatEffect.Destroyed
//======================================================================================
// WizardHatEffect.PostBeginPlay()
//======================================================================================
simulated function PostBeginPlay()
{
if ( !Level.bHighDetailMode && ((Level.NetMode == NM_Standalone) || (Level.NetMode == NM_Client)) )
{
Timer();
bHidden = true;
SetTimer(1.0, true);
}// endif
}// end simulated function WizardHatEffect.PostBeginPlay
//======================================================================================
// WizardHatEffect.Timer()
//======================================================================================
simulated function Timer()
{
bHidden = true;
Owner.SetDisplayProperties(Owner.Style, LowDetailTexture, false, true);
}// end simulated function WizardHatEffect.Timer
//======================================================================================
// WizardHatEffect.Tick()
//======================================================================================
simulated function Tick(float DeltaTime)
{
if ( (Fatness > Default.Fatness) && (Level.NetMode != NM_DedicatedServer) )
{
Fatness = Max(Default.Fatness, Fatness - 130 * DeltaTime );
}// endif
if ( Owner != None )
{
if ( (bHidden != Owner.bHidden) && (Level.NetMode != NM_DedicatedServer) )
{
bHidden = Owner.bHidden;
}// endif
}// endif
}// end simulated function WizardHatEffect.Tick
//======================================================================================
// WizardHatEffect:defaultproperties
//======================================================================================
defaultproperties
{
LowDetailTexture=Texture'UnrealShare.GoldSkin'
bAnimByOwner=True
bNetTemporary=False
bTrailerSameRotation=True
Physics=PHYS_Trailer
RemoteRole=ROLE_SimulatedProxy
DrawType=DT_Mesh
Style=STY_Translucent
Texture=None
ScaleGlow=0.500000
AmbientGlow=64
Fatness=157
bUnlit=True
bMeshEnviroMap=True
bOwnerNoSee=True
}// end WizardHatEffect:defaultproperties |
_________________ Darn Floppy Feet!!
{KDS}BOZO / <NDP>BOZO / LordBozo
bozo@kds-clan.com |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|