CheeseLord / warts

WAcky Real Time Strategy
MIT License
1 stars 0 forks source link

Make models into actors #30

Open CheeseLord opened 7 years ago

kronmillerg commented 7 years ago

This is not as simple as just changing the call to loadModel to the Actor constructor:

@@ -114,7 +114,7 @@ class WartsApp(ShowBase):
             model = Actor(modelPath,
                           {"walk": "models/panda-walk4"})
         else:
-            model = self.loader.loadModel(getModelPath(modelPath))
+            model = Actor(getModelPath(modelPath))

         # Put the model in the scene, but don't position it yet.
         rootNode = render.attachNewNode("")

If you just do that, then you get warnings for all of our models that look like:

:Actor(warning): [...]/warts/assets/models/green-ground.egg is not a character!

Based on http://gamedev.stackexchange.com/q/37533, I suspect this may actually be as simple as "we're not listing any animations for our Actors, and anything with zero animations should be a model instead of an actor". So we may have to wait until we have a model of our own that defines more than zero animations; see #9.