[Solved @ Mr. X] Need a hand with UScript

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

[Solved @ Mr. X] Need a hand with UScript

Postby Magus » Mon Sep 12, 05 6:17 pm

Since this is a modding forum, I better ask for a bit of help :P

I want to make a switch. Not just an ordinary switch, though. I want this switch to check the player's inventory for a certain item. And I only want it to work when it finds that item.

So, could anyone here possibly write such a piece of code for me?
-- Magus "Ours is not to question, only to act!"

Image
User avatar
Magus
Addict
 
Posts: 538
Joined: Wed Aug 17, 05 3:12 pm
Location: Manchester, England

Postby Gishank » Mon Sep 12, 05 6:41 pm

err well u could ask Sondor(AW)L)
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby Alex » Mon Sep 12, 05 7:41 pm

Code: Select all
//=============================================================================
// Switch1.
//=============================================================================
class Switch1 extends DeusExDecoration;

var bool bOn;

function Frob(Actor Frobber, Inventory frobWith)
{
      local Inventory Inv;
      local DeusExPlayer Player;
      Player = DeusExPlayer(Frobber);
            foreach AllActors(class'Inventory', Inv)
            {
                  if (Inv.Owner == Player){
                  if (Inv.IsA('ItemClassHere')) {
   Super.Frob(Frobber, frobWith);
}
}
}

   if (bOn)
   {
      PlaySound(sound'Switch4ClickOff');
      PlayAnim('Off');
   }
   else
   {
      PlaySound(sound'Switch4ClickOn');
      PlayAnim('On');
   }

   bOn = !bOn;
}

defaultproperties
{
     bInvincible=True
     ItemName="Switch"
     bPushable=False
     Physics=PHYS_None
     Mesh=LodMesh'DeusExDeco.Switch1'
     CollisionRadius=2.630000
     CollisionHeight=2.970000
     Mass=10.000000
     Buoyancy=12.000000
}


Don't know if its 100% correctly.
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Magus » Wed Sep 14, 05 6:43 pm

Thanks man, I'll give it a test.
-- Magus "Ours is not to question, only to act!"

Image
User avatar
Magus
Addict
 
Posts: 538
Joined: Wed Aug 17, 05 3:12 pm
Location: Manchester, England

Postby Dae » Wed Sep 14, 05 6:52 pm

*shakes Alex's hand*
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Alex » Wed Sep 14, 05 7:13 pm

=)
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Magus » Wed Sep 14, 05 8:03 pm

I would frown at you, Mr. X, but that piece of code works like a charm, so I'm not going to :)
-- Magus "Ours is not to question, only to act!"

Image
User avatar
Magus
Addict
 
Posts: 538
Joined: Wed Aug 17, 05 3:12 pm
Location: Manchester, England

Postby clyzm » Wed Sep 14, 05 8:39 pm

Magu[Z] wrote:I would frown at you, Mr. X, but that piece of code works like a charm, so I'm not going to :)


Dude.

Double posting is allowed for admins. IIRC.

So stfu with frowns. And since you got your code, locked :]
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 7 guests