ID:149258
 
what am i doing wring here, i think i am using the Bump wrong, it compiles fine but doesnt do what i want it to do, it doesnt read the bump or something because it doesn't flick the animation, move me, nor send a message. I also tried it as a mob, but i want it as an obj:


obj
rail
icon = 'rail.dmi'
density = 1
Bump()
if(usr.ollie)
usr.loc = locate(src.x,(src.y)+1,src.z)
flick("grind",usr)
usr <<"You start grinding"
THe Bump() proc needs to be told what to look for when it is bumped. So the code you gave should look somehting like this to work.

obj
rail
icon = 'rail.dmi'
density = 1
Bump(mob/M)
if(M.ollie)
M.loc = locate(src.x,(src.y)+1,src.z)
flick("grind",M)
M <<"You start grinding"
In response to Koader
nope i had already tried that, but to be sure i put in exactly what you gave and it still doesn't work
Try this:

obj
rail
icon = 'rail.dmi'
density = 1
Bump()
if(usr:ollie)
usr.loc = locate(src.x,src.y+1,src.z) //Note the missing brackets
flick('grind.dmi',usr) //You can't flick text lol, not unless this is something I've never encounted
usr <<"You start grinding"
well im new to DM so i cant really help u on the biggest prob...but u said that u didnt get a msg when u did the command....i think u said that it doesnt say "you begin to grind"...that might be do to ur spacin on the command
you have
usr <<"you begin to grind!"
it might help to ahve a space between < and " like this...
usr << "you begin to grind!"
but im new...and if im just babllin on bout this....im sry...lol... ( no yellin..lol)
-Hock
The problem is that your Bump() proc is attached to the object. The Bump() proc is called when the object bumps something. I'm pretty sure your rail isn't going around bumping anything. What you want is a Bumped() proc! The Bumped() proc will be called whenever you Bump() into something, that something is Bumped().

There is an article in the FAQ on this, I recommend you read it over:
http://www.deadron.com/byond/ByondBwicki.dmb?HowToBump
In response to Hockice5
If you're new, please obstain from "helping" people until you actually know the correct answers :oP Responding with a "maybe this will help" tends to confuse people more than help them.
In response to Foomer
meh.
In response to Da_Rushyo
nope doesn't work, and you have to use "grind" because that is the name of the state this is how i always do it and it works
In response to Hockice5
nope spaces don't matter in any programming language as far as i know, it is just to make it look neat
In response to Foomer
Sweet it worked thank you very ver much, are they going to implement this into DM in the next version of BYOND
In response to Netshark010101
o...hehe....sry bout that then..... C foomer or w/e ur name was.....all u had to do was say that...not be a jack ass bout it... Thanks for informin me of that shark..hehe.. :) Sry for the inconvience
-Hock
In response to Netshark010101
Okeydokey.
In response to Foomer
no i know i am sorry i corrected my error shortly after i posted but you didn't see it i edited my msg
In response to Hockice5
I'm not being a jackass about it, I'm telling you how to avoid being a nuisance... There've been plenty of problems because other people did the same thing before, so just don't do it.
In response to Foomer
well dude..sry...i dont have a prob with u or anything....im just havin some probs with my codin right now...and its gotten me mad...guess i over reacted on ur comment.. :P ....if u can help me with my prob i'd be gratefull for it...ill post it in a few...thanks...
-Hock
One other serious problem with your code that nobody commented on is that you're using usr inside of Bump(). usr is a special value that really only has meaning for verbs and related user input procs (like mouse procs), so it should never, ever be used inside a movement proc.

Bump() already knows everything it needs to know. The format of the call is moving_atom.Bump(obstacle), where the thing moving may be a player or monster, and the obstacle is whatever obstructed it (a turf, obj, mob, etc.). Basically your code ran into trouble from the start by ignoring the obstacle. The other problem was that in Bump(), src is always the thing that tried to move but couldn't, whereas usr may or may not be the same thing.

Lummox JR

In response to Netshark010101
Spacing matters in some languages, and in others it doesn't.

DM is partial, in that spacing doesn't matter within the line, but does matter outside the line (tabs).
In response to Koader
I may be wrong, but I'm pretty sure the Bump(), Bumped(), Enter(), and Entered() procs don't use that for anything but a direct pointer...

As far as limiting what can enter, they ignore it. It doesn't get used as a regular parameter so I found.
In response to ShadowWolf
ShadowWolf wrote:
I may be wrong, but I'm pretty sure the Bump(), Bumped(), Enter(), and Entered() procs don't use that for anything but a direct pointer...

Don't use what? The argument(s) to the proc?

They use those, all right. (Although Bumped(), you must realize, is not a built-in proc.) Otherwise they have no way to definitively tell what's trying to enter.

As far as limiting what can enter, they ignore it. It doesn't get used as a regular parameter so I found.

atom.Enter(moving_atom) by default uses moving_atom to tell what it should do. In the case of a turf, it checks to see if the atom moving in is dense, and if so it checks whether the turf itself is dense, or if any of the atoms in its contents are dense. Exit() works likewise.

Entered() and Exited() ignore everything by default because they don't do anything unless you tell them to; they're there as a hook for the user.

mob.Bump() actually does have one default behavior: If a mob bumps into another mob with mob.group set the same, it switches their places.

Lummox JR
Page: 1 2