Crane animation help needed

Crane animation help needed

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
jamesbigmac
Posts: 20
Joined: 14 Jun 2012, 15:33

Crane animation help needed

Post by jamesbigmac »

I haven't come up with a good way to make this work, and feel like an idiot because I can't figure it out. What I want to do is have a crane rotate its arm up when it is constructing a building, then have the hoist hook move up and down while it is building something. After the building is done, lower the crane and hoist hook back to their normal positions.

The parts I'm not sure about are:
1. Making sure the hoist hook and the rope stay upright the entire time (I'm assuming this can be done with StopSpin)

2. How to make the rope holding the hoist hook seem as though it is extending when the hoist hook is moving away from the crane arm, and then retracting when it moves toward the crane arm, the same as it would in real life.

I'm just confused as to how this is done using the Upspring origins and animation callouts.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Crane animation help needed

Post by smoth »

origins at the base of the peices.

rotate crane arm 35, rotate crane rope at -35.

this will create the illusion you are seeking.

the origins needs to be

Crane arm(at base of crane arm)
rope(where rope meets crane arm)

I cannot give you an illustration but let me know if this helps.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Crane animation help needed

Post by zwzsg »

Have the rope be a child of the crane tip.
Every time you rotate the crane, counter-rotate the rope exactly the same amount (but with opposed sign) at same speed.

jamesbigmac wrote:I'm assuming this can be done with StopSpin
Noooooo!


Also, I'm reminded of http://www.youtube.com/watch?v=1t0gnyejV6A
jamesbigmac
Posts: 20
Joined: 14 Jun 2012, 15:33

Re: Crane animation help needed

Post by jamesbigmac »

Well I hadn't seen that crane before, but the part where the claws drop down also elongates the connection between the claws and the rest of the gantry. Any idea how to take care of that part?

...and I just realized how stupid using StopSpin would have been.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Crane animation help needed

Post by smoth »

I miss panties :(
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Crane animation help needed

Post by PicassoCT »

Do not make the rope swing, and do not have it react to wind. You will spend months..
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Crane animation help needed

Post by Pressure Line »

jamesbigmac wrote:Well I hadn't seen that crane before, but the part where the claws drop down also elongates the connection between the claws and the rest of the gantry. Any idea how to take care of that part?

...and I just realized how stupid using StopSpin would have been.
You'll need to chop the rope into shorter lengths. Ie if your rope is 16 elmos long at full length, cut it into 4 pieces, each 4 elmos long:
bos/cob wrote: ExtendRope()
{
move rope1 to y-axis [-4] speed [4];
move rope2 to y-axis [-4] speed [4];
move rope3 to y-axis [-4] speed [4];
move rope4 to y-axis [-4] speed [4];
sleep 1000;
}

RetractRope()
{
move rope1 to y-axis [0] speed [4];
move rope2 to y-axis [0] speed [4];
move rope3 to y-axis [0] speed [4];
move rope4 to y-axis [0] speed [4];
sleep 1000;
}
Lua wrote: local function ExtendRope()
Spring.UnitScript.Move(rope1,y,-4,4)
Spring.UnitScript.Move(rope2,y,-4,4)
Spring.UnitScript.Move(rope3,y,-4,4)
Spring.UnitScript.Move(rope4,y,-4,4)
Spring.UnitScript.Sleep(1000)
end

local function RetractRope()
Spring.UnitScript.Move(rope1,y,0,4)
Spring.UnitScript.Move(rope2,y,0,4)
Spring.UnitScript.Move(rope3,y,0,4)
Spring.UnitScript.Move(rope4,y,0,4)
Spring.UnitScript.Sleep(1000)
end
jamesbigmac
Posts: 20
Joined: 14 Jun 2012, 15:33

Re: Crane animation help needed

Post by jamesbigmac »

I was really hoping that there was a better way to do it rather than separate pieces, but if that's the way it has to be then that's the way it has to be.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Crane animation help needed

Post by PicassoCT »

..and you dont even know the best part of it.. if it all works out.. and you poured hours of work in.. one of your testers going to play it .. and you look at him expecting praise.. and you dont even get a raise-
of an eyebrow.. because thats how rope are suppossed to work. Its not spectacular, if you copy paste the real world
jamesbigmac
Posts: 20
Joined: 14 Jun 2012, 15:33

Re: Crane animation help needed

Post by jamesbigmac »

Thanks for the pep talk Picasso.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Crane animation help needed

Post by PicassoCT »

Those few people who know me, know about the conair rope months.

http://code.google.com/p/journeywar/sou ... script.lua
jamesbigmac
Posts: 20
Joined: 14 Jun 2012, 15:33

Re: Crane animation help needed

Post by jamesbigmac »

I am genuinely sorry that you had to go through that traumatizing experience. I didn't know....I DIDN'T KNOW!!
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Crane animation help needed

Post by PicassoCT »

Everybody else would have hanged himself.. but i couldnt.. the rope didnt work that well
Post Reply

Return to “Game Development”