Author Topic: script related question  (Read 1130 times)

I want to make it so my swords will be mounted on the player when not equipped i did as some told me and looked at existing scripts there are 2 types of mounts i want back mounts and side sheathed mounts

back being like the oblivion sword and swords that are sheathed on the side of the waist like the Pills here thing

here's the script from oblivion sword 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//### Mount on player

datablock ShapeBaseImageData(OblivionSwordBackImage)
{
  shapeFile = "./OblivionSword.dts";
  emap = true;
  mountPoint = $BackSlot;
  offset = "0.5 -0.30 0.3";
  eyeOffset = "0 0 10";
  rotation = eulerToMatrix("-135 0 90");
  armReady = false;
  doColorShift = false;
};

function OblivionSwordImage::onMount(%this,%obj,%slot)
{
  parent::onMount(%this,%obj,%slot);
  if(%obj.getMountedImage(1).getName() $= "OblivionSwordBackImage") { %obj.unMountImage(1); }
}

function OblivionSwordImage::onUnMount(%this,%obj,%slot)
{
  parent::onUnMount(%this,%obj,%slot);
  %obj.unMountImage(1);
  %obj.mountImage(OblivionSwordBackImage,1);
}

function OblivionSwordItem::onPickup(%this,%obj,%col,%a)
{
  for(%i=0;%i<%col.getdatablock().maxTools;%i++)
  {
    %item = %col.tool[%i];
    if(%item $= 0 || %item $= "")
    {
      %freeSlot = 1;
      break;
    }
  }
  if(%obj.canpickup && !isobject(%col.getmountedimage(1)) && %freeSlot) { %col.mountimage(OblivionSwordBackImage,1); }
  parent::onPickup(%this,%obj,%col,%a);
}

package OblivionSwordPackage
{
  function servercmdDropTool(%this,%slot)
  {
    if(isobject(%this.player.tool[%slot]) && %this.player.tool[%slot].getname() $= "OblivionSwordItem")
    {
      parent::servercmdDropTool(%this,%slot);
      if(isobject(%this.player.getmountedimage(1)) && %this.player.getmountedimage(1).getname() $= "OblivionSwordBackImage") { %this.player.schedule(5,unmountimage,1); }
      return;
    }
    parent::servercmdDropTool(%this,%slot);
  }
};
activatepackage(OblivionSwordPackage);

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

and heres the script from the pills here thing, well what i belive the mount script is

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

datablock ShapeBaseImageData(pillsHereFrontImage)
{
   // Basic Item properties
   shapeFile = "./pillsHere.dts";
   emap = true;

   mountPoint = 7;
   offset = "-0.3 0.3 0.25";
   eyeOffset = "1 0 0"; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 0" );

   armReady = false;
   doColorShift = false;
};
function pillsHereImage::onMount(%this,%obj,%slot)
{
   %obj.playaudio(1,"PillsUseSound");
   if(isobject(%obj.getmountedimage(1)) && %obj.getmountedimage(1).getname() $= "pillsHereFrontImage")
   {
      %obj.unmountimage(1);
   }
   parent::onMount(%this,%obj,%slot);
}

function pillsHereImage::onUnMount(%this,%obj,%slot)
{
   Parent::onUnMount(%this,%obj,%slot);
      //%obj.playThread(1, root);
   if(!isobject(%obj.getmountedimage(1)))
   {
      %obj.mountimage(pillsHereFrontImage,1);
   }
}

function pillsHereItem::onPickup(%this,%obj,%col,%a)
{
   for(%i=0;%i<%col.getdatablock().maxTools;%i++)
   {
      %item = %col.tool[%i];
      if(%item $= 0 || %item $= "")
      {
         %freeSlot = 1;
         break;
      }
   }
   if(%obj.canpickup && !isobject(%col.getmountedimage(1)) && %freeSlot)
   {
      %col.mountimage(pillsHereFrontImage,1);
   }
   parent::onPickup(%this,%obj,%col,%a);
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

the pills here script does NOT have "//### Mount on player" in it and the mount point used in both the scripts confuse me, reading tutorials after tutorials

Mountpoints for players and animations: (By The Russian and people who posted in his thread)
List of Bone Names:

eye - First person Camera

mount0 - Right Hand
mount1 - Left Hand
mount2 - Body
mount3 - Right Foot
mount4 - Left Foot
mount5 - Head
mount6 - Visor
mount7 - Pants

this is from http://forum.blockland.us/index.php?topic=108156.0

backslot are not listed, Mount (7 ) i can see where the 7 came from? but i dont see a backslot

this is what happens when i request a scripts that mount a weapon on the side and a script that mounts the weapon on the back

so you all know, i am utterly and completely confused!

lol

i saw pillsHereItem a ton in this.  :cookieMonster:

Don't change the script. Learn from it and construct your own.

Don't change the script. Learn from it and construct your own.

Im asking about the mount points atm

Don't change the script. Learn from it and construct your own.
dont you learn from others
so you learn from what they do:
learn from script = backwards engineering

dont you learn from others
so you learn from what they do:
learn from script = backwards engineering

I dont even know how to reguler engineer XD I cant script at all, idk what im even trying to do other then mount a uniqueped sword to the side and back, i asked but the same as the topic, ppl arnt asnwering my question there just posting what they think