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
579
Reaction score
220
First Language
English
Primarily Uses
RMVXA
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
579
Reaction score
220
First Language
English
Primarily Uses
RMVXA
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 Posts

Latest Profile Posts

Evening humans! How goes the game make?
The anime characters we saw 20 years ago,
still have the same age when we see them now.
Somehow it's strange but also beautiful.
It's like no matter how much we change,
there's certain part of ourselves we can reconnect to when we see them again.
Took a long, long time, way longer than it should to be honest...but I've finally finished the big content update to my demo!
Lots of not good things happening IRL but I'm not gonna let this day end like this. Quote time:
"Success is not final, failure is not fatal: it is the courage to continue that counts." -Winston Churchill

So, keep going, lads. Whatever you do keep going. Until next time.

It's a Spanish devlog don't get scared!. (please)

Forum statistics

Threads
117,240
Messages
1,105,801
Members
153,405
Latest member
Eamon_Dev-Alera
Top