Cristiander

Veteran
Veteran
Joined
Aug 13, 2015
Messages
41
Reaction score
1
First Language
Romanian
Primarily Uses
I have a section in my game where the player is on a conveyor belt and is dodging incoming crates.

I had an area where the player couldn't move up or down, I made a couple of crates and set them to move down so that the player has to dodge them, but when I started nothing happened. I then found out that events don't move if they are offscreen.

I even tryed to force them to move, by having a separate event that runs the move route, but still no results.

I need to have these events move despite being offscreen. How do I go about this?

I found this script:

# Put [update] in the event's name and the move route will always update.## ~Kreadclass Game_Event < Game_Character #-------------------------------------------------------------------------- # * Determine if Near Visible Area of Screen #-------------------------------------------------------------------------- alias_method:)krx_alfix_ge_nts?, :near_the_screen?) def near_the_screen?(dx = 12, dy = 8) # YEA compatibility if $imported && $imported["YEA-CoreEngine"] dx = dy = nil end # YEA compatibility return true if @event.name.include?('[update]') return krx_alfix_ge_nts?(dx, dy) endendbut it doesn't work...

It only updates events that have begun moving, it doesn't help start their move route if they're offscreen
 
Last edited by a moderator:

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,146
Reaction score
659
First Language
English
Primarily Uses
N/A
Variables are your friends

To clarify. Set a second page on the event were the condition is a variable. Set it to 1 or something. Then when you need the box to move, have another event increase the variable to 1. Or you could just have the box be a parrellel process event that waits, then sets the variable to 1. If all the boxes use 1, just do this with one box

You might even be able to trigger it with a proximity script, but ive never tested it
 
Last edited by a moderator:

Cristiander

Veteran
Veteran
Joined
Aug 13, 2015
Messages
41
Reaction score
1
First Language
Romanian
Primarily Uses
Variables are your friends

To clarify. Set a second page on the event were the condition is a variable. Set it to 1 or something. Then when you need the box to move, have another event increase the variable to 1. Or you could just have the box be a parrellel process event that waits, then sets the variable to 1. If all the boxes use 1, just do this with one box

You might even be able to trigger it with a proximity script, but ive never tested it
That isn't diferent from what I was using. I was using a switch to determine if the boxes move or not.

I tryed what you told me but the result is the same, they don't move because they're offscreen
 
Last edited by a moderator:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,907
Reaction score
730
First Language
German
Primarily Uses
RMMZ
Strange...

Yes you are right the normal Custom Moveroute of Events doesnt Work out of Screen.

But if another Event gives the Moveroute via Set Mouveroute Command for that Event, than it will run around even if offscreen.

So iam not sure why that is not working for you?

Maybe you selected the wrong Event in the Eventcommand?

Or maybe you forgot to turn off the moveroute on the events you want to run around. If a Event has a Moveroute and when you than give it a New Moveroute

the old one will get overwritten even if it has not finished. That would happen the moment it Enters the visible Screen, so they need to be Fixed not on Custom if another Event is giving the Moveroute for them.

Thisway i made Cars running around automaticly in a big City.

My English aint the best, so i hope it Helps somehow. Difficult to explain.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,510
Reaction score
16,405
First Language
English
Primarily Uses
RMMV
You don't need a custom script for that. And if you search, you will see that this question was asked and answered (by me) very recently - within the last week.


Do a global search (control+shift+f) in the scripts for the following:

Code:
def near_the_screen?
and
Code:
def near_the_player?
One of those has two numbers, and the other has one. Just make them larger.
 

Cristiander

Veteran
Veteran
Joined
Aug 13, 2015
Messages
41
Reaction score
1
First Language
Romanian
Primarily Uses
You don't need a custom script for that. And if you search, you will see that this question was asked and answered (by me) very recently - within the last week.

Do a global search (control+shift+f) in the scripts for the following:

def near_the_screen?and
Code:
def near_the_player?
One of those has two numbers, and the other has one. Just make them larger.
Ok, did that and it still didn't work.

Turns out the the script Antilag - by Victor that I was using kept the objects from moving

I'll try to edit that part out now
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,510
Reaction score
16,405
First Language
English
Primarily Uses
RMMV
Yes, if you have scripts that overwrite those methods, you will need to change them instead, or as well.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,031
First Language
Tagalog
Primarily Uses
RMVXA
That is because anti lags mostly work by having events that are not on screen to stop updating...
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,146
Reaction score
659
First Language
English
Primarily Uses
N/A
Well im switching between working on two projects and one is a five nights at freddys-ish game and those methods work for it

Anyway, glad you found the awnser :)
 

Latest Threads

Latest Posts

Latest Profile Posts



I am curious that can you "understand/get the point" about what does this place do generally?
(ARPG game)
If anyone knows any C# programmers, please send them my way.
Chilling at night in a tavern.
ChillingAtTavern.png

After 'multiple breakdowns', it's finally over. 10/10 will do this again.
Ever notice that villains can reform and become better people, but heroes can only ever die... or live long enough to see themselves become villains?

Isn't that interesting?
xabileug wrote on Kaelan's profile.
Will you be back?

Forum statistics

Threads
129,844
Messages
1,205,656
Members
170,998
Latest member
Jack125gamer
Top