Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,246 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
lift judder #439408
04/02/14 13:23
04/02/14 13:23
Joined: Jan 2005
Posts: 282
devon UK
D
DAVIDMORETON Offline OP
Member
DAVIDMORETON  Offline OP
Member
D

Joined: Jan 2005
Posts: 282
devon UK
Hello,
I have a lift platform which judders when the player gets on it and it moves.( I do not want to use the standard lift01 as it moves as soon as the player gets on it – I want the lift ‘triggered’ by the switch while the player is standing on it).
I assume there must be some reaction between the player and the lift – their bounding boxes?
I have tried inserting bits of code from the template lift code to solve this problem, but to no effect. Below is the code I use to work the lift. A lever is pulled and the lifts moves;-
Code:
function craterlift()                 
{
   while (levercrater.tilt < 359)    //lever switch which activates lift
   {  
      levercrater.tilt += 20 * time_step;
      wait (1);
   }
   while (platform1.z > -60)         //something needed here to stop judder?
   {
     platform1.z -= 2 * time_step;   //lift starts to move
     wait (1);
   }
}
action craterlever()
{
   levercrater     = my;
   my.enable_click = on;
   my.event        = craterlift;
}


Can anyone help please? I have spent a LOT of time on this – and it has beaten me !!
Kind regards, David
(david@davidmoreton1.wanadoo.co.uk)


Last edited by rayp; 04/02/14 14:02. Reason: added code tags ( press "edit" to see how i did it, and please use them next time [again] )
Re: lift judder [Re: DAVIDMORETON] #439411
04/02/14 13:47
04/02/14 13:47
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Are you sure it's not the camera/ player code that leads to some shaking?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: lift judder [Re: Superku] #439412
04/02/14 14:13
04/02/14 14:13
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
If ull run the event code more then one time, lets say twice at once, iam pretty sure this leads to that shaking. Deactivate the event directly after it was called, and reactivate it, if lift - movement is done. Besides that, if u dont use "levercrater" somewhere else i would use "my" as pointer in the whiles. Btw. i wont put whiles in events.
Please note: if the lift moves u should check below and above ( via c_trace + use_box ) that the lift is able to reach its end, say a model walks below the lift ( and keeps standing ) ull have a never ending while.

edit: If you have a function / void handling the camera, maybe
Code:
proc_mode = PROC_LATE;

fixes the prob ( a wild guess ).

Greets


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: lift judder [Re: rayp] #441225
05/15/14 22:30
05/15/14 22:30
Joined: Nov 2005
Posts: 66
Spokane, WA, USA
Vonman Offline
Junior Member
Vonman  Offline
Junior Member

Joined: Nov 2005
Posts: 66
Spokane, WA, USA
It looks to me that small spikes in your framerate could cause the time_step variable to flux a little, which could cause the "speed" of the platform to speed up and slow down in fractions of a second.

You should either increase the time_smooth variable or create a function that smoothens your lift speed.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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