View Single Post
Old 24-08-10, 16:01   #16
Join Date: Nov 2007
Posts: 1,689
Default The horizontally moving platform

The two basic problems

You will encounter two basic problems, if you want to build a horizontally moving platform.

The first problem is, that Lara wouldn´t move with the platform, as she does on a vertically moving platform. So you need to move her with flipeffects in the same direction and the same speed, as the platform moves. Depending on your setup this can become more or less complex.

The second problem is even more basic. All collision in the tr4-engine is blocky. So if you move a platform horizontally and you have dummy-triggers for the platform below the route of it, then you collision would jump from sector to sector and wouldn´t move smoothly with the platform.

The solutions

You can have all kind of setups for the horizontal movement. Let´s do a relatively simple example of continual yo-yo movement to the N and back.

So first we need to move the platform:

Parameters= PARAM_MOVE_ITEM,1,IGNORE,53,DIR_NORTH,13312,32,IGN ORE,IGNORE; platform movement

This commands defines a movement of the platform with the ID 53 northward for 13 sectors (13312 units) with the speed of 32 units per frame and backward to the south.

For the movement of Lara we use the flipeffect "Lara. (Physics) Pad+Over Mode. Attract Lara in <&>direction with (E)speed". Lara should move in the direction of the platform, as soon as she is on the sector of the plaform. So we use the GT_DISTANCE_FROM_ITEM, where the item is the platform 53 and the distance is 0.
So for the northward movement we have the following lines:
Triggergroup= 15,$2000, 158, $2000; Lara. (Physics) Pad+Over Mode. Attract Lara in <&>direction with (E)speed; <&> : North; (E) : Speed= 32

And southward:
Triggergroup= 17,$2000, 158, $2004

So now we have to find a solution, that Lara really moves also north/southward, if the platform does so. So we enable/disable the matching GT`s in the right moments:
Triggergroup= 10,$2000, 167, $1,$2000, 109, $C01,$2000, 109, $E00; move item with param_move_item 1, enable GT 12, disable GT 14
Triggergroup= 12,$2000, 167, $3,$2000, 109, $C00,$2000, 109, $E01; move item with param_move_item 3,disable GT12, enable GT 14

No we need a organizer to do the continual yo-you movement for the platform:
Organizer= 2,FO_LOOP + FO_TICK_TIME,IGNORE,416,10,416,12
The platform has a speed of 32 and moves a distance of 13312 units. So one movement needs 13312:32=416 frames.
You need to trigger the organizer in the map in the wished moment.

As a solution for this problem we use a trick. We place the platform at a door connection between two rooms. As soon as Lara is on the platform, we trigger a flipmap (here flipmap 1) in the upper room, in which we use Toggle Opacicity 1 on the door connection. So as soon, as Lara is on the platorm, the flipemap is triggered and Lara will stand on the TO 1-surface and if she leaves the platform, the flipmap is untriggered. I was surprised, that this idea works indeed, but with some slight limitations. If Lara comes very close to the edges of the platform, it may happen, that Lara falls through the platform and if Lara would jump against the thin edge of the platform, she would move through it. So you have to take this in account.

Triggergroup= 23,$2000, 124, $3E01; FlipMap. Enable <&>flipmap with (E)buttons for activation; <&> : FlipMap= 1; (E) : [1] [2] [3] [4] [5] (Immediate activation)
Triggergroup= 24,$2000, 126, $1; FlipMap. FlipOff for <&>flipmap; <&> : FlipMap= 1

Last edited by Raymond; 24-08-10 at 16:55.
Raymond is offline