May 28th: Awareness

I got it so levels can reset, which was simpler than I thought it would be, but was still a bit intimidated by the prospect of revising the entity editor so it worked with the new paradigm. Fortunately something else came up and I didn’t have to… yet.

The behavior system I use involves reading class data from xml files and then generating the appropriate behavior for use in runtime. There’s a problem with this that didn’t come up in testing: This only works if the class itself exists in program memory, and that only happens if I’ve explicitly imported it for use in the program. When I was testing all of this stuff out, everything was active in memory because I had test instances up and running to make sure everything worked, but now that I’ve deleted all of that stuff it means it couldn’t find the class information when it tried to generate the entity from its prototype.

It turns out that haxe’s importing scheme is lazy, and only actually generates the class data if something is explicitly imported — just using a wildcard import of the entire package didn’t help at all. Fortunately, they thoughtfully included a set of macros, among which was one which allowed me to recursively import the entire package of all existing behaviors. This means that any behaviors I add in the future should be automatically included, and all should be usable in the entity editor. It wasn’t what I had in mind for today, but it’s not bad for a day’s work.


About problemmachine

What is the nature of your problem? Can we modify the nature of your problem? Can your problem be touched? Eaten? May we eat your problem for you? May we eat your soul for you? Would you like a replacement problem? We make problems. We eat souls. We crap solutions. We are Problem Machine.
This entry was posted in Daily Update, Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s