Help with Moveroute Equivalent

I found this explanation in this Forum under Scriptcall List. I tried one hour to get it to Work, but failed.

The Author wrote it in a way that a not knower is unable to use it.

This is the Quote, its not working it always gives error message Arguement Error 0 of 1 etc...That means i wrote it wrong.

Can someone easy up this Moveroute explanation for starters?

http://forums.rpgmakerweb.com/index.php?/topic/25759-script-call-collection-for-vxace/

Code:
move_route = RPG::MoveRoute.newmove_route.repeat = false           # This means the event will repeat the actionmove_route.skippable = true         # This means the event will skip the move route if it's not possiblem = RPG::MoveCommand.newm.code = 45                         # The List of M Code can be found over Game_Character Default Script, this current m.code is call scriptm.parameters = ["script call here"] # This is if you use #45 in M.code									# To show animation in move route just type animation_id = n, for balloons it's balloon_id = nmove_route.list.insert(0,m.clone)$game_player.force_move_route(move_route)         # For Player$game_map.events[ID].force_move_route(move_route) # For Events# ----------------------------------------------# Other Move Route Options# ----------------------------------------------# Single ActionnewCommand.code       = moveCode       # See List in Game_Character Default Script newCommand.parameters = [""]           # This refers to Jump, Wait, Switch On, Switch Off, Change Speed,                                        # Change Frequency, Change Graphic, Change Opacity, Play SE and Script.newRoute.list.insert(0,newCommand.clone)# Multiple Actions (Example)# newCommand.code       = 1# newRoute.list.insert(0,newCommand.clone)# newCommand.code       = 3# newRoute.list.insert(0,newCommand.clone)# newCommand.code       = 1# newRoute.list.insert(0,newCommand.clone)# For Turning$game_map.events[eventid].set_direction(n) # For Events$game_player.set_direction(n)              # For Players#Direction n = [2]Down [4]Left [6]Right [8]Up# Changing Event Graphic$game_map.events[id].set_graphic("character_name", character_index)# id is the id of the event you want to change.# "character_name" is the name of the graphic file you want to change to (make sure to keep the quotation marks).# character_index is the index on the character sheet (it starts counting at 0).
Before anything else:

Why do you want to use scripts to program a move route? Why can't you use the regular set move route command?

Because all advantages to use the script version require that you know how to script - if you don't, then this will not give you any advantage over the event command.

And scripting something like that is not beginner level - which is why it will be better if you tell us before what you want to use that for instead of expeciting a tutorial for all the different points how you might use it, risking that we missing the special application you'r planning.

I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
The Move Route command is so complicated that it has its very own script slot.

I agree with Andar - explain what you are trying to achieve, and why you want to use a script to do it instead of the Move Route command, and we will be in a better position to help you.  Otherwise we'd just be giving you something as general as the script you started with and find too hard to understand.
Its a Idea about a rpgmaker towerdefense Game 🙂 .

I wanted it easier than set up the moveroute for every Level, which is going to be very long, i wanted to let the Event just move forward1 step and if he hits region 1or 2 let the event turn.

I dont know how to Set that up in custom Moveroute on Eventpage. The Scriptcall Line is very short 🙂 .

And doing the Event on Paralell would be too much if i use 50 to 100 Enemie Events on Paralell.

So i decided i want 1 Event that gives the Moveroute to the Events. Thats Possible but i would need to set up all 50 to 150 Moveroutes for each Event.

That is why i wanted to use Scriptcallrequivalent to Safe me much work. Icant define a Variable for a Event to Set his Moveroute, i need Scriptcall equivalent for that.

Hope my bad english explained it, just used more sentences^^.

Pseudo Code:

for id in (1..150) #Event Ids that need a Movecommand

do:

I have a Event id that want to check if he is on Region1 than he turns 90degrees left if Region2 he turns 90degrees right else Other Region = no turning around,

than he moves 1Step forward.

Edit:

One write way i tried to use the code in eventcommand script.To let a Event walk one step.

Code:
move_route = RPG::MoveRoute.newmove_route.repeat = false        move_route.skippable = true   m = RPG::MoveCommand.newm.code = 4move_route.list.insert(0,m.clone)$game_map.events[9].force_move_route(move_route)
If it's going to be long doing it as an evented move route, it's going to be even longer doing it as a scripted move route 🙂  You still have to input all the movement commands, as well as the extras to set it up and execute it.

Going to move this back to VX Ace Support

You can do something like this, in an Autonomous Move Route (so avoid parallel process):

Script: set_direction(2) if $game_map.region_id(@x, @y) == 2Script: set_direction(4) if $game_map.region_id(@x, @y) == 4Script: set_direction(6) if $game_map.region_id(@x, @y) == 6Script: set_direction(8) if $game_map.region_id(@x, @y) == 81 Step ForwardThis means your event will continue to move forward unless they encounter a tile that has a region of 2, 4, 6 or 8 (corresponding to the directional arrows), and if it hits one of those, it will turn in that direction, and then move forward.

See why it's good to explain WHAT you're trying to achieve, rather than just asking for help with the particular approach you currently have in mind? 😉

Are your events already created and on the map, or are you spawning them?  If you're spawning them, what script are you using?  (link)
Yeah like i said i want to use the one step forward command, thanks for showing me how to write down the condition for region that short.

Got some other workaround in the meanwhile, but i will test this one too.

Edit:

The Events are normal Events shaz.

Can you give me the also the Command not used in AutoMoveroute but in Eventcommand Script?

So i can control different Events from one single Event?

Event[id] 1 Step Forward
Don't go there - it has a reason why the event command is called "set move route", not "move event". You need to preprogram the move for later execution, or you're risking a lot of problems in the game loop that controls everything.


