Re: Characters coliding misbehaving(SOLVED) (of course)

Started by TonyJ, Fri 11/03/2011 21:40:17

Previous topic - Next topic

TonyJ

Hi, re the above I can't get this code to behave as expected, its fairly obvious that I'm trying to cause an event following the collision, however where ever I put it, the code is triggered as soon as the game starts, I've tried it in all the obvious and not so obvious places global script, room script, rep exec, after room load etc with pretty much the same result each time, which of course means I don't fully understand whats occurring, any enlightenment would be appreciated

Code: ags
     if (cGrey.IsCollidingWithChar(cBbill) == 1)
   Display("told you something nasty would happen");
   Display("you should've stayed away from him....");
   player.ChangeRoom(300, 317, 232); 

Crimson Wizard

Obviously, you forgot block begin and end symbols:

Code: ags
 if (cGrey.IsCollidingWithChar(cBbill) == 1)
{
   Display("told you something nasty would happen");
   Display("you should've stayed away from him....");
   player.ChangeRoom(300, 317, 232);
}


Remember, that if you have more than one command under "if" they must be embedded in { ... } construction.

TonyJ

ahem yes erm dur.. anyway thanks for that, of course you are totally correct, a case of spending too much time on one thing prevents me from seeing the obvious yet again (presently standing in corner of room with D hat on) Code now in global rep exec and working perfectly. ;)

Cheers

SMF spam blocked by CleanTalk