ID:144357
 
Code:
obj
var
mess
Sign
icon='Madjarjarbinks.dmi'
icon_state="afk"
density=1
Bump(mob/character)
character<<browse(mess,"window=Sign")


Problem description:

Whenever I bump it, nothing happens...

I know that it sets the ''mess'' var because I build it and I set the message.
obj
var
mess
Sign
icon='Madjarjarbinks.dmi'
icon_state="afk"
density=1
Bump(mob/character)
character<<browse(mess,"window=Announcement")

In response to Vegetassj9
Still nothing happens. >.>
In response to Madjarjarbinks
obj
var
mess="Test"
Sign
icon='Madjarjarbinks.dmi'
icon_state="afk"
density=1
Bump(mob/character)
character<<browse(mess,"window=Announcement")

Make sure there is a message
""> I know that it sets the ''mess'' var because I build it and I set the message.""

Yeesh... ARE YOU BLIND?!?!
In response to Madjarjarbinks
I replied bevore you even edited the message...
In response to Vegetassj9
Bump(atom/O)
I use this bump myself
In response to Vegetassj9
Vegetassj9 wrote:
> obj
> var
> mess
> Sign
> icon='Madjarjarbinks.dmi'
> icon_state="afk"
> density=1
> Bump(mob/character)
> character<<browse(mess,"window=Announcement")
>


Changing the window name will do nothing your post was about as help as this post right here.
The problem is that you misunderstand Bump()..

What is there to misunderstand? Simple: Bump() is called on the _bumper_ ("bumpee") and NOT on the bumped object [meaning it calls bumper.Bump() NOT bumped.Bump()]

A simple solution is to create your own procedure.. let's say like Bumped():
atom
proc/Bumped(atom/A) return 1 //Makes the Bumped() procedure available, making you define it as how you would define built-in procedures

movable/Bump(atom/A)
..() //calls the normal Bump() information on src (src=bumper)
A.Bumped(src) //Calls A's Bumped() after src.Bump() is finished doing whatever it is doing.
That code above is basically plug and play.. so copy it in somewhere but try to understand what I actually did. Now after that's placed in, you can use Bumped() as how you use Bump()..so now change the obj/sign's Bump() to Bumped()

- GhostAnime
In response to GhostAnime
Ghost, I tried it, but I can't figure out how to make it work.
In response to Madjarjarbinks
Just simply copy the code I posted and paste it somewhere (do not modify it unless you know what you are doing).

Than change
obj/Sign/Bump(mob/character)
to
obj/Sign/Bumped(mob/character)
(Note the -ed that was added on).


Bump() -> Built-in procedure -> Called on the object that bumps INTO something

Bumped() -> Created procedure -> Called on the object that was bumped BY something, after Bump() is done.


- GhostAnime
In response to GhostAnime
atom
proc/Bumped(atom/A) return 1
movable/Bump(atom/A)
..() //calls the normal Bump() information on src (src=bumper)
A.Bumped(src) //Calls A's Bumped() after src.Bump() is finished doing whatever it is doing.

obj
var
mess
Sign
icon='Madjarjarbinks.dmi'
icon_state="afk"
density=1
obj/Sign/Bumped(mob/character)
character<<browse(mess,"window=Sign")



Still nothing happens


In response to Madjarjarbinks
Change obj/Sign/Bumped(mob/character) to Bumped(mob/character)


when I refered to obj/Sign/Bumped(), I meant
obj
Sign
Bumped(..)


- GhostAnime
In response to GhostAnime
Still, nothing happens... :-(
In response to Madjarjarbinks
Can you show the latest snippet? Also, remember... like Bump(), Bumped() does not particularly look for the type you entered in the argument so safety check >_> And also "debug", eg: adding world<<"I have been hit" within the Bumped() proc to make sure it actually works (if the message did appear but the popup didn't, I conclude that there was no message entered)

- GhostAnime
In response to GhostAnime
Latest;
atom
proc/Bumped(atom/A)
world<<"Ow.." //THIS DOESN'T SHOW WHEN I BUMP THE SIGN.
return 1
movable/Bump(atom/A)
..() //calls the normal Bump() information on src (src=bumper)
A.Bumped(src) //Calls A's Bumped() after src.Bump() is finished doing whatever it is doing.


obj
var
mess
Sign
icon='Madjarjarbinks.dmi'
icon_state="afk"
density=1
Bumped(mob/character)
character<<browse(mess,"window=Sign")
In response to Madjarjarbinks
Alright, nothing looks wrong... just make sure that there's a message in the sign otherwise it'll be sending the null value (which closes that window).
Bumped(mob/character)
character<<browse(mess,"window=Sign")
world<<"\red Test:[character.name] bumped in to the sign. The sign's message is [mess]."


The little part there is to be used as a "debug" to see if the procedure is actually called (thus concluding that there's nothing wrong with the proc itself)
In response to GhostAnime
Still; nothing
In response to Madjarjarbinks
Nothing being as... no "debug" message (note: it is vital right now to have a debug message in)? No pop-up? Please be more specific.

If you do have a "debug" message in and it still does not work, make sure that the person bumping into the object is dense.

If still having problems, please be more specific.. afterall, it's a lot more better to get an idea of what the problem could be rather than just saying "nothing" which is VERY vague

- GhostAnime
In response to GhostAnime
Both things are dense, and I do have a message set and a debug message in.
Page: 1 2