Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
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
0 registered members (), 631 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 3 of 4 1 2 3 4
Re: Elevator cable [Re: ulillillia] #74524
05/30/06 08:25
05/30/06 08:25
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
For the map scale; I am using a player of 64 quants high, that is lets say 160 cm. so I think that the map scale would be 1 quant = 2.5 cm.
The rest of the requested data is already in an earlyer post;
liftcable unscaled = 212 quants (after scaling 108)
weightcable unscaled = 108 quants (after scaling 212)
so the growing or shrinking lenghts = 104 quants
I have set the speed of the elevator at 3*time, I don't know how many m/sec that is.
Please make it so that I can calculate the my.scale_z for different lengths of the cables and explain it to me step by step.

Regards,
Frits


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: Elevator cable [Re: Frits] #74525
05/30/06 09:20
05/30/06 09:20
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
I'm not used of the metric system, but I constantly convert as needed.

Quote:

For the map scale; I am using a player of 64 quants high, that is lets say 160 cm. so I think that the map scale would be 1 quant = 2.5 cm.




Your player is then 63 inches or 5 feet, 3 inches which is a little short, but still okay. The average adult human height is anywhere from 5 1/2 to 6 feet (167.64 to 182.88 cm).



Quote:

The rest of the requested data is already in an earlyer post;
liftcable unscaled = 212 quants (after scaling 108)
weightcable unscaled = 108 quants (after scaling 212)
so the growing or shrinking lenghts = 104 quants




With an inconsistant size, the script won't work right. Both cables must be the same size or a much more complex system has to be used (well, not much more, but considerably more complex). Apparently the total height span is 320 quants given this. I suggest shrinking the cables to 16 or 32 quants tall instead so you can have more accuracy. They have to be the same size for the best results. Without them being the same size, one cable will "grow" faster than the other and would look weird, unless some more complex algorithm is used.



Quote:

I have set the speed of the elevator at 3*time, I don't know how many m/sec that is.




3*time means 3*16 or 48 quants per second. With your map scale of 1:2.5, just multiply 48*2.5 to get 120 cm/s which is 1.2 meters per second (~2.68 mph). Given x*time, the speed is merely:

(x*16)/map_scale = units per second

1:2.5 means 1 quant is 2.5 (units) and means 1/2.5 in the formula. This is fraction and that's why division by this value is used.



Quote:

Please make it so that I can calculate the my.scale_z for different lengths of the cables and explain it to me step by step.

Regards,
Frits




If you had both cables the same length, it would be much easier to do. If you used 16 quants for the cable size, as I'm suggesting, you'd do this:

1. Set the elevator at the lowest position it can go. Use one of the entity skills to log this value as it's important. That is, have "elevator.skill1 = elevator.x" at the very top of the action before any loops.
2. From here, determine the maximum scale factor. This is done by adding the total lengths of the cables (supposedly 320 in your case) and dividing this by the unscaled cable length. If your cables were 16 quants long, the maximum scale factor would be 20 as 320/16 = 20.
3. From the top of the elevator where the cable connects to the elevator to the top of where it connects on the wheels above, find how how many quants there are between these two points.
4. Use "total_distance / elev_cable_unscaled_height" to find the maximum scale factor.
5. To move the elevator, use "elevator.z = speed*time;" where speed is the speed you want. If speed was 5, it'd be 2 meters per second (for a simpler way for you to gauge and set the speed).
6. To get the weight cable lengths, use "weight_cable.scale_z = (elevator.z-elevator.skill1)/cable_unscaled_height+1;". What this does is that it first finds the height difference from the lowest point. That is, if the elevator is 30 quants above it's lowest point, the part in parentheses, done first due to the order of operations, this height difference is used to determine the main unscaled height. As the elevator gets higher, the weight cable gets "longer" and thus increases the scale. The +1 at the end comes from adding the root scale value, of which is 1 (normal size). Longer means a higher scale value and this is just an adjustment.
7. For the elevator cable length, use "elev_cable.scale_z = total_scale_limit - weight_cable.scale_z;" to synchronize the cables so they're the same size. This step only works when both cables are the same size.

Did I explain this good enough or do you need a graphic or something to go along with it?


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Elevator cable [Re: ulillillia] #74526
05/30/06 10:31
05/30/06 10:31
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
I may be clinically insane, but after thinking about the problem for 5 minutes, I might have:
*used a six-sided or open-ended four-sided model for each cable
*once: relatively snapped the "vater" cable's x,y coordinates to center + offset of
--the bottom vertices of the figure eight rig on the right loop
--and dropped the z coordinate of the "vater" cable down a bit
*once: relatively snapped the "weight" cable's x,y coordinates to center + offset of
--the bottom vertices of the figure eight rig on the left loop
--and dropped the z coordinate of the "weight" cable down a bit
*once: snapped the four top vertices (x,y,z) and the four bottom vertices (x, y only) of the "vater" cable
--to the attachment vertices of the figure eight rig right loop
--using eight vec_for_vertex + vec_to_mesh instructions
*once: snapped the four top vertices (x,y,z) and the four bottom vertices (x, y only) of the "weight" cable
--to the attachment vertices of the figure eight rig left loop
--using eight vec_for_vertex + vec_to_mesh instructions
*lazy implementation: move the "vater" -distZ
--move the "weight" up + "vater" distZ
*post move: snapped the bottom vertices of the "vater" cable to the top cable attachment vertices of the "vater"
--using four vec_for_vertex + vec_to_mesh instructions ignoring x,y and using only z
*post move: snapped the bottom vertices of the "weight" cable to the top cable attachment vertices of the "weight"
--using four vec_for_vertex + vec_to_mesh instructions ignoring x,y and using only z
Ok, certainly that wouldn't work and I'm still a madman.

