diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c05330d..e49839ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ _2023_ #### Gameplay - Adding Push Objects (missing side-ways push in LBA2) +- Adding GOTO_SYM_POINT move command (truck can go backwards) #### Editor @@ -18,6 +19,7 @@ _2023_ - Extra bonus speed - Behavioiur Menu Icons CSS - Fixed Sprites out of place caused by wrong scene point coordinates +- Fixed Editor Scene Node Variables ## [v0.6.0](https://github.com/LBALab/lba2remake/compare/v0.5.0...v0.5.1) Big update! diff --git a/TODO.md b/TODO.md index 8bf1ac51..05dfdbe0 100644 --- a/TODO.md +++ b/TODO.md @@ -11,12 +11,8 @@ Below are some ideas we want to work on. Feel free to contribute with your own i - [ ] Sprites not drawn fully (bottom half missing) - [ ] LBA1: Remove island loading between scenes - [ ] LBA1: Twinsen stumbles in platforms (2 directions only) -- [ ] Editor: Scene Flags not updating -- [ ] 3D Audio Issues -- [ ] Gameplay: Improve Collisions +- [x] Editor: Scene Flags not updating - [ ] Scripting: Investigate possible parsing error Scene 155, actor=Hussar, line 135 -- [ ] Fix Interjections -- [ ] Improve Bounding Boxes (orientation - LBA1 Truck Citadel) - [ ] Invisible Bricks Issues - [ ] Shadows Missing - [ ] Fix Ground Tiles Atlas Bleeding diff --git a/src/game/Actor.ts b/src/game/Actor.ts index b3dad99f..f153c2ff 100644 --- a/src/game/Actor.ts +++ b/src/game/Actor.ts @@ -458,18 +458,25 @@ export default class Actor { this.physics = initPhysics(this.props); } - goto(position: THREE.Vector3) { + goto(position: THREE.Vector3, backwards: boolean = false) { this.physics.temp.destination = position; let destAngle = angleTo(this.physics.position, position); if (destAngle < 0) { destAngle += Math.PI * 2; } + if (backwards) { + destAngle += Math.PI; + } this.physics.temp.destAngle = destAngle; this.state.isWalking = true; this.state.isTurning = true; return this.getDistance(position); } + gotoBackwards(position: THREE.Vector3) { + return this.goto(position, true); + } + gotoPosition(position: THREE.Vector3, delta: number) { G.position.set(0, 0, 0); P.set(0, 0, 0); diff --git a/src/game/scripting/move.ts b/src/game/scripting/move.ts index 8e1a358a..0d318d20 100644 --- a/src/game/scripting/move.ts +++ b/src/game/scripting/move.ts @@ -111,7 +111,39 @@ export function ANGLE(this: ScriptContext, angle) { } } -export const GOTO_SYM_POINT = unimplemented(); +export function GOTO_SYM_POINT(this: ScriptContext, point: Point) { + if (!point) { + return; + } + if (this.game.getState().actorTalking > -1) { + this.state.reentryOffset = this.state.offset; + this.state.continue = false; + return; + } + if (this.actor.index === 0 && this.game.controlsState.firstPerson) { + adjustFPAngle(this); + } + + let distance = 0; + if (this.actor.props.flags.isSprite) { + distance = this.actor.gotoPosition( + point.physics.position, + this.time.delta * WORLD_SCALE * this.actor.props.speed + ); + } else { + distance = this.actor.gotoBackwards(point.physics.position); + } + + if (distance > 0.55) { + this.state.reentryOffset = this.state.offset; + this.state.continue = false; + this.state.goingToPoint = true; + } else { + this.actor.stop(); + this.state.goingToPoint = false; + delete this.state.lastVRAngleAdjust; + } +} export function WAIT_NUM_ANIM(this: ScriptContext, repeats) { if (!this.state.animCount) { diff --git a/www/metadata/lba1/scene_1.json b/www/metadata/lba1/scene_1.json index 1aa2c5e1..6cbd0806 100644 --- a/www/metadata/lba1/scene_1.json +++ b/www/metadata/lba1/scene_1.json @@ -1,7 +1,7 @@ { "actorNames": [ null, - null, + "GarbageTruck", "Grobo", "CitadelGuard3", "CitadelGuard4",