Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
Let me explain first what I am trying to do; I am making a vehicle move in one direction across a road in a custom move route using a pixel-movement script, and change the direction of the vehicle when it reaches the point, I actually DID make it work using this script call in the move route: 

set_direction(6) if @x == 11 && @y == 32

HOWEVER because it is pixel movement, it moves forward one time and checks the script, repeating over and over so it moves like choppy/laggy because it stops to check the script.
Is there any way I can do this? Maybe there's a script call that doesn't stop the event? Really need this, thanks in advance!
 
Last edited by a moderator:

HitYourGrandma

Ruler of all Evil and Procrastination
Veteran
Joined
Sep 28, 2015
Messages
64
Reaction score
20
First Language
English
Primarily Uses
N/A
This would probably work.

Capture.PNG



The 11 there is just the map x (or y) that you want the event to reach. The second page is set to 'Self Switch: A is ON' where whatever you want to happen happens after that point is reached.
 

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
Oh yeah that seems pretty good, but being a parallel process would probably make it laggy, wouldn't it? There will probably be around 3-4 vehicles roaming around which is why I went with the move route way, also if I make it parallel process I can't think of a way to make the event "kill" the player when it touches him, forgot about that too.
 

HitYourGrandma

Ruler of all Evil and Procrastination
Veteran
Joined
Sep 28, 2015
Messages
64
Reaction score
20
First Language
English
Primarily Uses
N/A
You could just have the move route of the vehicle go until it reaches the desired x and/or y. Set the priority as 'same as characters' and the trigger 'player touch', where the event page is the desired effect, such as a game over.
 
Last edited by a moderator:

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
And how do I do that exactly?  Move forward if X =! 11 and Y =! 20? I mean how do I write that in the script? I'm not good at all at scripting
 
Last edited by a moderator:

HitYourGrandma

Ruler of all Evil and Procrastination
Veteran
Joined
Sep 28, 2015
Messages
64
Reaction score
20
First Language
English
Primarily Uses
N/A

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
Yeah I know how to do that, but I want it to repeat move right until it reaches and X/Y (for example) like you did before (think like a conditional branch within the move route with a Script)
 
Last edited by a moderator:

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
592
Reaction score
228
First Language
English
Primarily Uses
RMMZ
You didn't show us your original event or link the script you're using so there may be a lot of important details I'm missing here.


Anyway, try something like this within the event's Autonomous Movement.


Locate Script..., the last item on the last column, insert this into the box, and change/remove the coordinates as needed.


case [x, y] when [1,1] ; move_straight(6) when [14, 1] ; move_straight(2) when [14, 11] ; move_straight(4) when [1, 11] ; move_straight(8) else move_forward end


By default, the event should move in a square so long as you place it correctly.
 
Last edited by a moderator:

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
THANK YOU Rinobi! That was it, works like a charm!! I really appreciate and will for sure credit you when I finish this.
Thanks to both of you.

One last thing though, what do I type in to activate a switch when it reaches a certain X/Y too? when [14,1] ; $game_switches(40) ? Something like that. (Or a self-switch for that matter)

(For example, a car reaches a stop sign and activates a switch, while on this switch you can interact with the car, I have something that accomplishes this task but sometimes events get on the way and it stops before it should)
 
Last edited by a moderator:

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
592
Reaction score
228
First Language
English
Primarily Uses
RMMZ
You're close. The syntax for turning that global switch on would be:


when [14, 1] ; $game_switches[40] = true




As for self switches, it depends on if you're setting the switch within the event page, within the move route, or somewhere else.

Code:
$game_self_switches[[@map_id, @event_id, "A"]] = true # Turn self switch A on within an event's pages.

$game_self_switches[[$game_map.map_id, id, "A"]] = true # Turn self switch A on within an event's move route

$game_self_switches[[4, 8, "A"]] = true # Turn self switch A on for event 8 on map 4
 
Last edited by a moderator:

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
Thank you so much. This can be closed now.
 

Latest Threads

Latest Profile Posts

Wanted to look through job ads and now I spent about an hour laughing about the website of a spiritual healer looking for a Marketing and IT guy. Call me oldfashioned, but I think that "healing of deceaseds" comes a little late.
Workin' hard! Wish I was hardly workin'...
One of these days, I will have no more errors.
The tutorial streak is going on, learn something about cave edits today!
(And possibly in a few days even more, stay tuned ;) )
Something is working in my game, and I have no idea how or why. It wasn't working yesterday. But it is now.
So we're just gonna...move on, and never, EVER, touch that passive again, lest it break.

Forum statistics

Threads
129,915
Messages
1,206,234
Members
171,111
Latest member
choupie
Top