Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
Elevator cable #74504
05/17/06 11:26
05/17/06 11:26
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Hello,

Has someone an idea how I can make a cable for an elevator.
When the elevator goes up the cable gets shorter and v.v.
It is like the cable in the crane demo.

I have absolutely no idea how to accomplish this.

Thanks in advance.

Regards,
Frits


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: Elevator cable [Re: Frits] #74505
05/17/06 13:28
05/17/06 13:28

A
Anonymous
Unregistered
Anonymous
Unregistered
A



I would use three models (2x cylinder, 1x 180°-corner) and scale the z-width of the cylinder and change the z-pos of the corner.
no Code:

|| || || ||
|| || => \\_//
\\_// \_/
\_/



mercuryus

Re: Elevator cable [Re: ] #74506
05/17/06 15:01
05/17/06 15:01
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
I made a drawing to explain my wish;




So only the red parts has to change in lengths, the black part of the cable and the wheels are stationary.

Regards,
Frits


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: Elevator cable [Re: Frits] #74507
05/17/06 18:07
05/17/06 18:07

A
Anonymous
Unregistered
Anonymous
Unregistered
A



I would use two models (cylinder) and scale then with there z-width.

mercuryus

Re: Elevator cable [Re: ] #74508
05/17/06 18:20
05/17/06 18:20
Joined: Sep 2003
Posts: 648
Switzerland
snake67 Offline
User
snake67  Offline
User

Joined: Sep 2003
Posts: 648
Switzerland
You would have to correct their z-position too. Why not animate the bottom vertexes in MED to control the length in percent.

Re: Elevator cable [Re: snake67] #74509
05/18/06 06:46
05/18/06 06:46
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Thanks mercuryus and snake67 for those solutions, but I don't understand how to do this.
Can you give me a script example?

Regards,
Frits


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: Elevator cable [Re: Frits] #74510
05/18/06 07:35
05/18/06 07:35
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Create a cylinder model and make sure the bottom
end is at the centre origin in MED then use the
following codes to control the cable(cylinder model)
up and down :

var speed = 0.1; // play with it

my.scale_z += speed * time // when elevator going down
my.scale_z -= speed * time // when going up

Also, move the elevator as the same speed to catch up the cable.


Re: Elevator cable [Re: vlau] #74511
05/18/06 08:32
05/18/06 08:32
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Thanks, but where do I put this code (I am still a noob on programming), must it be in an action attached to the cable or can I make an entity like:
entity* cableLift;
and put the code in the elevator action code like:
cableLift.scale_z+=speed*time;
Can you explain this to me please????

Regards,
Frits


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: Elevator cable [Re: Frits] #74512
05/18/06 09:01
05/18/06 09:01
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
The most important thing is the cable model, make sure
its base is on the centre origin, you can position it in MED.

For the codes, it is up to you, here is an example :

Code:

entity* cable; // pointer for cable
var speed = 0.1; // play with it

// attach it to the cable
action cable_act
{
while(my == NULL) {wait(1);}
cable = my;
}

// attach it to the elevator
action elevator
{
while(my != NULL)
{
// other codes if any......
if (key_d) // press key 'd' to drive elevator down
{
move_mode = ignore_passents;

// adjust speed if it doesn't catch up the cable
ent_move(nullvector, vector(0,0,speed*time));
cable.scale_z += speed * time;
}

if (key_u) // press key 'u' to drive elevator up
{
move_mode = ignore_passents;
ent_move(nullvector, vector(0,0,-speed * time);
cable.scale_z -= speed * time;
}

wait(1);
}
}



Codes are not tested, you may need to adjust it to meet your
requirements.

Re: Elevator cable [Re: vlau] #74513
05/18/06 12:02
05/18/06 12:02
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Thanks for the example. I will try it out.

Regards,
Frits


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Page 1 of 4 1 2 3 4

Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1