Losing track of %actor% (Code Error)

Login to reply  Page: « < 1 of 1 > »
20 Jul 2009 - 03:551745
Losing track of %actor% (Code Error)
This post is primary for Jamdog or Welcor to take a look at but if anyone else has an idea what the issue is feel free to help out. Twice recently the trial vnum assigner has stopped players from using redit and zedit. First time I thought nothing of it, turned the player's nohassle on and asked them to please not edit anything else in the zone. The second time I put on my debugging hat and decided to find out why.

The original script is here:

* By Rumble of The Builder Academy    tbamud.com 9091
* Player must have nohassle off! To junk assigner use tbalim purge player.
set actor %self.carried_by%
*Shouldn't be necessary, added by Fizban due to script not knowing who actor was under certain circumstances
if %actor.varexists(TBA_trial_vnum)% && %actor.level% == 31
  * We set completed trial vnums to -#. So if negative abort.
  if %actor.TBA_trial_vnum% < 0
    return 0
  end
  if (%cmd.mudcommand% == redit && ((%arg% && %arg% != %actor.TBA_trial_vnum%) || (%actor.room.vnum% != %actor.TBA_trial_vnum%)))
    %send% %actor% GOTO %actor.TBA_trial_vnum% to edit your room.
  elseif %cmd.mudcommand% == oedit && %arg% != %actor.TBA_trial_vnum%
    %send% %actor% Use OEDIT %actor.TBA_trial_vnum% to modify your object.
  elseif %cmd.mudcommand% == medit && %arg% != %actor.TBA_trial_vnum%
    %send% %actor% Use MEDIT %actor.TBA_trial_vnum% to modify your mobile.
  elseif (%cmd.mudcommand% == zedit && ((%arg% && %arg% != %actor.TBA_trial_vnum%) || (%actor.room.vnum% != %actor.TBA_trial_vnum%)))
    %send% %actor% GOTO %actor.TBA_trial_vnum% to edit your trial vnums zone information.
  elseif %cmd.mudcommand% == purge && ((%arg% && %arg% != %actor.TBA_trial_vnum%) || (%actor.room.vnum% != %actor.TBA_trial_vnum%)))
    %send% %actor% GOTO %actor.TBA_trial_vnum% to purge your room.
  elseif %cmd.mudcommand% == nohassle || (%cmd.mudcommand% == toggle && nohassle /= %arg.car%)
    %send% %actor% You cannot enable nohassle until you finish your trial vnum.
  elseif %cmd.mudcommand% == buildwalk || (%cmd.mudcommand% == toggle && buildwalk /= %arg.car%)
    %send% %actor% You cannot enable buildwalk until you finish your trial vnum.
  elseif %cmd.mudcommand% == sedit || %cmd.mudcommand% == qedit || %cmd.mudcommand% == trigedit || %cmd.mudcommand% == dig || %cmd.mudcommand% == rclone || %cmd.mudcommand% == attach || %cmd.mudcommand% == detach || %cmd.mudcommand% == vdelete 
    %send% %actor% Sedit, Trigedit, Qedit, Dig, Rclone, Attach, Detach, and Vdelete are not required for your trial vnum.
  elseif %cmd.mudcommand% == zpurge
    %send% %actor% Zpurge is not required for your trial vnum. Use 'purge' or 'purge item.'
  elseif %cmd.mudcommand% == sacrifice
    %send% %actor% Sacrifice is disabled until your trial room is completed.
  else
    return 0
  end
else
  return 0
end

The version I replaced it with for testing/debugging purposes is this:

* By Rumble of The Builder Academy    tbamud.com 9091
* Player must have nohassle off! To junk assigner use tbalim purge player.
if %actor.varexists(tba_trial_vnum)% && %actor.level% == 31
  * We set completed trial vnums to -#. So if negative abort.
  if %actor.tba_trial_vnum% < 0
    return 0
  end
  if %cmd.mudcommand% == redit
    %echo% The command he typed was redit!
    if %arg%
      %echo% There was an arg!
      if %arg% != %actor.tba_trial_vnum%
        %send% %actor% GOTO %actor.tba_trial_vnum% to edit your room.
      else
        return 0
      end
    elseif %actor.room.vnum% != %actor.tba_trial_vnum%
      %echo% '%actor.room.vnum%' '%actor.tba_trial_vnum%'
      %echo% There was no arg, but wrong room!
      %send% %actor% GOTO %actor.tba_trial_vnum% to edit your room.
    else
      %echo% Uh oh, he should have just entered redit! Obvious bug!
      return 0
    end
  elseif %cmd.mudcommand% == oedit && %arg% != %actor.tba_trial_vnum%
    %send% %actor% Use OEDIT %actor.tba_trial_vnum% to modify your object.
  elseif %cmd.mudcommand% == medit && %arg% != %actor.tba_trial_vnum%
    %send% %actor% Use MEDIT %actor.tba_trial_vnum% to modify your mobile.
  elseif %cmd.mudcommand% == zedit
    if %arg%
      if %arg% != %actor.tba_trial_vnum%
        %send% %actor% GOTO %actor.tba_trial_vnum% to edit your trial vnums zone information.
      else
        return 0
      end
    elseif %actor.room.vnum% != %actor.tba_trial_vnum%
      %send% %actor% GOTO %actor.tba_trial_vnum% to edit your trial vnums zone information.
    else
      return 0
    end
  elseif %cmd.mudcommand% == purge
    if %arg%
      if %arg% != %actor.tba_trial_vnum%
        %send% %actor% GOTO %actor.tba_trial_vnum% to purge your room.
      else
        return 0
      end
    elseif %actor.room.vnum% != %actor.tba_trial_vnum%
      %send% %actor% GOTO %actor.tba_trial_vnum% to purge your room.
    else
      return 0
    end
  elseif %cmd.mudcommand% == nohassle || (%cmd.mudcommand% == toggle && %arg.mudcommand% == nohassle)
    %send% %actor% You cannot enable nohassle until you finish your trial vnum.
  elseif %cmd.mudcommand% == buildwalk || (%cmd.mudcommand% == toggle && %arg.mudcommand% == buildwalk)
    %send% %actor% You cannot enable buildwalk until you finish your trial vnum.
  elseif %cmd.mudcommand% == sedit || %cmd.mudcommand% == qedit || %cmd.mudcommand% == trigedit || %cmd.mudcommand% == dig || %cmd.mudcommand% == rclone || %cmd.mudcommand% == attach || %cmd.mudcommand% == detach || %cmd.mudcommand% == vdelete 
    %send% %actor% Sedit, Trigedit, Qedit, Dig, Rclone, Attach, Detach, and Vdelete are not required for your trial vnum.
  elseif %cmd.mudcommand% == zpurge
    %send% %actor% Zpurge is not required for your trial vnum. Use 'purge' or 'purge item.'
  elseif %cmd.mudcommand% == sacrifice
    %send% %actor% Sacrifice is disabled until your trial room is completed.
  else
    return 0
  end
