ID:150290
 
What is the setup to Bump a Turf?
I know the code to change the stats and I've got this working. But I need to enable a Turf, when bumped to change the usr's stats. How should I have the Turf? Dense? Not Dense?

LJR
LordJR wrote:
What is the setup to Bump a Turf?
I know the code to change the stats and I've got this working. But I need to enable a Turf, when bumped to change the usr's stats. How should I have the Turf? Dense? Not Dense?

LJR


Here's something for you to think about, Can you bump into something that is non dense?
In response to Nadrew
Sure!! A Gas field.. a Ghost.. Go bump'in in the night all the time :-P

Seriously, the reason I said that is wasn't sure if the Bump code would handle the density part, and allow the area to be bumped, then pushed back. Someone somewhere wrote that if the density=1 then it sees a Density of 1 and doesn't bother checking for conditions. For temporary I've got a verb working on the turf, that can do what I want it to. But I'd like to make things easier for the player to just Bump into turf to make the selection.

Could I somehow do the same for the Bump? And define it under the turf?

LJR
In response to LordJR
LordJR wrote:
Could I somehow do the same for the Bump? And define it under the turf?


Well the problem with that is the turf doesn't bump into the mob the mob bumps into the turf.
In response to Nadrew
Nadrew wrote:
LordJR wrote:
Could I somehow do the same for the Bump? And define it under the turf?


Well the problem with that is the turf doesn't bump into the mob the mob bumps into the turf.

I see you logic in all of this.
Hmm.. so mob it is then. Know of any other Bump code out there that uses the bump to make a selection? Act as an attack? I just need to see it working in that function.

LJR
In response to LordJR
Turfs don't bump, but you're on the right track with the obstacle.Block() that you had in one of your code examples a while ago. The mob (or obj) bumps into the turf, then the turf's Block() proc would be called by the thing that Bump()ed it.

Even if you use mobs, stationary mobs don't bump things. Bump() is a built in part of Move()ing. you would handle Bump()ing a turf exactly as you would handle Bump()ing a mob. src is the thing moving and the first argument in Bump() is the thing preventing movement.

I think you misunderstood when I said BYOND stops checking when you bump a turf. It doesn't stop processing Bump() or other things, it just stops trying to enter a turf if you Bump() it. No need wasting valuable processor time going through the list of contents when you already know you can't enter that tile. Bumping a turf excludes you from Bumping any of it's contents (unless you code around it).
In response to Shadowdarke
Shadowdarke wrote:
Turfs don't bump, but you're on the right track with the obstacle.Block() that you had in one of your code examples a while ago. The mob (or obj) bumps into the turf, then the turf's Block() proc would be called by the thing that Bump()ed it.

This is incorrect. block() is a proc you can use to return a list of turfs defined by two opposite corners of an arbitrary rectangle on your map. It is not called automatically by any movement proc.
In response to Skysaw
Skysaw wrote:
Shadowdarke wrote:
Turfs don't bump, but you're on the right track with the obstacle.Block() that you had in one of your code examples a while ago. The mob (or obj) bumps into the turf, then the turf's Block() proc would be called by the thing that Bump()ed it.

This is incorrect. block() is a proc you can use to return a list of turfs defined by two opposite corners of an arbitrary rectangle on your map. It is not called automatically by any movement proc.

I was referring to LordJR's Block() proc that he used in post [link]

His proc name choice is a bit confusing to experienced users. I generally call it Bumped() in my own programs.
In response to Shadowdarke
Ah ha!

Yeah, probably bad form to create a new proc with the same name as an existing BYOND proc, especially if it has an entirely different function.