|
Post by commended on Feb 16, 2016 8:42:19 GMT
Hi all, I am making a racing game (though I understand this could be useful for FPS games too!) and I was wondering whether ever I could assign a key (for if you get stuck) and an Event On Contact(for if you try to leave the map) that teleports you to the original space without actually ending the game. I have seen this is possible before but I am not sure where! Maybe the old forum or something, either way I can't find it.
Thank in advance.
|
|
|
Post by Power Supersport on Feb 16, 2016 9:21:21 GMT
The perfect and easiest efficient solution is: int time; Vector3 Location = Vector3(0,0,0); // Coordinates that the player needs to be reset void Main() { if ((iKeyDown(iKeyCode("DIK_R"))) or (IN_0 > 0)) { time += 1; if (time == 1) { iObjectLocationReset(OBJ_22, Location); // You can have multiple things to reset } } else time = 0; } OBJ_0 is your EOC (event on contact)... OBJ_22 is your player... I hope this was useful... tell me if you have any questions...
|
|
|
Post by commended on Feb 16, 2016 18:55:28 GMT
The perfect and easiest efficient solution is: int time; Vector3 Location = Vector3(0,0,0); // Coordinates that the player needs to be reset void Main() { if ((iKeyDown(iKeyCode("DIK_R"))) or (IN_0 > 0)) { time += 1; if (time == 1) { iObjectLocationReset(OBJ_22, Location); // You can have multiple things to reset } } else time = 0; } OBJ_0 is your EOC (event on contact)... OBJ_22 is your player... I hope this was useful... tell me if you have any questions...
|
|