Hallo, heute wollte ich den Cityrunner aus dem Spiel verlängern (den ab 1995). Doch wenn der Ladebildschirm lädt stürtzt das Spiel kurz danach ab. Was ist an diesem Script falsch?
this.length = 1;
this.frontOffset = 2.8;
this.rearOffset = 3.4;
this.frontAnchor = 1.0;
this.rearAnchor = 3.4;
this.displayName = MAIN.$strings.$vehicle_tram05;
this.capacity = 8;
this.acceleration = 1.5;
this.braking = 0.3;
this.speed = 1.1;
this.turning = 1.4;
$objectinfoPattern = MAIN.$strings.$objectinfo_timesLastMonth_pattern;
$objectinfoText = MAIN.$strings.$objectinfo_tram;
$objectinfoRange = [4, 19];
this.addPath("doorR0-enter", GRID_PATH_END, vector(2.0, 0.3, -0.8), QUAT_IDENT, vector(-0.5, 0.3, -0.8), QUAT_IDENT);
this.addPath("doorR0-exit", GRID_PATH_START, vector(-0.5, 0.3, -0.8), QUAT_IDENT, vector(2.0, 0.3, -0.8), QUAT_IDENT);
with (this.loadSkeleton("tram05_scene.skeleton")) {
.loadAnimation("default", "tram05_anim.animation", 0);
}
this.doorOpenStart = 0.0;
this.doorOpenLen = 1.0;
this.doorCloseStart = 35.0 / 30.0;
this.doorCloseLen = 1.0;
$price = 160000;
$trailers = [
["tram-05b", false],
["tram-05c", false],
["tram-05b", false],
["tram-05c", false],
["tram-05b", false],
["tram-05e", false]
];
$icon = MAIN.$window.video.new_texture("/metro/objects/vehicles/tram-05/tram05-icon.dds");
$rendering = "metro/objects/vehicles/tram-05/tram05-render.dds";
$reliability = 0.90;
$fuelConsumption = 0;
$electricityConsumption = 16;
$attractiveness = 0.85;
$speed = 75;
$type = 1;
$infoText = MAIN.$strings.$vehicle_tram05_info;
with (this.doorOpenSound = new_sound(this)) {
.load("/metro/sounds/4. Bus door opening1 (hiss clank short).wav");
.volume = 1.0;
.minDistance = 50.0;
.maxDistance = 300.0;
}
with (this.doorCloseSound = new_sound(this)) {
.load("/metro/sounds/4. Bus door closing2 (short) .wav");
.volume = 1.0;
.minDistance = 50.0;
.maxDistance = 300.0;
}
with (this.moveSound = new_sound(this)) {
.load("/metro/sounds/4. Tram movement1 (pitch2).wav");
.volume = 0.5;
.minDistance = 50.0;
.maxDistance = 300.0;
}
with (this.bellSound = new_sound(this)) {
.load("/metro/sounds/4. Tram bell3 (2 hits).wav");
.volume = 1.0;
.minDistance = 50.0;
.maxDistance = 300.0;
}
with ($brokenEffect = new_particleEmitter(this)) {
.direction = vector(0.0, 1.0, 0.0);
.minParticleSpeed = 2.0;
.maxParticleSpeed = 3.0;
.minParticleAngle = 0.0;
.maxParticleAngle = 1.0;
.minParticleLife = 2.0;
.maxParticleLife = 4.0;
.maxDistance = 400.0;
.particleSize = 0.5;
.setParticleScale(1.0, 0.1, 6.0);
.particleAirResist = 0.5;
.gravitation = vector(0.0, 3.0, 0.0);
.density = 40.0;
.addColorRange(0x80333333, 0x00333333);
.setTexture("effects/particles/lightsmoke.dds");
.conditions = GRIDVEHICLE_BROKEN;
.sortParticles = true;
.autoemit = true;
.visible = true;
}
event this.onLoaded::() {
$brokenEffect.position = vector(0.0, 0.0, -2.0);
}