Roll dot command issue
-
Server Version: 7285
Time: 03:50AM GMT+2
Screen Shot:
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) -
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. -
Not sure why this doesn't work..
inc_dot_parse
callsCommandRollDMFI
, 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); }
-
fixed v7301