kill when- colliding with

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
User avatar
Darkon
Posts: 237
Joined: Sun Jun 20, 2004 9:19 pm
Location: UK

kill when- colliding with

Post by Darkon »

i was curious, with the kill when colliding with set, shouldnt it only work if the object is actually moving?

because currently it works exactally the same as running into

im trying to make an element which the player can push, however if it happens to hit the player while moving, the player will die

HOWEVER when it is pushed, it *drags* the player along with it, so it really only effects any other players that happen to be in the way

*edit* ok, i found a way round my little problem, but id still like to know if what i mentioned is an intended behaviour or not
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> i was curious, with the kill when colliding with set, shouldnt it only work if
> the object is actually moving?

No, it is not needed that the element in question is able to move: "colliding with" (as defined in R'n'D) can happen by two different actions:
- moving element is colliding with non-moving player
- moving player is colliding with non-moving element

If you see "moving player" and "moving CE" as "two elements which might either be the player or a CE, where one is moving towards the other until they collide", then it might be more clear. (The only real difference is that the player is able to stop before running into the CE, while the moving CE is assumed to try moving on, "running into" the player.)

> because currently it works exactally the same as running into

No, not really true: "running into" requires the player to actively run into/against the element, while "colliding with" might also happen if the player does not move. You are right of course that both actions work the same if the CE cannot move at all.

> im trying to make an element which the player can push, however if it
> happens to hit the player while moving, the player will die

This can be done by changing the CE "when touching the player" to a different CE that is not deadly when running into (and changing it back at a later time).

> HOWEVER when it is pushed, it *drags* the player along with it, so it
> really only effects any other players that happen to be in the way

> *edit* ok, i found a way round my little problem, but id still like to know if
> what i mentioned is an intended behaviour or not

Yes, it's perfectly intended. The intention was to have three "levels of deadliness" where level x is a superset of level x+1, like that:

- "running into": deadly when running into
- "colliding with": deadly when running into and when colliding
- "touching": deadly when running into, when colliding and when touching

I hope it's a bit more clear now...
User avatar
Darkon
Posts: 237
Joined: Sun Jun 20, 2004 9:19 pm
Location: UK

Post by Darkon »

ah yes, i understand, i was expecting it to only work if the element itself collided with the player, not for the player to colide with it

maybe this behaviour should/could be added? ;-)

well, my solution seems to work as i want it to, i simply made so if the element hits something, it creates an object at the side it hit (in this case, a + explosion) thus killing anything in the way, however THEN i had the problem of the element being destroyed by the explosion, not sure why because it was set to invincible, maybe due to the change the explosion engulfs the location in which the element is supposed to be, so it cant change to what its supposed to be? but i also fixed this, by making so the element can explode 1x1 into the same element if exposed to fire
Post Reply