Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Need some opinions/help, Rmxp
Vexus
post Apr 15 2012, 01:15 PM
Post #1


Level 19
Group Icon

Group: Revolutionary
Posts: 396
Type: Mapper
RM Skill: Intermediate




Hi, I'm making my town "lively" by adding routines to npcs with a day/night system and so far I think I finally managed to make it work. (Tough sometimes they screw up alone even tough the game doesn't lag or anything as I keep a static 38-39 fps.)

The events trigger at different times or require certain switches but 1 thing I need to figure out is how will I regulate their events if I'm inside some cave or house when the time has passed. (For now I was thinking on having events inside every house/cave that would make switches turn on/off at x time for each npc that has routines when your still inside.)

Now the biggest problem is I'm using move route for the npcs movement to lessen fps impact but I have certain npcs that walk in a place, stay there and when it's time to go home for the night they start walking from there. The problem is when you enter a house and exit again the npc will obviously be teleported back where they are placed initially instead of where they were. This means that currently when I enter a house and exit it and a certain event should start walking his route from a different position it will get stuck and never complete it's route unless I find a way to solve it. (I'm also afraid that with all the parallel process events some steps might gets skipped.)

So what would you guys do so that each npc that has routine could progress normally even if you enter a house and exit again?

I know it might sound confusing but if you guys require more information just post and I'll try to explain better.

Thanks

This post has been edited by Vexus: Apr 15 2012, 01:16 PM


__________________________
Current Project/s:
Go to the top of the page
 
+Quote Post
   
amerk
post Apr 19 2012, 05:01 PM
Post #2


Level 56
Group Icon

Group: Global Mod
Posts: 1,784
Type: None
RM Skill: Undisclosed
Rev Points: 15




If I'm not mistaken, events will always begin again from their original spot unless they are coded not to, which can get very tedious. It's a lacking feature in RM for an event to memorize its location. I believe there is a script that fixes this for VX, but I don't know if there is one in XP. You could always ask around in the scripts request to see if somebody knows.


__________________________
Go to the top of the page
 
+Quote Post
   
Rast
post Apr 19 2012, 06:28 PM
Post #3


Level 71
Group Icon

Group: +Gold Member
Posts: 3,289
Type: Musician
RM Skill: Advanced
Rev Points: 10




Well, I did something of the sort in an old RM project(albeit in Rm2k3) that never took off. What I did was code each NPC to store it's X/Y position into variables(Which obviously resulted in a ton of variables).

My old method
The first page of each NPC event required their Y variable to be 0. As it was impossible to be at 0,0 on any of my town maps, this would only happen if the player had entered that area for the first time(because the variable hadn't been initialized, and RM treats uninitialized variables as 0). On this page, it would record their X and Y position to it's respective variable.

On page two, the requirement would be that their Y variable is above 0. This page would record the event's X/Y position to it's respective variables.

The third page would require the switch "Not In Town" to be on. This switch would be turned on when going into any building or area outside the town. The page itself would set the event's location to it's last recorded X/Y position, and then turn the switch "Not In Town" off, returning the event to page two where it would continue recording it's location.

The downside to this is that with a ton of NPCs, there will be a lot of recording, and it might slow things down. You can ease this a bit by coding it to only record the position every few seconds, though you'll probably get a bit of lag anyways.


Though that's outdated and slow, and probably not quite what you're looking for. One method I thought of trying(but never did) was coding all the routines manually and updating it when the player entered the town. For example...


In a common event set as a parallel process, you change a variable that keeps track if where an NPC should be. It would updated a variable for each NPC, perhaps setting it to something like 1410 to represent an X value of 14 and a Y value of 10. Then, in the event itself you'd check the variable and move it where it should be by that time and set a correct move route for it. This would obviously work better for static NPCs.

At any rate, doing this with events will be complicated, and in RMXP you're probably better off searching or requesting a script.


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 12:31 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker