Skip to content

Commit ada7dfe

Browse files
committed
escalator: Fix escalators in north-point mall
1 parent 97117d6 commit ada7dfe

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

scripts/main.nut

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function random( min = 0, max = RAND_MAX ) {
4343
dofile("./scripts/scripts.nut")
4444

4545
scripts_load("base/freeroam.nut")
46+
scripts_load("module/escalator_fix.nut")
4647
scripts_load("module/interiors.nut")
4748
scripts_load("module/vehicle_spawner.nut")
4849
scripts_load("module/emote.nut")

scripts/module/escalator_fix.nut

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// VC-MP attempts to keep players standing on objects.
2+
// However, if a step of an escalator is warped for re-use, it basically takes
3+
// the player with it, accelerating them to high speeds.
4+
//
5+
// This script creates step models which make it impossible for the player
6+
// to stand on the real steps, thereby avoiding the issue.
7+
8+
function create_escalator_fix(world, p, a, count) {
9+
local m = 584;
10+
local l = 0.4;
11+
local x = -l * sin(a);
12+
local y = l * cos(a);
13+
for(local i = 0; i < count; i++) {
14+
o <- CreateObject( m, world, p + Vector(x * i, y * i, 0.0), 255);
15+
o.RotateToEuler(Vector(0,0,a), 0);
16+
}
17+
}
18+
19+
function create_double_escalator_fix(world, p, a, count, d) {
20+
create_escalator_fix(world, p, a, count);
21+
create_escalator_fix(world, p + Vector(d, 0.0, 0.0), a, count);
22+
}
23+
24+
function create_double_stair_up_down_fix(world, p, a, d) {
25+
local d_level = 6.55; // up_level - down_level
26+
local d_forward = 11.65 + 0.75; // up_forward - down_forward
27+
28+
local p1 = Vector(p.x, p.y, p.z);
29+
create_double_escalator_fix(world, p1, a, 2, d);
30+
31+
local p2 = Vector(p.x - sin(a) * d_forward, p.y + cos(a) * d_forward, p.z + d_level);
32+
create_double_escalator_fix(world, p2, a + PI, 3, d);
33+
}
34+
35+
function onScriptLoad() {
36+
37+
local world = 0;
38+
local d = 1.924; // Distance between 2 escalators
39+
40+
// North point mall, as seen on radar, when facing north:
41+
//
42+
// 1 2
43+
// 3
44+
// 4
45+
// 5 6
46+
//
47+
// Coordinates are supposed to reflect the bottom of the left side.
48+
//FIXME: Some hacks break this "bottom of the left side" assumption.
49+
50+
local p1 = Vector(406.122 - 0.05, 1193.38, 17.9824);
51+
create_double_stair_up_down_fix(world, p1, 0.0, d);
52+
53+
local p2 = Vector(419.754 - 0.1, 1193.32, 17.8704);
54+
create_double_stair_up_down_fix(world, p2, 0.0, d);
55+
56+
local p3 = Vector(414.661 - 0.02, 1145.71, 17.4724 + 0.04);
57+
create_double_stair_up_down_fix(world, p3, PI, -d);
58+
59+
local p4 = Vector(412.785 - 0.1 + 0.05 + d, 1102.65, 17.4724);
60+
create_double_stair_up_down_fix(world, p4, 0.0, -d);
61+
62+
local p5 = Vector(408.213 - 0.1, 1058.5 - 0.02, 17.4724 + 0.71);
63+
create_double_stair_up_down_fix(world, p5, PI, -d);
64+
65+
local p6 = Vector(421.778 - 0.05, 1058.52, 18.2419 - 0.25);
66+
create_double_stair_up_down_fix(world, p6, PI, -d);
67+
68+
//FIXME: Airport also has escalators, but they are not broken.
69+
// We can still fix them for visual consistency.
70+
71+
// Washington mall also has escalators, but they are not broken.
72+
// They are also visually the best looking ones, as steps don't disappear.
73+
74+
}

0 commit comments

Comments
 (0)