Problem with IsCollidingWithChar and PPC module

Started by gamerman, Sun 21/10/2007 22:58:50

Previous topic - Next topic

gamerman

I'm working on my first game, that's like the firsts GTA games... My problem is: I want when the character CAR (who is a car :) ) collides with some other character (cEGO, for example), it's view is changed. I already tried the IsCollidinWithChar command and the PPC module, they don't worked.
Some help?



P.S - Sorry about my bad english :-\

Ashen

What have you tried that didn't work? Post code.

Character.IsCollidingWithChar only checks the baselines of the Characters (i.e. if their feet are touching), so probably won't work if the car hits the other character head first. The PPC module, however, should work - depending on the way you've coded it, which is why you should always post code :)
Or how about AreThingsOverlapping? It's not limited to baseline checks, and seems like a common suggestion in other threads about IsCollidingWithChar.
I know what you're thinking ... Don't think that.

gamerman

Here's it:


if (PPColliding.CWithC(character[CARRO], character[EGO])) {
cEgo.ChangeView (4);
  }

and/or


if (cCarro.IsCollidingWithChar (cEGO) != 0) {
cEgo.ChangeView(4);
}

I tried to set the character baseline to another position, just to check, and it dont worked too...
Yes, i already tried AreThingsOverlapping, with the similars codes above and it dont worked.

Khris

Where did you put that code? Inside what function?

gamerman

I've put it in the function game_start an in the repeatedly_execute...



sorry about the long time to reply... :-\\

Scorpiorus

When you say you've put it in repeatedly_execute, is it in the main global script or in a room script?

Try something like this:

in the main global script !
Code: ags

function repeatedly_execute( ) {

    if (AreThingsOverlapping( EGO, CARRO ))
    {
        Display( "They are overlapping! Press Alt-X to exit the game." );
    }

}


See if the message is displayed at all.


SMF spam blocked by CleanTalk