And the inside of set move route is identical to the inside of autonomous movement.
If they are all events on the map and not spawned, just create one with that autonomous move route, and copy/paste it to create all the others. Then each event will take care of itself and you won't have to use a loop.
Ok than i stay with this Workaround

Event Autonomous Moveroute 1Step Forward and repeat.

And i have 1 Paralell Event that does the turningif event 1..100 is hiting region 1 or 2 or 3 or 4 (dont know the turn 90degrees command.

Its working, but thisway i need to use antilag script so events outside of map start there moveroute.

If i would have the command to move a event with id destinated with variable to move 1 step forward, i would not need aoutonoumous moveroute,

and i would not need the antilag script, and the cool sliding around corners effect i saw in my testdemo would not apear (with that on e i could life).

So my Problem is solved, but to know my initial question would be great.

Please dont tell me it dont works, this is from archeias thread collection, i just need help with this:

move_route = RPG::MoveRoute.newmove_route.repeat = false # This means the event will repeat the actionmove_route.skippable = true # This means the event will skip the move route if it's not possiblem = RPG::MoveCommand.newm.code = 45 # The List of M Code can be found over Game_Character Default Script, this current m.code is call scriptm.parameters = ["script call here"] # This is if you use #45 in M.code # To show animation in move route just type animation_id = n, for balloons it's balloon_id = nmove_route.list.insert(0,m.clone)$game_player.force_move_route(move_route) # For Player$game_map.events[ID].force_move_route(move_route) # For Events# ----------------------------------------------# Other Move Route Options# ----------------------------------------------# Single ActionnewCommand.code = moveCode # See List in Game_Character Default Script newCommand.parameters = [""] # This refers to Jump, Wait, Switch On, Switch Off, Change Speed, # Change Frequency, Change Graphic, Change Opacity, Play SE and Script.newRoute.list.insert(0,newCommand.clone)# Multiple Actions (Example)# newCommand.code = 1# newRoute.list.insert(0,newCommand.clone)# newCommand.code = 3# newRoute.list.insert(0,newCommand.clone)# newCommand.code = 1# newRoute.list.insert(0,newCommand.clone)# For Turning$game_map.events[eventid].set_direction(n) # For Events$game_player.set_direction(n) # For Players#Direction n = [2]Down [4]Left [6]Right [8]Up# Changing Event Graphic$game_map.events[id].set_graphic("character_name", character_index)# id is the id of the event you want to change.# "character_name" is the name of the graphic file you want to change to (make sure to keep the quotation marks).# character_index is the index on the character sheet (it starts counting at 0). i posted also what i tried to set it up. so does nobody know how this scriptlines are put together to use em.

all the movecommands are in the standard scripts, with simple number, thats very easy to understand, but iam not even able to let a event move one step left.

just need a working example put together.
That code above basically is a template for a working example - can you give us specific questions about which parts you do not understand?

Because we do not know the level of your scripting knowledge, so simply relisting all those commands obviously won't help you.
This Code inserted in Eventcommand Script doesnt work:

move_route = RPG::MoveRoute.newmove_route.repeat = false move_route.skippable = true m = RPG::MoveCommand.newm.code = 4move_route.list.insert(0,m.clone)$game_map.events[9].force_move_route(move_route)I tried several other writing ways, but i was not able to get one to function.

So i asume i forgot a template line, or i have written something wrong.

Thats why iam asking for help since Post 1 to find out whow it is written down so it functions 🙂 .

And yes if that Template gets an easier Tutorial Text, it would be Awesome.
at first glance it looks correct - but I'm no ruby expert.

To check some other possible causes:

How do you give that script command? Are you sure that it is the only move route command that gets to event 9?

Every time an event gets a move route, the previous move route is deleted - and move commands need time to execute.

If that script command is repeated too fast, it will bever be executed.

If the event has automatic movement or a different set move route, that move route can also override your commands
No always pops a different error message up. each different writing way.

So iam not even close to the case your describing ^^

But included you the Demo for the workaround at the moment.

But i would realy like to find out how it works, because that would safe me much other work later on.

http://www.file-upload.net/download-10953259/VXAce-Medi-Eval.exe.html

73Event running into a circle and continuing that^^.

Imagine i change a few road points, i would need to do a whole new moveroute and than deleting the otheer events and than pasting the new ones again just to test one little change^^ the workaround allready safes me that work, but it isnt perfect for me yet.
This Code inserted in Eventcommand Script doesnt work:
 
No always pops a different error message up. each different writing way.
"Doesn't work" is something other than "gives error messages"


Would it really have hurt you to give us a screenshot of an error message you want to have solved instead of letting us guess if the code is even executed or if there are other influenzes?
In my first Post i mentioned that i get Error Messages,normaly Pictures are better, but this Time i just needed someone who explains me the tutorial lines i linked.

The Code,i dont understand, is directly visible with explanation. So i asume others dont understand that tutorial text also not? That would make everything more understandable for me 🙂 .
Please show us the error you get from that code - at the moment I think the code is working correctly but there is something else that fails you.

But to identify that we need the error message you get.
And a screenshot of the event that contains the script call, so we can see what's happening before & after.
Ah the Germans made it allready Work a long time ago.

http://rpgmaker-vx-ace.de/board9-rpg-maker-vx-ace-lite/board11-hilfe-forum/3737-eine-bewegungs-route-per-script-befehl-festlegen-und-ausf%C3%BChren-lassen/

Not perfect, but it works, but i will stay with the work around of mine, cause i have more control with it, even if its some more work in a few cases.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-moveroute-equivalent.45457/