Coding direction needed (with reference to state changes)

We’ve kinda hit a wall with our uni project & it’s been the same wall for the last few weeks. Though, I must admit I personally have been a little slack over the holidays.

We need to make some state changes / triggered events to make this game a game!

Basically what I’m after is some code - some simple code.

We want our character to walk to an (object/model/flower vase whatever)
On the press of a key & within proximity of the object - the object must disappear. A simple go to object & collect it. How can we get this done? Can you give us some code plz?

I have tried creating collide meshes in the character model & all the mdoels that will need to be ‘collected’ - but then how to program the collision traverser/handler etc? ain’t there a simpler way?

We have look at using position variables to check if the character is in the correct position…

gah we’re basically banging our heads against the wall with this & we need some solid direction to aim in to get this done - instead of wndering how to do it & trying various methods…

Can some 1 plz - give us some direction…some code would be excellent! Go to object - collect it - object disappears from view.

plz! oh & thanks in advance :wink:

Not quite sure what you’re asking, but sounds like Seek and Arrive. Look into these examples:

https://discourse.panda3d.org/viewtopic.php?t=2336


discourse.panda3d.org/viewtopic.php … andasteer2

With PandaSteer, take a look at the follow plugin. Can’t help you too much myself, and I’m not sure if these will be useful to you or not, but if you’re banging to the point of swelling/bleeding, they just may inspire you in some way.

It can be hard to find exactly what you’re looking for in the forums, but if you keep looking, you usually come across something or other.

try these :
discourse.panda3d.org/viewtopic.php?t=2508
discourse.panda3d.org/viewtopic.php?t=3244

Stop banging your head, you might get alzheimer next year if you take it twice a day. Try poison, it’s faster. :laughing: :laughing: :laughing:

Our character must walk to an object - be-it a vase, a tv, a fish, a tie - anything we predefine as a collectable object. When the character is at the object on the press of a key the object should disappear from view.

Goto - Collect - Disappear

ynjh_jo suggestion is a bit more straightforward, go with that. :slight_smile: What I suggested isn’t as close to what you’re asking, but I think the first link may come in handy.

Ok, thanks =/

In stupid terms…

  1. #initialize traverser
  2. #initialize collision handlers
  3. #Load in character & create a collision solid for the character
  4. #create collision solids for all models that will trigger events when in the proximity of the character

5.#add collision node to the traverser and the pusher ???

^ all of the above was done in code from a sample posted. We have previously been adding collision meshes in the actual model code (in the .egg file)

Still got no solid direction to go in & still a little confused.