Fix turn combat facing and player movement
This commit is contained in:
20
tools/freeze-turn-player.mjs
Normal file
20
tools/freeze-turn-player.mjs
Normal file
@@ -0,0 +1,20 @@
|
||||
import { readFileSync, writeFileSync } from 'node:fs';
|
||||
|
||||
const file = 'Global/DefaultPlayer.model';
|
||||
const data = JSON.parse(readFileSync(file, 'utf8'));
|
||||
const values = data.ContentProto.Json.Values || [];
|
||||
|
||||
for (const value of values) {
|
||||
if (value.TargetType === null && ['speed', 'jumpForce', 'walkAcceleration'].includes(value.Name)) {
|
||||
value.Value = 0;
|
||||
}
|
||||
if (value.TargetType === 'MOD.Core.MovementComponent' && ['InputSpeed', 'JumpForce'].includes(value.Name)) {
|
||||
value.Value = 0;
|
||||
}
|
||||
if (value.TargetType === 'MOD.Core.RigidbodyComponent' && ['MoveVelocity', 'RealMoveVelocity'].includes(value.Name)) {
|
||||
value.Value = { x: 0, y: 0 };
|
||||
}
|
||||
}
|
||||
|
||||
writeFileSync(file, `${JSON.stringify(data, null, 2)}\n`, 'utf8');
|
||||
console.log('Turn-combat player movement disabled.');
|
||||
Reference in New Issue
Block a user