Author Topic: Code related error perhaps?  (Read 14513 times)

0 Members and 1 Guest are viewing this topic.

Offline Fizban

  • Maniacal Scroder!
  • Administrator
  • Full Member
  • *****
  • Posts: 183
  • Fizban, the Mangy Wizard
    • MSN Messenger - Fizban1216@hotmail.com
    • AOL Instant Messenger - Fizban1216
    • View Profile
    • Email
Code related error perhaps?
« on: February 27, 2008, 05:02:51 pm »
This is a script that worked on TBA but not on 6002 when Kvetch tries using it and not exactly sure why, was curious if anyone saw anything that stood out.

Code: [Select]
Name: 'Troglodytes Smell!',  VNum: [57702], RNum: [ 3881]
Trigger Intended Assignment: Mobiles
Trigger Type: Entry , Numeric Arg: 100, Arg list: None
Commands:
wait 1
set nroom %self.room%
%echo% A thick, suffocating musk wafts into the room, the oily stench almost graspable in its richness.
if %nroom.north(vnum)% && %nroom.north(vnum)% != %sroom%
  %at% %nroom.north(vnum)% %echo% A thick, suffocating musk wafts into the room, the oily stench almost graspable in its richness.
end
if %nroom.south(vnum)% && %nroom.south(vnum)% != %sroom%
  %at% %nroom.south(vnum)% %echo% A thick, suffocating musk wafts into the room, the oily stench almost graspable in its richness.
end
if %nroom.west(vnum)% && %nroom.west(vnum)% != %sroom%
  %at% %nroom.west(vnum)% %echo% A thick, suffocating musk wafts into the room, the oily stench almost graspable in its richness.
end
if %nroom.east(vnum)% && %nroom.east(vnum)% != %sroom%
  %at% %nroom.east(vnum)% %echo% A thick, suffocating musk wafts into the room, the oily stench almost graspable in its richness.
end
if %nroom.up(vnum)% && %nroom.up(vnum)% != %sroom%
  %at% %nroom.up(vnum)% %echo% A thick, suffocating musk wafts into the room, the oily stench almost graspable in its richness.
end
if %nroom.down(vnum)% && %nroom.down(vnum)% != %sroom%
  %at% %nroom.down(vnum)% %echo% A thick, suffocating musk wafts into the room, the oily stench almost graspable in its richness.
end
if %sroom%
  %at% %sroom% %echo% The strong, oily musk wafts out of the room with the troglodyte.
end
set sroom %self.room.vnum%
global sroom

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Code related error perhaps?
« Reply #1 on: March 01, 2008, 01:46:24 am »
I see something.. You said Kvetch used it.  That's it.  No other reason.  Scripts just won't work right for her at times.  I swear Mord coded that in so I had to keep bugging for help - though why he'd do that when it was him I was bugging, I've no clue.  But that's it.  There you have it.
It's ME.

Offline Fizban

  • Maniacal Scroder!
  • Administrator
  • Full Member
  • *****
  • Posts: 183
  • Fizban, the Mangy Wizard
    • MSN Messenger - Fizban1216@hotmail.com
    • AOL Instant Messenger - Fizban1216
    • View Profile
    • Email
Re: Code related error perhaps?
« Reply #2 on: March 01, 2008, 01:46:58 pm »
Somehow I don't quite think that's it...

Offline Mordecai

  • Administrator
  • Full Member
  • *****
  • Posts: 107
  • Has delusions of adequacy
    • View Profile
    • Multiplayer Online Game Anyone?
    • Email
Re: Code related error perhaps?
« Reply #3 on: March 02, 2008, 09:38:07 pm »
It is probably the %at% code for rooms.
I havent fixed that yet.

Why didn't you use the %asound% command for this script?
Try this?
Code: [Select]
Name: 'Troglodytes Smell!',  VNum: [57702], RNum: [ 3881]
Trigger Intended Assignment: Mobiles
Trigger Type: Entry , Numeric Arg: 100, Arg list: None
Commands:
wait 1
set nroom %self.room%
%asound% A thick, suffocating musk wafts into the room, the oily stench almost graspable in its richness.
if %sroom%
  wrecho %sroom% %sroom% The strong, oily musk wafts out of the room with the troglodyte.
