Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Needing a fix for what appears to be a built in bug.

ok this might be in the wrong place as it deals with events but i believe i found a bug that i can't find any mention of.
If i have a multi-page moving event and more than one page has custom movement...it all gets screwed up. it seems like where the game stores the info for the steps never gets emptied. so the event seems to try to follow the new custom movement and the old at the same time

for instance on page one i have

turn randomly
move forward
move forward
repeat.

next page i have something like

move towards player
change speed 4
move towards player
move towards player
move towards player
move towards player
change speed 3
repeat.

this is to have it chase the player at slightly less than speed 4 and works great when it works.

unfortunately... the games seems to remember the first instructions also. causing very weird and stupid movement. ex. moves randomly at speed 4 and sometimes 3 sometimes moves towards the player but mostly seems to just act crazy. If the event gets set back to page one it might just run around with its random pattern but all at speed 4.

So i was hoping that maybe someone could tell me how to clean out the steps cache or something. maybe change the code to fix this.

i have tried using "wait for move completion" before switching to the new page but that just stalls it for a really long time(like it has the next 50 steps memorized and has to go through them all, then it sometimes works but most often does not) is there no way to tell an event to stop moving and forget the steps it has stored?

If i am just missing something than i am sorry for being stupid =)

Thanks
 
What are you using to switch pages?
these are not parallel or auto-run event pages, are they?
Are you using "Autonomous Movement"?

I just tried this, using an external switch to change pages and autonomous movement on the event, and it works just like I'd expect.
 
yes "autonomous movement" is what i am using. the pages are parallel processes switched through a called common event.

basically it is for roaming monsters

the first page is the basic habits of the monster, the movement is controlled through the "autonomous movement" while the event sets some basic info in variables like range of sight and so on then it calls a common event to actually do all the calculations, range from player direction of facing and so on. The page is switched by setting a event self switch ( a= true) within the common event if everything checks out that the monster can see the player

the second page is the "chase" it is very similar to the first page in that it is also a PP and the movement is controlled by the "autonomous movement" and the event sets up the give up distance then calls another common event to control that among other things like hit detection/facing ect..

everything works fine as long as the second page's auto movement is set to approach. but when i change it to custom everything goes wacky. and the monster gets caught in between the 2 sets of movement commands often running around
like an idiot.


edit: i have looked at the script and realized that the reason that approach works just fine is that it doesn't use any of the variables that the custom does... but i am not good enough at ruby to find where or how it all messes up.
 
Try running the parallel commands in a separate event (invisible event), with the autonomous movement, and any discrete commands on the monster events. (controlled by switches, with Action or _Touch Triggers)
 
hmmm i think i understand what you are saying but how would the separate invisible event control the other monster event without having to setup a ton of stuff for each one.

the idea is to have basically plug in play monsters they are not dependent on any separate variables. I can drop them anywhere and they work without having to setup a bunch of stuff. For example they all share the same line of sight variable that is set right before the common event is called. But they all have different lines of sight, and "distance before they give up" ect.

so if that info is in another invisible event how would it control the monster?

I have been using them this way for awhile and it works great as long as the chase page is only on "approach" so i don't really want to have to change everything now. I was hoping there might be a way to call a short script from within the common event to clear out the custom movement memory or something before it switches to the chase page.

Thank you for your help
 
well i was looking in the scripts and found that if i remove

if jumping? or moving?
return
end

from the beginning of move_type_custom in Game_character 2

then it will allow the new step commands to override the old ones just fine and everything works great. Of course now it will always override instantly. could i use "Wait for moves completion" to avoid that in other events? or will this cause any other problems i haven't thought of?
 
If you have other move routes running, I would use a plain "wait" command, and just calculate the # of frames to wait.
The "Wait for move Completion" will wait for ALL executing move routes, and could cause problems.

I would expect your edit would 'interrupt' previous move routes, even if they are not finished.

Your edit should only effect consecutive forced movement. so the wait commands should do the trick. Test it out.
 
After some testing it seems to be working pretty well. I have added a check for a switch in the script so i can turn it back on for cut-scenes and what not. here it is in case anybody else has had this problem. just turn on the switch to force it to overwrite.

if jumping? or moving?
unless $game_switches[328]
return
end
end

thanks for the feedback.....although i did'nt really use any of the advice you gave :biggrin: it all helped me think about it and look at the script more. I have been trying to get rid of that bug for along time and just gave up on that part of the game until recently.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top