4 added 116 characters in body edited Jan 13 '15 at 13:05 user15805 Since this is Unity, I do not recommend working with XML files. The work needed to parse them is just useless. Instead, focus on creating custom editors for your scripts. This will help you in the long run. Create a script for the basic routine. In the editor of this script, you should be able to enter a location and an activity. If you want extra stuff, you may want to use some base class for routines and extend it as needed. class Routine : MonoBehaviour. A NPC will have multiple routine components, and you will choose between them depending on the current time. Identify routines by name, or something else, for each NPC. Make sure the Location and Activity properties of the routine are editable in Unity's editor. More exactly, you want to be able to select a location from the scene. That means you should be able toSleep routine for the king? Find the bed in the scene's list of objects and drag & drop it into the routine's location slot :) Pretty handy. Create a script for the schedule. Schedules map timeframes to routine scripts. Dictionary. Attach a schedule to each of your NPCs. Schedules will manage the routine components that you have and will add. Create a custom editor for your schedule script so that it provides a nice and GUI-driven way to select the hours for each routine. Make a nice red glowing warning message in the editor if you haven't filled the 24 hours a NPC needs. This is useful, and will catch plenty of bugs. The same applies for empty location slots or empty activities. Add any sort of other functionality you might want, extending the editor will make it a breeze. Extend the editor to add custom functionality. It's worth it. Don't ignore Unity's engine features by using workflows that fit other engines better. When the player enters a level at a specific hour, you have a few choices. Spawn multiple NPCs in similar places and make them walk to their routine's location. This might look weird. Some old games did it (Gothic). Personally, I'd auto-teleport all NPCs to their routine's location when the level starts. me.teleportAt(mySchedule.myCurrentRoutine.location); Since this is Unity, I do not recommend working with XML files. The work needed to parse them is just useless. Instead, focus on creating custom editors for your scripts. This will help you in the long run. Create a script for the basic routine. In the editor of this script, you should be able to enter a location and an activity. If you want extra stuff, you may want to use some base class for routines and extend it as needed. class Routine : MonoBehaviour. A NPC will have multiple routine components, and you will choose between them depending on the current time. Identify routines by name, or something else, for each NPC. Make sure the Location and Activity properties of the routine are editable in Unity's editor. More exactly, you want to be able to select a location from the scene. That means you should be able to drag & drop it in the routine's location slot :) Pretty handy. Create a script for the schedule. Schedules map timeframes to routine scripts. Dictionary. Attach a schedule to each of your NPCs. Schedules will manage the routine components that you have and will add. Create a custom editor for your schedule script so that it provides a nice and GUI-driven way to select the hours for each routine. Make a nice red glowing warning message in the editor if you haven't filled the 24 hours a NPC needs. This is useful, and will catch plenty of bugs. Add any sort of other functionality you might want, extending the editor will make it a breeze. Extend the editor to add custom functionality. It's worth it. Don't ignore Unity's engine features by using workflows that fit other engines better. When the player enters a level at a specific hour, you have a few choices. Spawn multiple NPCs in similar places and make them walk to their routine's location. This might look weird. Some old games did it (Gothic). Personally, I'd auto-teleport all NPCs to their routine's location when the level starts. me.teleportAt(mySchedule.myCurrentRoutine.location); Since this is Unity, I do not recommend working with XML files. The work needed to parse them is just useless. Instead, focus on creating custom editors for your scripts. This will help you in the long run. Create a script for the basic routine. In the editor of this script, you should be able to enter a location and an activity. If you want extra stuff, you may want to use some base class for routines and extend it as needed. A NPC will have multiple routine components, and you will choose between them depending on the current time. Identify routines by name, or something else, for each NPC. Make sure the Location and Activity properties of the routine are editable in Unity's editor. More exactly, you want to be able to select a location from the scene. Sleep routine for the king? Find the bed in the scene's list of objects and drag it to the routine's location slot :) Pretty handy. Create a script for the schedule. Schedules map timeframes to routine scripts. Dictionary. Attach a schedule to each of your NPCs. Schedules will manage the routine components that you have and will add. Create a custom editor for your schedule script so that it provides a nice and GUI-driven way to select the hours for each routine. Make a nice red glowing warning message in the editor if you haven't filled the 24 hours a NPC needs. This is useful, and will catch plenty of bugs. The same applies for empty location slots or empty activities. Add any sort of other functionality you might want, extending the editor will make it a breeze. Extend the editor to add custom functionality. It's worth it. Don't ignore Unity's engine features by using workflows that fit other engines better. When the player enters a level at a specific hour, you have a few choices. Spawn multiple NPCs in similar places and make them walk to their routine's location. This might look weird. Some old games did it (Gothic). Personally, I'd auto-teleport all NPCs to their routine's location when the level starts. me.teleportAt(mySchedule.myCurrentRoutine.location); 3 added 272 characters in body edited Jan 13 '15 at 12:59 user15805 Since this is Unity, I do not recommend working with XML files. The work needed to parse them is just useless. Instead, focus on creating custom editors for your scripts. This will help you in the long run. Create a script for the basic routine. In the editor of this script, you should be able to enter a location and an activity. If you want extra stuff, you may want to use some base class for routines and extend it as needed. class Routine : MonoBehaviour. A NPC will have multiple routine components, and you will choose between them depending on the current time. Identify routines by name, or something else, for each NPC. Make sure the Location and Activity properties of the routine are editable in Unity's editor. More exactly, you want to be able to select a location from the scene. That means you should be able to drag & drop it in the routine's location slot :) Pretty handy. Create a script for the schedule. Schedules map timeframes to routine scripts. Dictionary. Attach a schedule to each of your NPCs. Schedules will manage the routine components that you have and will add. Create a custom editor for your schedule script so that it provides a nice and GUI-driven way to select the hours for each routine.   Make a nice red glowing warning message in the editor if you haven't filled the 24 hours a NPC needs. This is useful. Create slots in which you can place objects from the scene for your routine locations. The Sleep routine requires a bed. You should be able to select the exact bed you want the routine to happen at from the scene, you don't want to parse it from XML and search for it in the scenewill catch plenty of bugs. Add any sort of other functionality you might want, extending the editor will make it a breeze. Extend the editor to add custom functionality. It's worth it. Don't ignore Unity's engine features by using workflows that fit other engines better. When the player enters a level at a specific hour, you have a few choices. Spawn multiple NPCs in similar places and make them walk to their routine's location. This might look weird. Some old games did it (Gothic). Personally, I'd auto-teleport all NPCs to their routine's location when the level starts. me.teleportAt(mySchedule.myCurrentRoutine.location); Since this is Unity, I do not recommend working with XML files. The work needed to parse them is just useless. Instead, focus on creating custom editors for your scripts. This will help you in the long run. Create a script for the basic routine. In the editor of this script, you should be able to enter a location and an activity. If you want extra stuff, you may want to use some base class for routines and extend it as needed. Create a script for the schedule. Schedules map timeframes to routine scripts. Attach a schedule to each of your NPCs. Create a custom editor for your schedule script so that it provides a nice and GUI-driven way to select the hours for each routine.   Make a nice red glowing warning message if you haven't filled the 24 hours a NPC needs. This is useful. Create slots in which you can place objects from the scene for your routine locations. The Sleep routine requires a bed. You should be able to select the exact bed you want the routine to happen at from the scene, you don't want to parse it from XML and search for it in the scene. Add any sort of other functionality you might want, extending the editor will make it a breeze. When the player enters a level at a specific hour, you have a few choices. Spawn multiple NPCs in similar places and make them walk to their routine's location. This might look weird. Personally, I'd auto-teleport all NPCs to their routine's location when the level starts. Since this is Unity, I do not recommend working with XML files. The work needed to parse them is just useless. Instead, focus on creating custom editors for your scripts. This will help you in the long run. Create a script for the basic routine. In the editor of this script, you should be able to enter a location and an activity. If you want extra stuff, you may want to use some base class for routines and extend it as needed. class Routine : MonoBehaviour. A NPC will have multiple routine components, and you will choose between them depending on the current time. Identify routines by name, or something else, for each NPC. Make sure the Location and Activity properties of the routine are editable in Unity's editor. More exactly, you want to be able to select a location from the scene. That means you should be able to drag & drop it in the routine's location slot :) Pretty handy. Create a script for the schedule. Schedules map timeframes to routine scripts. Dictionary. Attach a schedule to each of your NPCs. Schedules will manage the routine components that you have and will add. Create a custom editor for your schedule script so that it provides a nice and GUI-driven way to select the hours for each routine. Make a nice red glowing warning message in the editor if you haven't filled the 24 hours a NPC needs. This is useful, and will catch plenty of bugs. Add any sort of other functionality you might want, extending the editor will make it a breeze. Extend the editor to add custom functionality. It's worth it. Don't ignore Unity's engine features by using workflows that fit other engines better. When the player enters a level at a specific hour, you have a few choices. Spawn multiple NPCs in similar places and make them walk to their routine's location. This might look weird. Some old games did it (Gothic). Personally, I'd auto-teleport all NPCs to their routine's location when the level starts. me.teleportAt(mySchedule.myCurrentRoutine.location); 2 added 272 characters in body edited Jan 13 '15 at 12:51 user15805 First, define what a routine is. Routine { location; activity; //... any other details you might want to consider. }  Then, split your NPC's schedule in pieces. Routine from 22:00 to 7:00 - Sleep; Routine from 7:00 to 18:00 - Work;  ... and so on. These have to add up to 24 hours. If they don't, either assert or use a default routine. I'd assert, to make catching bugs easier. Actual implementation: Since this is Unity, I do not recommend working with XML files. The work needed to parse them is just useless. Instead, focus on creating custom editors for your scripts. This will help you in the long run. Create a script for the basic routine. In the editor of this script, you should be able to enter a location and an activity. If you want extra stuff, you may want to use some base class for routines and extend it as needed. Create a script for the schedule. Schedules map timeframes to routine scripts. Attach a schedule to each of your NPCs. Create a custom editor for your schedule script so that it provides a nice and GUI-driven way to select the hours for each routine. Make a nice red glowing warning message if you haven't filled the 24 hours a NPC needs. This is useful. Create slots in which you can place objects from the scene for your routine locations. The Sleep routine requires a bed. You should be able to select the exact bed you want the routine to happen at from the scene, you don't want to parse it from XML and search for it in the scene. Add any sort of other functionality you might want, extending the editor will make it a breeze. When the player enters a level at a specific hour, you have a few choices. Spawn multiple NPCs in similar places and make them walk to their routine's location. This might look weird. Personally, I'd auto-teleport all NPCs to their routine's location when the level starts. First, define what a routine is. Routine { location; activity; //... any other details you might want to consider. }  Then, split your NPC's schedule in pieces. Routine from 22:00 to 7:00 - Sleep; Routine from 7:00 to 18:00 - Work;  ... and so on. These have to add up to 24 hours. If they don't, either assert or use a default routine. I'd assert, to make catching bugs easier. Actual implementation: Since this is Unity, I do not recommend working with XML files. The work needed to parse them is just useless. Instead, focus on creating custom editors for your scripts. This will help you in the long run. Create a script for the schedule. Attach a schedule to each of your NPCs. Create a custom editor for your schedule script so that it provides a nice and GUI-driven way to select the hours for each routine. Make a nice red glowing warning message if you haven't filled the 24 hours a NPC needs. This is useful. Create slots in which you can place objects from the scene for your routine locations. The Sleep routine requires a bed. You should be able to select the exact bed you want the routine to happen at from the scene, you don't want to parse it from XML and search for it in the scene. Add any sort of other functionality you might want, extending the editor will make it a breeze. When the player enters a level at a specific hour, you have a few choices. Spawn multiple NPCs in similar places and make them walk to their routine's location. This might look weird. Personally, I'd auto-teleport all NPCs to their routine's location when the level starts. Since this is Unity, I do not recommend working with XML files. The work needed to parse them is just useless. Instead, focus on creating custom editors for your scripts. This will help you in the long run. Create a script for the basic routine. In the editor of this script, you should be able to enter a location and an activity. If you want extra stuff, you may want to use some base class for routines and extend it as needed. Create a script for the schedule. Schedules map timeframes to routine scripts. Attach a schedule to each of your NPCs. Create a custom editor for your schedule script so that it provides a nice and GUI-driven way to select the hours for each routine. Make a nice red glowing warning message if you haven't filled the 24 hours a NPC needs. This is useful. Create slots in which you can place objects from the scene for your routine locations. The Sleep routine requires a bed. You should be able to select the exact bed you want the routine to happen at from the scene, you don't want to parse it from XML and search for it in the scene. Add any sort of other functionality you might want, extending the editor will make it a breeze. When the player enters a level at a specific hour, you have a few choices. Spawn multiple NPCs in similar places and make them walk to their routine's location. This might look weird. Personally, I'd auto-teleport all NPCs to their routine's location when the level starts. 1 answered Jan 13 '15 at 12:44 user15805