end
set sroom %self.room.vnum%
global sroom

Offline Fizban

  • Maniacal Scroder!
  • Administrator
  • Full Member
  • *****
  • Posts: 183
  • Fizban, the Mangy Wizard
    • MSN Messenger - Fizban1216@hotmail.com
    • AOL Instant Messenger - Fizban1216
    • View Profile
    • Email
Re: Code related error perhaps?
« Reply #4 on: March 02, 2008, 10:02:30 pm »
The goal was to not use asound so that the room he had just left didn't get the message. Asound would have worked, but that's not striving for perfection...

Offline Mordecai

  • Administrator
  • Full Member
  • *****
  • Posts: 107
  • Has delusions of adequacy
    • View Profile
    • Multiplayer Online Game Anyone?
    • Email
Re: Code related error perhaps?
« Reply #5 on: March 03, 2008, 01:13:37 am »
Are you sure that the room he is in gets the message with asound?

Offline Fizban

  • Maniacal Scroder!
  • Administrator
  • Full Member
  • *****
  • Posts: 183
  • Fizban, the Mangy Wizard
    • MSN Messenger - Fizban1216@hotmail.com
    • AOL Instant Messenger - Fizban1216
    • View Profile
    • Email
Re: Code related error perhaps?
« Reply #6 on: March 03, 2008, 02:46:01 am »
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.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: Code related error perhaps?
« Reply #7 on: March 03, 2008, 02:48:33 am »
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.)


Offline Fizban

  • Maniacal Scroder!
  • Administrator
  • Full Member
  • *****
  • Posts: 183
  • Fizban, the Mangy Wizard
    • MSN Messenger - Fizban1216@hotmail.com
    • AOL Instant Messenger - Fizban1216
    • View Profile
    • Email
Re: Code related error perhaps?
« Reply #8 on: March 03, 2008, 03:00:47 am »
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: [Select]
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

Offline Mordecai

  • Administrator
  • Full Member
  • *****
  • Posts: 107
  • Has delusions of adequacy
    • View Profile
    • Multiplayer Online Game Anyone?
    • Email
Re: Code related error perhaps?
« Reply #9 on: March 03, 2008, 04:18:34 am »
Code: [Select]
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

Okay, fixing the code now.
« Last Edit: March 03, 2008, 04:28:52 am by Mordecai »

Offline Mordecai

  • Administrator
  • Full Member
  • *****
  • Posts: 107
  • Has delusions of adequacy
    • View Profile
    • Multiplayer Online Game Anyone?
    • Email
Re: Code related error perhaps?
« Reply #10 on: March 03, 2008, 04:30:18 am »
It seems to work fine for me with that script I just posted, i just tested it.

Offline Fizban

  • Maniacal Scroder!
  • Administrator
  • Full Member
  • *****
  • Posts: 183
  • Fizban, the Mangy Wizard
    • MSN Messenger - Fizban1216@hotmail.com
    • AOL Instant Messenger - Fizban1216
    • View Profile
    • Email
Re: Code related error perhaps?
« Reply #11 on: March 03, 2008, 04:43:17 am »
It seemed as best I can tell to be related to somehow on 4D this works:

if %inroom.north% && %inroom.north(vnum)% != %from_room%


but this doesn't:

if %nroom.north(vnum)% && %nroom.north(vnum)% != %sroom%

or when those variables get put back to what they really are for readability:

if %self.room.north% && %self.room.north(vnum)% != %self.room.vnum% (old vnum before moving)

works and

if %self.room.north(vnum)% && %self.room.north(vnum)% != %self.room.vnum% (old vnum before moving)

which would make me thinbk that %self.room.north(vnum)% doesn't work, except both if checks use it, mine just used it twice instead of once.