City of Arabel
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Roll dot command issue

    Scheduled Pinned Locked Moved Closed Bugs
    4 Posts 4 Posters 290 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • WulfricW
      Wulfric
      last edited by Wulfric

      Server Version: 7285
      Time: 03:50AM GMT+2
      Screen Shot:
      2021-05-14-034701_378x581_escrotum.png

      Issue Description:
      The .roll dX command always gives 0 as a result and probably does not recognize the die type.
      @DoctorDeth (I think I was told to ping you with dot command issues)

      Thalia Autumnwind (main)
      Zenrin Reedhill (former)
      Elmar Venlamin (former)
      Horace Stokron (former)

      1 Reply Last reply Reply Quote
      • StrawManS
        StrawMan
        last edited by

        The .roll dot command, in its present state is, curiously enough, not designed for rolling dice but instead direct skill and ability checks, using a string:
        str / dex / appraise / hide etc.

        .roll hide
        .roll dex

        Perhaps we can come up with something more intuitive later.
        I think the old dice bag has been refactored out. Need to check again.

        …Little Gods, In The Spaces Of Spiders...

        DoctorDethD 1 Reply Last reply Reply Quote
        • DoctorDethD
          DoctorDeth @StrawMan
          last edited by

          @StrawMan

          Not sure why this doesn't work.. inc_dot_parse calls CommandRollDMFI, and for regular users, this executes the "roll" script.

              if (!GetCommanderIsDM(oCommander)) {
                  // Non-DMs get the regular "roll" command
                  SetLocalString(oCommander, "roll", sArgs);
                  ExecuteScriptWithWarn("roll", oCommander);
                  return;
              }
          

          The roll script then checks for ability and skill check rolls and defaults to figuring out if you sent it a "d8" or "d20". (I chopped this up to make it shorter for display purposes only).

              //roll an ability check
              if (sArgs == "str")      { modifier = ABILITY_STRENGTH; }
              else if (sArgs == "dex") { modifier = ABILITY_DEXTERITY; }
              // ... etc ... 
          
              if(modifier > 0) {
                  // Do the roll and inform..
                  return;
              }
          
              if (StartsWith(sArgs, "appr"))      { iSkill = SKILL_APPRAISE; }
              else if (StartsWith(sArgs, "bluf")) { iSkill = SKILL_BLUFF; }
              // ... etc...
          
              // roll a skill check
              // Not implemented yet cause I don't really have the time.
              if(iSkill > 0) {
                  // Do the roll and inform..
                  return;
              }
          
              // Default is rolling a die if we didn't get out of the script before that.
              rollDice(sArgs);
          }
          
          void rollDice(string roll) {
              int dice = StringToInt(GetStringRight(roll, GetStringLength(roll) - 1)); //The type of dice to roll
              int diceresult;
          
              switch(dice) {
                  case   2: diceresult =   d2(); break;
                  case   3: diceresult =   d3(); break;
                  // .. etc .. 
              }
              inform(roll, diceresult);
          }
          

          In theory, practice and theory are the same. In practice, however, they are not.

          1 Reply Last reply Reply Quote
          • EchoE
            Echo
            last edited by

            fixed v7301

            "You can complain if you weren't asked; you can't complain if you were asked but didn't contribute." ~ Professor.

            1 Reply Last reply Reply Quote
            • 1 / 1
            • First post
              Last post