Player
Player copied to clipboard
Maniacs Patch - AddMoveRoute Command
Introduces the ability to chain multiple move route commands using a new AddMoveRoute (3027) event command, allowing for more flexible and scriptable character movement. Adds Game_Character::GetId and AppendMoveRoute methods, custom Maniac Patch move commands, and internal buffering logic in Game_Interpreter to support move route chaining. Also implements CommandAddMoveRoute in Game_Interpreter_Map and provides GetId overrides for player and vehicle classes.
I'm not 100% happy with my buffer system, it can cause conflict with @cmd (call command), since those "lie" about their com.code.
Here my tests, please help me comparing everything with maniacs patch:
@msg.show "Starting @ev.addAction test suite.
Using @ev.execAction for synchronization."
@msg.show "Test 1: Basic Movement Chaining.
Event should move in a square."
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .moveUp 1
@ev.addAction .moveRight 1
@ev.addAction .moveDown 1
@ev.addAction .moveLeft 1
@ev.execAction
@msg.show "Test 2: Parameterized Movement & Facing.
Moving up 2, facing right, moving right 3."
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .moveUp 2
@ev.addAction .faceRight
@ev.addAction .moveRight 3
@ev.addAction .faceDown
@ev.execAction
@msg.show "Test 3: Special Actions.
Testing Jump, Through, and Fix Direction."
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .beginThrough
@ev.addAction .jump 2, 2
@ev.addAction .fixDir
@ev.addAction .moveLeft 1
@ev.addAction .moveLeft 1
@ev.addAction .unfixDir
@ev.addAction .endThrough
@ev.execAction
@msg.show "Test 4: Properties and Assets.
Changing speed, frequency, graphic, and playing a sound."
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .speed 6
@ev.addAction .freq 7
@ev.addAction .moveDown 1
@ev.addAction .moveDown 1
@ev.addAction .se "decision1", 100, 100, 50
@ev.addAction .speed 3
@ev.addAction .setBody "actor2", 0
@ev.addAction .trans 3
@ev.addAction .moveLeft 1
@ev.addAction .moveLeft 1
@ev.execAction
@msg.show "Test 5: Game State Interaction.
Turning Switch 1 ON, then OFF during movement."
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .switch 1, 1
@ev.addAction .moveUp 1
@ev.addAction .switch 1, 0
@ev.addAction .moveDown 1
@ev.execAction
@msg.show "Test 6: Breaking the Chain.
Event moves right, then execAction waits and breaks the chain."
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .moveRight 1
@ev.addAction .moveRight 1
@ev.execAction
@ev.addAction .moveDown 1
@msg.show "The event should have moved right twice, then STOPPED.
It should NOT have moved down."
@msg.show "Test 7: Re-establishing a Chain.
Starting a new chain with another setAction."
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .moveLeft 1
@ev.execAction
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .moveUp 1
@ev.execAction
@msg.show "The event correctly moved up because a new chain was started."
@msg.show "--- Starting Variable-Based Tests ---"
@msg.show "Test 8: Variable Movement.
Setting v[10]=2 (Down), v[11]=3 (steps)."
v[10] = 2
v[11] = 3
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .move v[10], v[11]
@ev.execAction
@msg.show "Now testing variable facing.
Setting v[10]=3 (Face Left)."
v[10] = 3
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .face v[10]
@ev.execAction
@msg.show "Test 9: Using String Variables (t[]).
Setting t[1] to 'actor3' and v[10] to index 2."
t[1] .asg "actor3"
v[10] = 2
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .setBody t[1], v[10]
@ev.addAction .moveUp 1
@ev.execAction
@msg.show "Now using t[2] for a sound effect.
Setting t[2] to 'decision2'."
t[2] .asg "decision2"
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .se t[2], 80, 120, 50
@ev.addAction .moveDown 1
@ev.execAction
@msg.show "Test 10: Complex Dynamic Route.
Using variables for speed, freq, and jump."
v[10] = 5
v[11] = 6
v[12] = -3
v[13] = 1
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .speed v[10]
@ev.addAction .freq v[11]
@ev.addAction .jump v[12], v[13]
@ev.execAction
@msg.show "Resetting Event State.
Setting position to 10,7, facing down, and resetting all properties."
@ev.setAction .self .freq 8 .skippable .act {
}
@ev.addAction .jump -5, 2
@ev.addAction .setBody "actor1", 0
@ev.addAction .faceDown
@ev.addAction .speed -1
@ev.addAction .freq 3
@ev.addAction .trans 0
@ev.execAction
@msg.show "Test suite complete. Event has been reset."