Hat code

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

Moderator: Forum Guards

Hat code

Postby atrey65789 » Tue Jan 01, 13 7:11 pm

So I am coding something for a hat.. when you frob the dacoration, you wear it on your head.. however, the code that I developed doesn't work.


[code]function Frob(Actor Frobber, Inventory frobWith)
{

dxp = DeusExPlayer(Frobber);

loc.Z = dxp.collisionHeight+ 4.0; // can adjust its height to any meshes head.
SetLocation(dxp.Location + loc);
SetRotation(dxp.Rotation);
SetCollision(False,false,false);
SetBase(dxp);

}



function tick(float deltatime)
{
super.tick(Deltatime);

if (dxp != None)
{
loc.Z = dxp.collisionHeight+ 4.0; // can adjust its height to any meshes head.
SetLocation(dxp.Location + loc);
SetRotation(dxp.Rotation);
SetCollision(False,false,false);
}
else
{
SetCollision(True,True,True);
SetPhysics(Phys_Falling);
SetBase(None);
}

} [/code]
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby ~DJ~ » Wed Jan 02, 13 11:39 pm

How about adding..
Code: Select all
Super.Frob(Frobber, frobWith);

at the end of the Frob() function?

EDIT: or maybe.. this..
Code: Select all
function Frob(Actor Frobber, Inventory frobWith)
{
dxp = DeusExPlayer(Frobber);

   if(dxp!=None)
   {
      loc.Z = dxp.collisionHeight+ 4.0; // can adjust its height to any meshes head.
      SetLocation(dxp.Location + loc);
      SetRotation(dxp.Rotation);
      SetCollision(False,false,false);
      SetBase(dxp);
   }
Super.Frob(Frobber, frobWith);
}
Last edited by ~DJ~ on Wed Jan 02, 13 11:44 pm, edited 2 times in total.
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby atrey65789 » Thu Jan 03, 13 12:43 am

Have already... doesn't seem to be working... hmm... strange.
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby ~DJ~ » Thu Jan 03, 13 1:47 am

err.. maybe this? XD
Code: Select all
function Frob(Actor Frobber, Inventory frobWith)
{
   if(DeusExPlayer(Frobber)!=None)
   {
      loc.Z = DeusExPlayer(Frobber).collisionHeight+ 4.0; // can adjust its height to any meshes head.
      SetLocation(DeusExPlayer(Frobber).Location + loc);
      SetRotation(DeusExPlayer(Frobber).Rotation);
      SetCollision(False,false,false);
      SetBase(DeusExPlayer(Frobber));
   }
Super.Frob(Frobber, frobWith);
}
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby atrey65789 » Thu Jan 03, 13 2:23 am

HAHA I will give it a try
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby Poor » Thu Jan 03, 13 3:40 am

Look at PutCarriedDecorationInHand() in DeusExPlayer. It doesn't need to be updated in Tick.
Poor
Poster
 
Posts: 190
Joined: Tue Jan 04, 11 7:42 pm

Postby atrey65789 » Thu Jan 03, 13 3:47 am

Ok will do
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby ~DJ~ » Thu Jan 03, 13 4:47 am

Oh, and perhaps try doing that too.
Code: Select all
function Frob(Actor Frobber, Inventory frobWith)
{
   if(DeusExPlayer(Frobber)!=None)
   {
      loc.Z = DeusExPlayer(Frobber).collisionHeight+ 4.0; // can adjust its height to any meshes head.
      SetOwner(DeusExPlayer(Frobber));
      SetLocation(DeusExPlayer(Frobber).Location + loc);
      SetRotation(DeusExPlayer(Frobber).Rotation);
      SetCollision(False,false,false);
      SetBase(DeusExPlayer(Frobber));
      SetPhysics(PHYS_Trailer);
   }
Super.Frob(Frobber, frobWith);
}

(untested)

I don't know why I was telling you to call the Super anyway.. like that would do any good, but oh well..
alternatively you can look into Deadalus08's Parachute mod, it attaches the chute' in your back.. just some adjustments and volla..
I'd give you my code for the Reinmutt I created.. (attached Horns to the Mutt) but I currently don't have it and besides it was very buggy.. so yeah.. good luck! :oops:
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby atrey65789 » Sat Jan 05, 13 2:09 am

Hahaha I will try this.
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 20 guests