Blockland Forums > Modification Help

Can someone tell me how to make something akimbo?

Pages: (1/4) > >>

RFW2:

I was gonna try and make Swords Akimbo, and I was wondering how to... well... make it Akimbo.
Do you have to add something to the script?

goz3rr:

You make 2 ImageDatablocks for the model (Can just be the same .dts)
Then add one of these:


--- Code: ---mountPoint = 0; //Right hand
mountPoint = 1; //Left hand

--- End code ---

And you need some code to make both weapons show: (Replace Rightimage and Leftimage with the datablock name..)


--- Code: ---function Rightimage::SecondFire(%this,%obj,%slot)
{
   %obj.setImageTrigger(1,1); //This makes you fire the image in your left hand
}

function Rightimage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot); //Calls the usual onMount function
      %obj.mountImage(Leftimage, 1); //And mounts the left gun
      %obj.playThread(0, armreadyboth); //Raises both arms
}

function Rightimage::onUnMount(%this, %obj, %slot)
{
   Parent::OnUnMount(%this, %obj, %slot); //Calls the usual onUnMount
      %obj.unMountImage(1); //Removes the image in the left hand (Leftimage)
      %obj.playThread(0, root); //Plays normal standing animation
}

--- End code ---

Credits to Amadé

RFW2:

What would I add to the script, if I wanted to make dual swords?

goz3rr:

I told you, You create 2 datablocks, One for each sword,
Then add one of these:

--- Code: ---mountPoint = 0; //Right hand
mountPoint = 1; //Left hand

--- End code ---

Then add this to your script, Replacing Rightimage and Leftimage

--- Code: ---function Rightimage::SecondFire(%this,%obj,%slot)
{
   %obj.setImageTrigger(1,1); //This makes you fire the image in your left hand
}

function Rightimage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot); //Calls the usual onMount function
      %obj.mountImage(Leftimage, 1); //And mounts the left gun
      %obj.playThread(0, armreadyboth); //Raises both arms
}

function Rightimage::onUnMount(%this, %obj, %slot)
{
   Parent::OnUnMount(%this, %obj, %slot); //Calls the usual onUnMount
      %obj.unMountImage(1); //Removes the image in the left hand (Leftimage)
      %obj.playThread(0, root); //Plays normal standing animation
}

--- End code ---


RFW2:


--- Quote from: goz3rr on May 26, 2010, 01:26:58 PM ---I told you, You create 2 datablocks, One for each sword,
Then add one of these:

--- Code: ---mountPoint = 0; //Right hand
mountPoint = 1; //Left hand

--- End code ---

Then add this to your script, Replacing Rightimage and Leftimage

--- Code: ---function Rightimage::SecondFire(%this,%obj,%slot)
{
   %obj.setImageTrigger(1,1); //This makes you fire the image in your left hand
}

function Rightimage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot); //Calls the usual onMount function
      %obj.mountImage(Leftimage, 1); //And mounts the left gun
      %obj.playThread(0, armreadyboth); //Raises both arms
}

function Rightimage::onUnMount(%this, %obj, %slot)
{
   Parent::OnUnMount(%this, %obj, %slot); //Calls the usual onUnMount
      %obj.unMountImage(1); //Removes the image in the left hand (Leftimage)
      %obj.playThread(0, root); //Plays normal standing animation
}

--- End code ---

--- End quote ---
Can you please show me the whole code, with the weapon called "DualSwords"?
I dont know how to create datablocks...

Pages: (1/4) > >>

Go to full version