Hey, we have forums!

Author Topic: Is there a way to make Naija walk along a floor?  (Read 9664 times)

0 Members and 1 Guest are viewing this topic.

Offline bcgraham

  • Mini Bit
  • **
  • Posts: 6
    • View Profile
Is there a way to make Naija walk along a floor?
« on: February 01, 2009, 09:20:28 pm »
I'm trying to make Naija walk along a surface, especially a floor (like a monkey) ... I don't know if I'm doing it wrong or what, but I can't seem to get entity_movealongsurface() to work on her. Does anyone have a guess on how this might be done, or if its even possible?

Offline Align

  • Monster Bit
  • *******
  • Posts: 353
    • View Profile
Re: Is there a way to make Naija walk along a floor?
« Reply #1 on: February 01, 2009, 10:22:02 pm »
Since the player doesn't originally have that ability you're probably going to have to fiddle with something to get it to respond to controls instead of an automatic AI...

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: Is there a way to make Naija walk along a floor?
« Reply #2 on: February 02, 2009, 11:55:12 am »
I think it would be pretty possible, have you tried looking at monkey.lua and mermanthin.lua in the scripts file? You might learn something from them.

After a big of skimming through however, it seems that the function you just said makes an object walk in 1 direction with 1 speed, so, in that way, you would need to have some sort of control that reacts to the mouse when clicked, then alter its direction, I don't know if that's so easy.
God sees and knows everything, but at least he won't gossip about it.

Offline bcgraham

  • Mini Bit
  • **
  • Posts: 6
    • View Profile
Re: Is there a way to make Naija walk along a floor?
« Reply #3 on: February 02, 2009, 12:40:18 pm »
Okay, follow-up question. Into which script file would I put it? That's another issue I'm having - I don't know which .lua file controls Naija.

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: Is there a way to make Naija walk along a floor?
« Reply #4 on: February 02, 2009, 06:18:53 pm »
Okay, follow-up question. Into which script file would I put it? That's another issue I'm having - I don't know which .lua file controls Naija.
None of them- Naija's movement, animation, etc. are all hard-coded into the game.  Take a look through the Form Modification/Creation thread to see one way of working around this issue.  I don't know if Naija will respond at all to the moveAlongSurface function, though.

On the plus side, Naija does have a walking animation, which was last tweaked after her skeleton structure was finalized (unlike most of her unused animations), so ther is some hope.

- Edwards
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: Is there a way to make Naija walk along a floor?
« Reply #5 on: February 03, 2009, 02:56:24 am »
I don't think Naija would respond to moveAlongSurface either.  It would be hard to make it driven by the LMB as to my knowledge there is no way of disabling burst. Which is what you would need to do is somehow block Naija from clamping to wall as she walks foward, which is going to require a kludge of some kind.

If you made a walking 'form' and drove it using RMB, You could use a combination of avatarIsOnWall and entity_isUnderWater  to find out if Naija is out of the water and collided with the BG. Then perhaps the technique I've been using in Ninja Form of creating a new entity to check collisions using entity_isNearObstruction(). You might even be able to use OBSCHECK_DOWN with Naija to check if she has ground under her feet to walk on. I don't know anything about how entity_move () functions, but that might be the best bet for you to get it functioning. The other thing you will probably need is the normal of the floor, which might be harder to work out, if you could get it though, you could use entity_moveTowardsAngle  at 90 degrees to the floor. I would experiment a bit to find out what entity_move functions do out of the water.

Your other option for movement might be to make a dummy entity and have that moveAlongSurface and then clamp Naija to that. You might have to keep positioning her from moment to moment though, which would suck.