Advice and help thread...

If all you want is to make the walls visible, then just do this:


Don’t mess with the bitmasks unless there is some specific reason to change the bitmasks.



This should show you the collision too.

There was a thread on how to use a group of animation in one file, but I can’t find it. Does anyone know how this would be done?



I would point you out this, hoping it helps.

sorry, not really. What I meant was if you have a group of animations in one file with the original model, how do you call them for use?

my stuff was for your main task (build a maze), I ain’t make clear that sorry. About your last question I aint what you ask but you may also load many single file animations to the same actor at once so I guess you’re wasting your time searching that…

First, make sure you’re loading your model as an Actor, not a generic Model. I’ve made that mistake multiple times. From there, if your animations aren’t neatly named/ID’d coming in from Blender (sorry, don’t know how to do that offhand, I’ve always been accepting premade models from artists), you may need to manually dig handles for them out of the Actor instance. See the API Reference and Manual for details on the Actor constructor and access methods.

Once you have handles to the animations, there should be fairly intuitive play()/start()-type methods associated with them, depending on which playback method you choose (direct play vs building into an interval vs manual posing). Again, see the Manual and Reference.

thanks. Another problem i have is that th Chicken exporter says it doesn’t export envelopes and when I expot the model with the animations, parts of the model don’t move with it. How do i fix?

just check if all the mesh vertexes gotta bone assigned to them

they do, but it still gives me that warning.

the warning is just a warning informing you that envelopes won’t be applied in your animations, but keyframes yes
if you mean that your model don’t move in Pview, so I guess could be for this reason (the bottom part) otherwise check the whole process steps in the provided link and your model will be ok

That is because chicken does not export the envelope method of deforming a mesh. It says right in the documentation that you have to use the armature modifier.

Thanks guys, i really apreciate the help. I have been working on this game for a competiton and your help has been so valuable. Another question though.

Ive set up the collision and everything for the from and into object but I cant seem to get the actor into the building because when i move it to the spot, The building’s collision mesh moves. Help?





c = mc.attachNewNode(CollisionNode('cnode'))
traverser = CollisionTraverser()
base.cTrav = traverser
pusher = CollisionHandlerPusher()
pusher.addCollider(c, wall)

No time to review your code in depth, but if you’re using a Pusher and the wrong geometry gets pushed, it probably means the wrong geometry is being passed to the pusher. Try switching where you plug your character and building colliders in.

That woked. but now Im havin issues with character movement. Roaming ralph Just managed to confuse the crap out of me and I have no Idea how to do it. my code isn’t in a class system and that doesn’t help much. Its nearing the end of the contest and this one vital piece is missing. Pleas help.

class World():
    def __init__(self):

       mc.isMoving = False

        self.keyMap = {"w":0, "a":0, "d":0}
        self.accept("escape", sys.exit,[0])

        self.accept("w", self.setKey, ["forward",1])
        self.accept("w-up", self.setKey, ["forward",0])
        self.accept("a", self.setKey, ["left",1])
        elf.accept("a-up", self.setKey, ["left",0])
        self.accept("d", self.setKey, ["right",1])
        self.accept("d-up", self.setKey, ["right",0])

        def taskMove(self, task):
      # move/rotate char
         if (self.keyMap["a"]!=0):
             mc.setH(mc.getH() + elapsed*300)
         if (self.keyMap["d"]!=0):
             mc.setH(mc.getH() - elapsed*300)
         if (self.keyMap["w"]!=0):
             mc.setY(mc, - (elapsed * speed))

      # handle anim
        if (self.keyMap["w"]!=0) or (self.keyMap["a"]!=0) or (self.keyMap["d"]!=0):
            if mc.isMoving == False:
                mc.isMoving = True
            if mc.isMoving:
                mc.isMoving = False
# mc stands for the character



Could someone please help me out here…

I’m assuming that your taskMove() is defined at the proper indent level, and that you’re adding it to taskMgr somewhere, and that ‘elapsed’ is being properly set as some function of time-since-last-call. Apart from that, the control logic looks sound enough. It would be useful to know what exactly is going wrong- the solution for a controls-not-registering type problem is going to be very different from a model-is-randomly-jittering type problem, for instance.

I adjusted the code:

def Controls():
    base.keyMap={"left":0, "right":0, "forward":0, "back":0}


    def setKey(base, key, value):
        base.keyMap[key] = value

    def move(self, task):
        elapsed = task.time - self.prevtime
        if (base.keyMap["left"]!=0):
  , - (elapsed*25))
        if (self.keyMap["right"]!=0):
  , + (elapsed*25))
        if (self.keyMap["forward"]!=0):
  , + (elapsed*25))
        if (self.keyMap["back"]!=0):
  , - (elapsed*25))

        base.prevtime = task.time
        return Task.cont

the problem is that it goes through, but doesn’t make the character move anywhere. Its wierd and there are no instructions in th manual as how to make movement. If there was that would be most helpfull.



Movement is not magic. It’s just a change in position. In your example,, - (elapsed*25)) 

what is being set? Where is the value you’re setting it to coming from?
I know the answer you want to both of those, and I can vouch for the answer you’ve implemented to one of them, but for the other, you’re either using a syntax I’m unfamiliar with or you haven’t quite thought things through (and either way, until you get into heavy optimization, it’s usually better to use the more intuitive/readable syntax given the choice, both so others can read your code, and so you can sanity-check yourself).

Also, if you’re dumping your control code into a separate class, make sure you have an instance of that class in your world, and make sure any object the controls act upon is either passed into the control class or else scoped at a sufficiently global level to be accessible from 2 classes at once.

So how would I move it? would i use a “set Pos” or SetX" method?