Tag Info

New answers tagged

0

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, ...


4

Don't hard-code it, or it'll indeed end up very messy. You need to script the NPCs daily routines into some data file (XML or other). Something along the lines of: <npc name="george"> <schedule start="0:00" end="8:00"> <sleep at="home"/> </schedule> <schedule start="8:00" end="9:00"> <walk leave="home" ...


0

I use coroutines. Coroutines are just functions which, instead of returning and exiting, yield while maintaining their state. For example, here is a python coroutine which counts up from 1 to N: def count(num): for i in range(1, num): print i yield RUNNING yield SUCCESS Now, to put a coroutine into your game loop, you simply have to ...



Top 50 recent answers are included