by Merk » Tue Mar 28, 2006 7:03 am
Here's what I do in Distress, to trap for "Look Up". There are actually several elseif's in the real code, to trap for "Look Down" and "Look East" and so forth. I snipped that, to make it more applicable to what you're doing.
Basically, in the line "self = u_obj" you could redirect it to whatever you want. Hopefully this is what you're after.
Code: Select all
!---------------------------------------------------------------
!Mainly adding this to give a new response to look "up"
!
replace NewOMessages (obj, num, a, b)
{
local retval = false
select obj
case direction
{
select num
case 1 {
if (self = u_obj) {
run sky.long_desc
retval = true
}
}
}
return (retval)
}
If you add this code as-is to a .HUG file in your project, it will default to showing sky.long_desc whenever the player looks up. NewOMessages is a stub in the library files, intended to be replaced whenever you want to customize whichever messages the real OMessages services. Return (true) on conditions you handle, and (false) so that the default OMessage prints for everything else.
Here's what I do in Distress, to trap for "Look Up". There are actually several elseif's in the real code, to trap for "Look Down" and "Look East" and so forth. I snipped that, to make it more applicable to what you're doing.
Basically, in the line "self = u_obj" you could redirect it to whatever you want. Hopefully this is what you're after.
[code]!---------------------------------------------------------------
!Mainly adding this to give a new response to look "up"
!
replace NewOMessages (obj, num, a, b)
{
local retval = false
select obj
case direction
{
select num
case 1 {
if (self = u_obj) {
run sky.long_desc
retval = true
}
}
}
return (retval)
}
[/code]
If you add this code as-is to a .HUG file in your project, it will default to showing sky.long_desc whenever the player looks up. NewOMessages is a stub in the library files, intended to be replaced whenever you want to customize whichever messages the real OMessages services. Return (true) on conditions you handle, and (false) so that the default OMessage prints for everything else.