Quote:

Did I explain this good enough or do you need a graphic or something to go along with it?



Quoted ulillillia (-5 pts for spelling the name from memory).
Some of the dummies in the class (like me) need the graphics but don't really need an excuse to want to look at purty drawins.
edit: Seriously.

Last edited by testDummy; 05/30/06 10:37.
Re: Elevator cable [Re: testDummy] #74527
05/30/06 11:38
05/30/06 11:38
Joined: Dec 2005
Posts: 478
India
M
msl_manni Offline
Senior Member
msl_manni  Offline
Senior Member
M

Joined: Dec 2005
Posts: 478
India
Hey, If you really need a solid solution then PM me. I think I can solve your problem.


My Specialities Limited.
Re: Elevator cable [Re: Frits] #74528
05/30/06 12:28
05/30/06 12:28
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US

its not the cable thats the important part ( thats easy) its making the movment of the lift car and the counter weight ballanced out

they need to move in sync with eachother over a set distance with a single input ( button push?)

once you have THAT working then your 2 cable models ( with origin at ONE end ( i'd use the top end) are easy

vertex attach cables to the top assembly
vec distance to verx location on top of car lift and top of counter weight from origin point of each cable connection point . using that vector set the correct angles and scaled distance of each cable for direction and length

one problem you will have with this scalling method is skin texture compression/stretching if you use a patterned skin on the cable

Re: Elevator cable [Re: ulillillia] #74529
05/30/06 12:32
05/30/06 12:32
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Much too complex!!!
Let me refraise and simplify my question; (forget other posts)
I have one (1) cable, initial length = 100 quants.
It has to grow to 900 quants. (So it grows 800 quants).
The max. scale factor: 900 / 100 = 9
Growing factor: 3 * 16 = 48 quants/sec.
Total growing time: 800 / 48 = 16.67 sec.

I think I don't need this;
The map scale = 1 : 2.5
The speed of growing: 3 * 16 * 2.5 /100 = 1.2 m/sec.


The question is;
how much is the CableScaleFactor to be used in;
liftcable.scale_z += CableScaleFactor * time;

Regards,
Frits


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: Elevator cable [Re: Grimber] #74530
05/31/06 07:34
05/31/06 07:34
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Quote:


its not the cable thats the important part ( thats easy) its making the movment of the lift car and the counter weight ballanced out

they need to move in sync with eachother over a set distance with a single input ( button push?)





That problem is solved already, the elevator and the counter weight move in sync.

Quote:


vertex attach cables to the top assembly
vec distance to verx location on top of car lift and top of counter weight from origin point of each cable connection point . using that vector set the correct angles and scaled distance of each cable for direction and length





Please explain.
Look at my last post; I only need to calculate (not in the script but on a calculator) the CableScaleFactor.

Regards,
Frits

Last edited by Frits; 05/31/06 07:39.

I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: Elevator cable [Re: Frits] #74531
05/31/06 09:18
05/31/06 09:18
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
wouldn;t need a pre calcualted 'scalefactor' as long as you know 2 things length of your cable model in quants and the distance you need the object scaled to:

distance_length / model_length = scale_factor

model.scale_z = scale_factor;

you don;t need a time calulation for this, you already have that by the movment of your lift/counterwieght. the distance_length will proportionatly be increased/decreased by TIME as the lift and counterweight move

you just need at any given frame the distance from X ->Y to calcualte the scaleing factor

Re: Elevator cable [Re: Grimber] #74532
05/31/06 11:15
05/31/06 11:15
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Quote:


distance_length / model_length = scale_factor
model.scale_z = scale_factor;




That I understand.

This
Quote:


vertex attach cables to the top assembly
vec distance to verx location on top of car lift and top of counter weight from origin point of each cable connection point . using that vector set the correct angles and scaled distance of each cable for direction and length




I don't.
Please explain it to me (a piece of script perhaps? I am still a noob in scripting.)

Thanks in advance,
Frits


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: Elevator cable [Re: Frits] #74533
05/31/06 11:21
05/31/06 11:21
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
I don't understand what it means either myself. English is my native language and this is rather confusing sounding. "vec" stands for "vector", "verx" supposedly stands for "vertex". Even making this replacement, the statement is still very unclear and confusing.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Page 3 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