Moderator: Forum Guards
local DeusExPlayer Player;
local DeusExWeapon DXW;
state Activated
{
local DeusExWeapon DXW;
local DeusExPlayer Player;
function Activate()
{
//=============================================================================
// StealthPickup.
//=============================================================================
class StealthPickup extends DeusExPickup;
state Activated
{
function Activate()
{
// YEY!
}
function BeginState()
{
local DeusExWeapon DXW;
local DeusExPlayer Player;
Super.BeginState();
Player = DeusExPlayer(Owner);
if (Player != None)
{
// Let's make him look like Alex Jacobson.
// You can set multiskins from [0] to [7], also you can set mesh and other stuff:
// just hit "display" in default properties of NPC in UnrealEd and you will understand.
Player.MultiSkins[1]=Texture'AlexJacobsonTex2';
Player.MultiSkins[2]=Texture'AlexJacobsonTex1';
// Let's give him cloak and healing aug (easy!):
Player.AugmentationSystem.GivePlayerAugmentation(class'AugCloak');
Player.AugmentationSystem.GivePlayerAugmentation(class'AugHealing');
// Let's give him some weapons (crossbow and knife).
DXW=Spawn(class'DeusEx.WeaponMiniCrossbow'); // <-- this spawns it somewhere
DXW.Frob(Player, None); // <-- this forces player "grab" spawned thing, no matter where it is
DXW=Spawn(class'DeusEx.WeaponCombatKnife');
DXW.Frob(Player, None);
}
UseOnce();
}
Begin:
}
defaultproperties
{
maxCopies=1
bCanHaveMultipleCopies=False
bActivatable=True
ItemName="Stealth pickup"
ItemArticle="a"
PlayerViewOffset=(X=30.00,Y=0.00,Z=-12.00),
PlayerViewMesh=LodMesh'DeusExItems.AdaptiveArmor'
PickupViewMesh=LodMesh'DeusExItems.AdaptiveArmor'
ThirdPersonMesh=LodMesh'DeusExItems.AdaptiveArmor'
Icon=Texture'DeusExUI.Icons.BeltIconArmorAdaptive'
largeIcon=Texture'DeusExUI.Icons.LargeIconArmorAdaptive'
largeIconWidth=35
largeIconHeight=49
Description="Stealth pickup does picking at agents that pick it up (add some random crap if you intend to use it in singlePlayer)."
beltDescription="Stealth pickup"
Mesh=LodMesh'DeusExItems.AdaptiveArmor'
CollisionRadius=11.50
CollisionHeight=13.81
Mass=30.00
Buoyancy=20.00
}
[A]llan wrote:No worries if it does Snakey =D
Fixing problems, then throwing your laptop/keyboard out of a window in rage when the code just won't work is part of the fun of the fun of UScript!
(That, and making mods that are so simple to make, but players love them anyway)
[A]llan wrote:What did the stand-by button ever do to you...? Apart from making your computer go into stand-by...
Oh, please do =DSnakey wrote:I could send you the .uc if you like.
Function Touch(Actor Other)
{
local PlayerPawn P;
P=PlayerPawn(Other);
Super.Touch(Other);
If(P!=None)
{
Frob(P,None);
}
}
Snakey wrote:Now how do I make a projectile emit electricity?
And how do I make a pickup increase the base strength of the player, so that they can lift heavier things?
Snakey wrote:I guess I could just make the pickup give Strength aug..
How would I go about making the electricity come out of the back of the projectile then?
simulated function Tick(float deltaTime)
{
local SmokeTrail s;
local Pawn P;
time += DeltaTime;
DrawScale = FClamp(2.5*(time+0.5), 1.0, 6.0);
if ((time > FRand() * 0.02) && (Level.NetMode != NM_DedicatedServer))
{
time = 0;
// spawn some trails
s = Spawn(class'SmokeTrail',,, Location);
if (s != None)
{
s.DrawScale = FRand() * 0.333;
s.OrigScale = s.DrawScale;
s.Texture = Texture'Effects.Fire.Spark_Electric';
s.Velocity = VRand() * 50;
s.OrigVel = s.Velocity;
}
}
foreach RadiusActors(class'Pawn',P,DrawScale*48,Location)
{
P.TakeDamage(Damage/16,Pawn(Owner),P.Location,vect(0,0,0),'Shocked');
}
}