Hi all,
Im making some lufia-like tools from scratch using scripting in MV and im a little stuck with the moveRoutes for the hook hot.
In short this is the list when I spawn the event -> [{code:12},{code:45, parameters[checklocation(this)]...repeats a few times if no hit...{code:45, parameters[reverse(this)]};
checkLocation() also calls addChain() if hookshot didn't hit anything. Addchain() spawns a new event at the player with moveroute.list = [{code:12}] and repeat = true. The hookshot spawns these events until it reaches the reverse() move
Now the problem I have is changing the moveRoutes of all the spawned events simultaneously to [{code:13}...repeat until at player, {code:45, parameters[despawn()]}]. Setting the moveRoutes themselves is not a problem, Im just calling forceMoveRoute(route) (or setMoveRoute, dont understand the difference) on all the events basically with this ->
for (let i = 0; i < this._hookshotChain.length; i++){
var chain = this._hookshotChain
chain.setMoveRoute(chain.reverseChain(i))
}
the _hookshotChain contains all the events of the hookshot
and then then route is
route = new MoveRoute();
var backward = {code: 13};
var end = {code: 45,parameters:["$gameMap.despawnEventId(this._eventId)"]};
for (let i=0;i<=index;i++){
route.list = backward;
}
route.list.push(end);
return route;
However when executing this. The behavior on screen is that the Hookhot tip(last in the array) and last spawned event (= first in the array) move backward simultaneous but the other events still move forward 1 tile and then move backward. I have no idea how this moveRout processing works and can't find much clarification on google. Anyone got any ideas?
Im making some lufia-like tools from scratch using scripting in MV and im a little stuck with the moveRoutes for the hook hot.
In short this is the list when I spawn the event -> [{code:12},{code:45, parameters[checklocation(this)]...repeats a few times if no hit...{code:45, parameters[reverse(this)]};
checkLocation() also calls addChain() if hookshot didn't hit anything. Addchain() spawns a new event at the player with moveroute.list = [{code:12}] and repeat = true. The hookshot spawns these events until it reaches the reverse() move
Now the problem I have is changing the moveRoutes of all the spawned events simultaneously to [{code:13}...repeat until at player, {code:45, parameters[despawn()]}]. Setting the moveRoutes themselves is not a problem, Im just calling forceMoveRoute(route) (or setMoveRoute, dont understand the difference) on all the events basically with this ->
for (let i = 0; i < this._hookshotChain.length; i++){
var chain = this._hookshotChain
chain.setMoveRoute(chain.reverseChain(i))
}
the _hookshotChain contains all the events of the hookshot
and then then route is
route = new MoveRoute();
var backward = {code: 13};
var end = {code: 45,parameters:["$gameMap.despawnEventId(this._eventId)"]};
for (let i=0;i<=index;i++){
route.list = backward;
}
route.list.push(end);
return route;
However when executing this. The behavior on screen is that the Hookhot tip(last in the array) and last spawned event (= first in the array) move backward simultaneous but the other events still move forward 1 tile and then move backward. I have no idea how this moveRout processing works and can't find much clarification on google. Anyone got any ideas?