Building & Scripting > Scripting Board

Code related error perhaps?

<< < (2/3) > >>

Mordecai:
Are you sure that the room he is in gets the message with asound?

Fizban:
No, it doesn't, but like this:

He's in room A, he goest east to room B, we didn't want room A to see the message when he entered room B, we wanted every room touching B besides A to get the message.

Kvetch:
No, the mob in question actually has a walk-in message like the other mobs in the zone (since I don't like the defaults) so, the room the mob walks into gets a completely different message - the surrouding rooms get a different message and the room he just walks out of gets a third message.  *whew*  

I did initally do it with %asound%, but was bugged by the fact that the room the mob walked out of got the same message as if the mob was approaching them instead of walking away from them.  It's that drive for perfection itch that I have.

So.. room troglodyte left gets this: The strong, oily musk wafts out of the room with the trogloydyte.

And the rooms surrounding the room the trog walked into gets this: A thick, suffocating musk wafts into the room from the south, the oily stench almost graspable in its richness.

The room the trog walks into gets: The stench of the swamp becomes unbearable as a humanoid lizard figure steps from the mist. (which is from a different script than what's posted here - I checked - but the other two rooms noted above are from the same script.)

Fizban:
Also %at% must not be the issue, here's Rumble's version, which didn't work as well on TBA (he has it set to not send any message at all the first time the mob loads, I used two scripts in combination to make it work 100% as intended instead), but worked here unlike mine:


--- Code: ---Name: 'Smelly Bum',  VNum: [  206], RNum: [  205]
Trigger Intended Assignment: Mobiles
Trigger Type: Entry , Numeric Arg: 100, Arg list: None
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
* A trig to let people smell the bum from 1 room away.
* For the first move there is no from_room so set it.
if !%from_room%
  eval from_room %self.room.vnum%
  global from_room
  halt
end
wait 1 sec
eval inroom %self.room%
*
%at% %from_room% %echo% %self.name%'s smell slowly dissipates with %self.himher%.
if %inroom.north% && %inroom.north(vnum)% != %from_room%
  %at% %inroom.north(vnum)% %echo% You notice a nasty smell to the south.
end
if %inroom.south% && %inroom.south(vnum)% != %from_room%
  %at% %inroom.south(vnum)% %echo% You notice a nasty smell to the north.
end
if %inroom.east% && %inroom.east(vnum)% != %from_room%
  %at% %inroom.east(vnum)% %echo% You notice a nasty smell to the west.
end
if %inroom.west% && %inroom.west(vnum)% != %from_room%
  %at% %inroom.west(vnum)% %echo% You notice a nasty smell to the east.
end
if %inroom.up% && %inroom.up(vnum)% != %from_room%
  %at% %inroom.up(vnum)% %echo% You notice a nasty smell below you.
end
if %inroom.down% && %inroom.down(vnum)% != %from_room%
  %at% %inroom.down(vnum)% %echo% You notice a nasty smell above you.
end
*
eval from_room %self.room.vnum%
global from_room
--- End code ---

Mordecai:

--- Code: ---wait 1
set nroom %self.room%
%echo% A thick, suffocating musk wafts into the room.
set dirs north south east west up down
set rdirs southen northen western eastern below above
while %dirs.car%
set dir %dirs.car%
set dirs %dirs.cdr%
    set rdir %rdirs.car%
set rdirs %rdirs.cdr%
eval rm %%nroom.%dir%(vnum)%%
if %rm% && %rm% != %sroom%
  %at% %rm% %echo% A thick, suffocating musk wafts in from the %rdir% room.
end
done
if %sroom%
  %at% %sroom% %echo% The strong, oily musk dissipates.
end
set sroom %self.room.vnum%
global sroom
--- End code ---

Okay, fixing the code now.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version