ID:266547
 
turf/signll
icon='grass.dmi'
icon_state="sign"
density=1
Bump(atom/truf/signll)
alert("The sign reads: Welcome to Liberty Lake!")



i get Bump is an undefined proc!?
Strange Kidd wrote:
turf/signll
icon='grass.dmi'
icon_state="sign"
density=1
Bump(atom/truf/signll)
alert("The sign reads: Welcome to Liberty Lake!")



i get Bump is an undefined proc!?

Bump is undefined for turfs. It is for movable atoms only. You don't really expect your turf to go bump into something do you?

In response to Skysaw
so if i made igt an obj would it work?
In response to Strange Kidd
Strange Kidd wrote:
so if i made igt an obj would it work?

Use this:

turf/signll
icon = 'grass.dmi'
icon_state = "sign"
density = 1
Click()
alert("The sign reads: Welcome to Liberty Lake!")


It would be better for you to use this way.

Lee
In response to Strange Kidd
Nope. The obj doesn't bump into the mob, does it? The mob bumps into the obj which calls mob/Bump() not obj/Bump()

mob
Bump(atom/A)
if(istype(A,/obj/sign))
src << "Welcome to Liberty city."
else
return..()

obj/sign
density = 1 // it HAS to be dense or you can't Bump into it
In response to Nadrew
This sort of thing happens often enough that it's become part of my standard library that gets added to every project I make.

atom
proc
Bumped(O)
// O just Bump()ed into src.
// prototype Bumped() proc for all atoms

atom/movable
Bump(atom/A)
if(istype(A)) A.Bumped(src) // tell A that src bumped into it
..()

Bumped() will automatically be called whenever anything Bump()s into something else (assuming you put a ..() somewhere in your own Bump() definitions). For signs, I just do something like this:

turf/sign
Bumped(O)
// override Bumped() so it tells the Bumper what the sign says
O << "The sign reads: [desc]"
sign11
desc = "Welcome to Liberty Lake!"

You can even alter the messages for each sign directly in the map editor, by editing the desc var.