Page 1 of 1

Problem

PostPosted: Sat Sep 10, 05 11:34 pm
by Snakey
Can anyone supply me with the coding for a pickup that can only be activated once then it disappears from your inventory, the effects last until you die, it increases the player speed and makes a CloakUp sound when activated?

I've been trying to get it to work for ages, I've tried many different strategies in the script, It either doesn't compile or doesn't work. It's been annoying me for ages. Not even Bowen could get it to work.

PostPosted: Sun Sep 11, 05 6:51 am
by Dae
What are you trying to do?

PostPosted: Sun Sep 11, 05 9:29 am
by Gishank
I think he is trying to make a LAW or like Lees clothes Dae

PostPosted: Sun Sep 11, 05 9:39 am
by Alex
He wants to make some sort of augmentation cannister, when activated you get a higher speed, and the activation sound is similar to the one of activating cloak, after used, the item will disapear, like using medkit/sodacan/etc.
He wants you to keep the speed, untill you die.

PostPosted: Sun Sep 11, 05 1:50 pm
by Snakey
~[A]Mr. X~ wrote:He wants to make some sort of augmentation cannister, when activated you get a higher speed, and the activation sound is similar to the one of activating cloak, after used, the item will disapear, like using medkit/sodacan/etc.
He wants you to keep the speed, untill you die.


Yes.

Code has changed alot from what it first was.
Like I said...
I've tried many different strategies in the script


Code: Select all
class Adrenaline extends DeusExPickup;

#exec OBJ LOAD FILE=Nerv_FX

    function BeginState()
    {
        if(DeusExPlayer(Owner) == none) return;
        DeusExPlayer(Owner).ClientMessage("Adrenaline vial activated.");
        DeusExPlayer(Owner).ClientMessage("Increased ground speed from" @  DeusExPlayer(Owner).GroundSpeed);
        DeusExPlayer(Owner).GroundSpeed*=2;
        DeusExPlayer(Owner).ClientMessage("to" @ DeusExPlayer(Owner).GroundSpeed);
        PlaySound(sound'CloakUp');
        UseOnce();
        Pawn(Owner).GroundSpeed *= 4;
    }

defaultproperties
{
     bActivatable=True
     ItemName="Adrenaline"
     ItemArticle="some"
     PlayerViewOffset=(X=30.000000,Z=-12.000000)
     PlayerViewMesh=LodMesh'DeusExItems.VialAmbrosia'
     PickupViewMesh=LodMesh'DeusExItems.VialAmbrosia'
     ThirdPersonMesh=LodMesh'DeusExItems.VialAmbrosia'
     LandSound=Sound'DeusExSounds.Generic.GlassHit2'
     Icon=Texture'DeusExUI.Icons.BeltIconLiquorBottle'
     largeIcon=Texture'DeusExUI.Icons.LargeIconLiquorBottle'
     largeIconWidth=20
     largeIconHeight=48
     Description="A Vial of proccessed liquid adrenaline"
     beltDescription="ADRENALINE"
     Mesh=LodMesh'DeusExItems.VialAmbrosia'
     MultiSkins(1)=WetTexture'Nerv_FX.Drugs.Adrenaline_N'
     CollisionRadius=4.620000
     CollisionHeight=12.500000
     LightType=LT_Steady
     LightEffect=LE_NonIncidence
     LightBrightness=64
     LightHue=160
     LightRadius=1
     Mass=4.000000
     Buoyancy=8.000000
}

PostPosted: Sun Sep 11, 05 1:52 pm
by Alex
DeusExPlayer(Owner).GroundSpeed*=2;
Pawn(Owner).GroundSpeed *= 4;

eh?

PostPosted: Sun Sep 11, 05 2:09 pm
by Dae
~[A]Mr. X~ wrote:DeusExPlayer(Owner).GroundSpeed*=2;
Pawn(Owner).GroundSpeed *= 4;

eh?

whats wrong with this?

if the code doesnt work at all, i guess its because function beginstate isn't being called at all (how can it be called if theres no state ?!?!?!). Have a look on candybar.uc
Code: Select all
//=============================================================================
// Candybar.
//=============================================================================
class Candybar extends DeusExPickup;

state Activated
{
   function Activate()
   {
      // can't turn it off
   }

   function BeginState()
   {
      local DeusExPlayer player;
      
      Super.BeginState();

      player = DeusExPlayer(Owner);
      if (player != None)
         player.HealPlayer(2, False);
      
      UseOnce();
   }
Begin:
}

defaultproperties
{
...
}

PostPosted: Sun Sep 11, 05 2:11 pm
by Snakey
~[A]Daedalus~ wrote:
~[A]Mr. X~ wrote:DeusExPlayer(Owner).GroundSpeed*=2;
Pawn(Owner).GroundSpeed *= 4;

eh?

whats wrong with this?

if the code doesnt work at all, i guess its because function beginstate isn't being called at all (how can it be called if theres no state ?!?!?!). Have a look on candybar.uc
Code: Select all
//=============================================================================
// Candybar.
//=============================================================================
class Candybar extends DeusExPickup;

state Activated
{
   function Activate()
   {
      // can't turn it off
   }

   function BeginState()
   {
      local DeusExPlayer player;
      
      Super.BeginState();

      player = DeusExPlayer(Owner);
      if (player != None)
         player.HealPlayer(2, False);
      
      UseOnce();
   }
Begin:
}

defaultproperties
{
...
}


The function is being called.
Nevermind, I finally managed to fix the groundspeed! It's a bit jumpy, but it's better than nothing ^_^
All It needs now is an activation sound and a client message.
Argh, it runs into the same bug as the Power Jump suit, if you die once it has been activated, the effects still last..
Except MTL Doesn't fix it.