else
  return 0
end

The response the script spit out when Suvin attempted to type 'redit':

Quote:

The command he typed was redit!
'' '60856'
There was no arg, but wrong room!


This immediately brought two things to my attention.

Firstly, the '' means it can't decipher what %actor.trial.vnum% is as that was %echo% '%actor.trial.vnum%' (The '' were originally there because I suspected the issue was spacing related.)

Secondly, he did not receive the following message: %send% %actor% GOTO %actor.TBA_trial_vnum% to edit your room.

That eliminates the possibility of the issue being related to the 'room' or 'vnum' trig-fields and brings us to the root of the problem, the script doesn't know who the %actor% is. I'm not sure what code change caused this, or when, but it seems to be a rather recent problem as I've only seen it pop up twice, both times within the last week.


__________________

Last edited by Fizban (20 Jul 2009 - 03:56)
20 Jul 2009 - 04:311746
Scratch all of that, it's something weirder.

%send% %actor% messages won't work in the script, but %actor.name% will echo correctly, whereas %actor.room.vnum% will not.


__________________
20 Jul 2009 - 04:361747
Following script:

Trigger Editor [57701]

1) Name         : Testing
2) Intended for : Objects
3) Trigger types: Command 
4) Numeric Arg  : 7
5) Arguments    : bow
6) Commands:
%echo% %actor.name% bowed in %actor.room.vnum%!

W) Copy Trigger
Q) Quit

Quote:

> bow
Fizban bowed in 60856!

> force suvin bow
Okay.
[ (GC) Fizban forced Suvin to bow ]
Suvin bowed in !


__________________
22 Jul 2009 - 19:041750
Currently on vacation, but I'll be sure to take a look when I get back.

I have no tools on this PC at all, and connect through my cellphone (== pay ~$1 per MB, so no downloads...).


__________________
You know who I am.
25 Jul 2009 - 19:481763
Ok, I've now had the opportunity to test this a bit, using the latest SVN version of tbamud.

It is not reproducible: I have tested with several different types of trigger, ranging from room command triggers, over speech triggers to the exact object trigger you have supplied above.
First off, I am not able to get the trigger to fire for myself if it is a command trigger, due to me being LVL_IMPL. It works flawlessly if I try it as a speech trigger.
My test char also displayed correctly, when forced, as well as when entering the command himself, and regardless of trigger type.

So it all basically boils down to this: what have YOU changed, to make the code differ from the latest svn?


__________________
You know who I am.

Last edited by welcor (25 Jul 2009 - 19:49)
02 Aug 2009 - 18:391782
Quote welcor:
what have YOU changed, to make the code differ from the latest svn?


Nothing, that was on TBA, not on a local copy of tbaMUD. It happened to two new builders recently.


__________________

Last edited by Fizban (02 Aug 2009 - 18:40)
03 Aug 2009 - 03:071784
Quote Fizban:
Nothing, that was on TBA, not on a local copy of tbaMUD. It happened to two new builders recently.


Just tested on TBA with the trig/obj you made and it works fine. Might have been something we inadvertently broke and then fixed.


__________________
Rumble
The Builder Academy
tbamud.com 9091
03 Aug 2009 - 09:471787
Quote Fizban:
Quote welcor:
what have YOU changed, to make the code differ from the latest svn?


Nothing, that was on TBA, not on a local copy of tbaMUD. It happened to two new builders recently.

Hmm. Just realized that with the emphasis (CAPS) it came across as quite jugdemental. That was never my intention. Sorry.


__________________
You know who I am.
03 Aug 2009 - 16:481789
Quote Rumble:
Quote Fizban:
Nothing, that was on TBA, not on a local copy of tbaMUD. It happened to two new builders recently.


Just tested on TBA with the trig/obj you made and it works fine. Might have been something we inadvertently broke and then fixed.


Last I tested it it only happened with two specific builders, not with most PC's. Suvin was one of the two.


__________________
Login to reply  Page: « < 1 of 1 > »