ID:259961
 
It would be nice if a Bumped() type thing was created.
It would be called when it was well, Bumped by something!
mob
Blind_Man
Bumped()
oview(src) << "[src]: Hey Who Bumped me!?"


This could be very usefull in alot of cases, intead of writing code for another object inside something elses Bump.
Your code contains usr abuse, which is a very bad way to use Bumped()!
In response to Ol' Yeller
.....There is..NO USR IN MY CODE!!!
In response to Sniper Joe
Sniper Joe wrote:
.....There is..NO USR IN MY CODE!!!

Sure there is. view() is really view(usr). usr is the default target for view().

Bumped() is a very easy procedure to program yourself in DM. There are tons of threads in the forums about it.
In response to Sniper Joe
Yes there is, view(), oview(), alert(), and input() (Probably a few others which I forgot) all default to usr.
In response to Jon88
I know..I was just saying..
In response to Sniper Joe
You were saying wrong about having Usr in a proc.
In response to N1ghtW1ng
I don't have usr in the proc >_<....
In response to Sniper Joe
Because you just changed it. It was view() at first, but you changed it to oview(src).
In response to Ol' Yeller
Actually in view() and the sort it works fine, I've never had to use view(src) in a proc, always works 100% OK, and since he didn't use 'usr' persay he's not really doing anything wrong.
In response to Nadrew
:) Thats what I am saying...
In response to Sniper Joe
I think that adding the Bumped() case would be good

heres how I think it could work.

case 1,
- Atom "A" bumps into Atom "B"
- "A" does not have a bump code but "B" has a bumped code
B's bumped code runs.

case 2,
- Atom "A" bumps into Atom "B"
- "A" has a bump code "B" has a bumped code A's bump code runs
then B's bumped code is run.

thou I would stay with my bump code ^_^


In response to Zmadpeter
atom/movable
Bump(atom/movable/A)
..()
if(istype(A,/atom/movable))
A.Bumped()
proc/Bumped(atom/movable/A)
..()
In response to Crashed
that all well and good, but if it was its own thing then you could define how each of them react without loads of checks
(still this is how I think the system works not sure i dont use bump that much)

// I think its usr in the Bump case ^_^ not sure so I left it as src :)
mob
Player
Bump(atom/movable/A)
src << " you bumped into [A.name]"
Bumped(atom/movable/A)
src << " [A.name] bumped into you"
NPC
Bump(atom/movable/A)
view(2) << "sorry, I was not looking where I was going"
Bumped(atom/movable/A)
view(2) << " [A.name] watch where the hell your walking"
Dog
Bump(atom/movable/A)
view(2) << "Woof"
Bumped(atom/movable/A)
view(2) << " GRRRR Woof Woof"

or something like that ^_^, it be funny you could have a NPC yell at the dog for walking into it :)
In response to Zmadpeter
:) I just am thinking of some ideas to make BYOND a big easyer....may that be a good or bad thing >_<
In response to Nadrew
Nadrew wrote:
since he didn't use 'usr' persay he's not really doing anything wrong.

Um, yes he did...

view(usr) == view()


And if the above is not true, then the DM reference needs to be slapped (and updated).
In response to Zmadpeter
That's exactly how the code I posted should work.

Copy+Paste what you you just wrote, edit the view() usr mishaps, then try it out.
In response to Crispy
A long time ago a great man named Dan fixed that problem, and the fix was good! (Procs with a default 'usr' are 100% valid in procs since that time as long as you don't do something like view(usr))
In response to Nadrew
How did he "fix" it?

If view() != view(usr), then the reference desperately needs updating.
In response to Crispy
"

view() << "to all in sight of [usr]"
view(src) << "to all in sight of [src]"
view(1,src.loc) << "to all within reach of [src]"

"
Page: 1 2