ladders not being ladders

Blitz3D Forums/Blitz3D Beginners Area/ladders not being ladders

Chad(Posted 2005) [#1]
Well, I've put in a ladder into my project, but whenever the camera collides with the ladder, nothing happens. I'm using WolRon's collision and FPS with a couple other mods to it such as JFK's wobble walking. But here's what I have for the ladders, if you need any more info let me know..



Thanks,
Chad


WolRon(Posted 2005) [#2]
First off, please ask a specific question. Note that in your entire post there is not one question mark(?). If you don't have one, then what exactly am I supposed to reply to?

Anyways, I *think* I see several things wrong with your code.

First off, you probably didn't supply us with enough code because if the above code is included in your program exactly as you've written it above, it won't work. The reason it won't work is because the last line (the EntityCollided one) needs to be inside of your game loop. If it isn't, then that's your first problem. If it's not in the game loop, it will only be executed one time, which obviously won't work because in order to work correctly, your program must check repeatedly to see if the player collided with the ladder.
So, in other words, your program should be structured like so:
Const type_ladders=5
Collisions PLAYER_COL, LEVEL_COL, 2, 2
Global ladders=LoadMesh("ladder.b3d")
PositionEntity ladders,25,0,0
EntityType ladders,type_ladders
Collisions player_col,type_ladders,2,2

.
.
.

While Not KeyHit(1) ;main game loop
  .
  .
  .
  If EntityCollided(player,type_ladders)<>0 Then TranslateEntity player,0,1,0
  .
  .
  .
Wend ;end of game loop

Also, you will have noticed that your second problem was the player_col variable you were using with the TranslateEntity command. You mistakenly were trying to translate the players collision type, not the players mesh, which of course you can't do. If fact, you should have received a Memory Access Violation. If you weren't, then what I suspected above (about you not having the EntityCollided command in the proper place) was probably true, wasn't it?


Chad(Posted 2005) [#3]
Your good WolRon, really good, and I'll work more on using question marks :-P

Thanks again,
Chad