Page 1 of 1

on_collide

PostPosted: Wed Jul 24, 2013 20:15
by webdesigner97
This is just a very little idea I'd like to share, nothing more:

What about having the possibility to add "on_collide" to an entity definition? I could look somthing like:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_entity("mod:entity",{
    (...),
    on_collide = function(self,pos,collider)
         -- Code goes here
    end
})


This would allow a car (maybe I'll create one if Melkor shares his mesh) to hurt players it touches if it's fast or to destroy walls if it crashes into them... What do you think?

PostPosted: Wed Jul 24, 2013 20:19
by PilzAdam
I guess this would slow the collision detection down. So its not going to happen.

PostPosted: Wed Jul 24, 2013 20:20
by Topywo
It would be great if that was possible. It will create a lot of new possibilities.

PostPosted: Wed Jul 24, 2013 20:22
by webdesigner97
PilzAdam wrote:I guess this would slow the collision detection down. So its not going to happen.

This might happen :/

PostPosted: Wed Jul 24, 2013 20:31
by Jordach
PilzAdam wrote:I guess this would slow the collision detection down. So its not going to happen.
This is a game engine not a god damn C++ game.

WE NEED things like THIS.

When someone thinks of a really good idea, you just swat it down saying it "doesn't fit the blocky style", or "too complicated to code", which we know for a fact is bullshit.

PostPosted: Wed Jul 24, 2013 21:22
by PilzAdam
Jordach wrote:
PilzAdam wrote:I guess this would slow the collision detection down. So its not going to happen.
This is a game engine not a god damn C++ game.

WE NEED things like THIS.

When someone thinks of a really good idea, you just swat it down saying it "doesn't fit the blocky style", or "too complicated to code", which we know for a fact is bullshit.

Ummmm..... where did I say that this idea is bad? Of course we will merge it in if someone implements it in a sane way.
In the post above I just said what I think about the problems that might occur while trying to implement it (as a core dev who knows the existing code).

It would be best if you think about my post before copy and pasting your standard "PilzAdam rejects an idea" text.

PostPosted: Wed Jul 24, 2013 21:57
by Jordach
PilzAdam wrote:
Jordach wrote:
PilzAdam wrote:I guess this would slow the collision detection down. So its not going to happen.
This is a game engine not a god damn C++ game.

WE NEED things like THIS.

When someone thinks of a really good idea, you just swat it down saying it "doesn't fit the blocky style", or "too complicated to code", which we know for a fact is bullshit.

Ummmm..... where did I say that this idea is bad? Of course we will merge it in if someone implements it in a sane way.
In the post above I just said what I think about the problems that might occur while trying to implement it (as a core dev who knows the existing code).

It would be best if you think about my post before copy and pasting your standard "PilzAdam rejects an idea" text.
You should implement things that people want in a early Alpha, revise them further in the beta, and kill all the bugs in the RC's, then a FULL release with little / no bugs. And for once, rather than crow about these features, make proof of concept code. Show that it CAN BE DONE.

PostPosted: Wed Jul 24, 2013 22:56
by tinoesroho
'tis a do-ocracy.

Want something done?
Just do it.

PostPosted: Thu Jul 25, 2013 19:03
by hoodedice
tinoesroho wrote:'tis a do-ocracy.

Want something done?
Just do it.


+1

Jordach. I'm not taking this in a bad way, but I guess the best way for you to continue is to fork minetest. Or, if you don't want to do that, maybe you could take the source code, add the features, take some screen-shots/make a video, post to the forum, gather support, and then make a pull request. That way, even if the request is denied, you will have some kind of support.

PilzAdam. I think the next best thing to do is what Jordach said here. I think there should be two branches for minetest. One will be stable, the other experimental, where all the good ideas, like those of Jordach go. And in this branch, anything that isn't buggy is allowed to be implemented.

If we all sit and discuss nicely, I don't think anyone will brawl over 'pull requests'.

PostPosted: Thu Jul 25, 2013 20:47
by Inocudom
hoodedice wrote:
tinoesroho wrote:'tis a do-ocracy.

Want something done?
Just do it.


+1

Jordach. I'm not taking this in a bad way, but I guess the best way for you to continue is to fork minetest. Or, if you don't want to do that, maybe you could take the source code, add the features, take some screen-shots/make a video, post to the forum, gather support, and then make a pull request. That way, even if the request is denied, you will have some kind of support.

PilzAdam. I think the next best thing to do is what Jordach said here. I think there should be two branches for minetest. One will be stable, the other experimental, where all the good ideas, like those of Jordach go. And in this branch, anything that isn't buggy is allowed to be implemented.

If we all sit and discuss nicely, I don't think anyone will brawl over 'pull requests'.


This is a better way to do things than getting into fights.

PostPosted: Fri Jul 26, 2013 16:06
by rubenwardy
Hybrid Dog wrote:I would need a "on_walk_on" for walkable nodes...


You could probably do that in a lua on_step, and then get it to call self:on_walkon()
Will not be as accurate as a cpp version, but will still be good for purpose.