I am trying, like from the Fighting Fantasy series to work out the Skill, Stamina and Luck at the start of an adventure. I think I found out how to put in the objects/variables names for them as I got them to appear in the Status box. I also found the command <variable_name>=RollDice(" "). Where for Skill, I would use if correct 'SkillIntial=RollDice("1d+6")' in the script box.
My problem is I cannot get any values to come up in the Status box, it just prints what I type i.e. 1d+6.
The instructions for this software are all over the place and basically unusable, as half the screens in the instructions do not look like the screens in the software.
Please can someone help me.
Hello.
You have SkillIntial=RollDice("1d+6")
First, it should be DiceRoll
, not RollDice
.
Second, you have "1d+6
, which does not match the format.
https://docs.textadventures.co.uk/quest/functions/corelibrary/diceroll.html
As of Quest 5.7, this can also handle strings like “d6+1” and “3d8-2”, using these formats:
d[number of sides] [number of dice]d[number of sides] d[number of sides]+[bonus] [number of dice]d[number of sides]+[bonus] d[number of sides]-[penalty] [number of dice]d[number of sides]-[penalty]
You should have seen this during play:
Error running script: Error evaluating expression 'ToInt(Mid(dice, p1 + 1, p2 - p1 - 1))': Input string was not in a correct format.
It seems you might really want "1d1+6"
or possibly "1d0+6"
.
SkillInitial = DiceRoll("1d1+6")
I think I found out how to put in the objects/variables names for them as I got them to appear in the Status box.
Are you using the status attributes?
Here is the test game I just made for this. Does this help any?
<!--Saved by Quest 5.8.7753.35184-->
<asl version="580">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="DiceRoll Tester">
<gameid>9c77bd6e-e5dc-42dc-8e5b-2b98d90c5ee4</gameid>
<version>1.0</version>
<firstpublished>2024</firstpublished>
<customstatuspane type="boolean">false</customstatuspane>
</game>
<object name="room">
<inherit name="editor_room" />
<isroom />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<statusattributes type="stringdictionary">
<item>
<key>SkillInitial</key>
<value>SkillInitial: !</value>
</item>
</statusattributes>
<feature_startscript />
<attr name="_initialise_" type="script">
this.SkillInitial = DiceRoll("1d1+6")
</attr>
</object>
</object>
</asl>
The instructions for this software are all over the place and basically unusable, as half the screens in the instructions do not look like the screens in the software.
Which page(s) are you looking at? (I can put them on a list to be updated.)
My issue is, the so called instructions do not match in anyway what the actual software looks like. Also the instructions are very hard to follow as they are all over the place.
With regards to your response I could not find a section when looking for RollDice, which was how I found it by accident in another section looking for something else.
However, the other problem still exists, I set 'Skill' up as an object and put the script the corrected DiceRoll, but nothing appears in the status box apart from what is typed i.e. Skill=DiceRoll....
I am sorry but it is where I cannot follow these instructions. Do you have a PDF version I could print out?
Are you using Quest online, or are you using the Windows desktop version?
If you are using the Windows desktop version, you can download this and open it in Quest to actually see it in the editor.
https://github.com/KVonGit/quest5-stuff/raw/refs/heads/main/example-games/DiceRoll%20Tester.aslx
Concerning the screenshots, most of the instructions were written before the last update to Quest changed the interface, but the only differences are the buttons across the top of the GUI. The stuff you use to add scripts and such to your game should look the same.
BUT... the online editor does look totally different, if that's what you are using to create games.
Also, sorry, but I have no PDF versions. (They would just be copies of what is online, anyway.)
I agree that some of the tutorials are frustrating.
Some of them have instructions that make you backtrack and change a lot of code from earlier in the same tutorial.
"All over the place" is definitely fitting for some of them.
Honestly, I looked at the DiceRoll
documentation for a few minutes, decided I didn't quite understand it, and made that example game to learn how to use it. :)
Is it the issue that the software is not compatable with Windows 11? I cannot get DiceRoll to work at all using what you have suggested and again trying to use the instructions. I can set up a script, i.e. 'Skill = 'expression' DiceRoll("d6+6")' then when I go to edit the information for the 'Status box', I put 'Skill' in for the key and I either leave the next box blank, and it will display 'Skill:' and nothing else. If I then put ! in the second box all that is displayed is '!', in fact, what ever I put in the second box wipes out the key value and just types what is in the second box. Also when i set the location to 'Room' I just get pages and pages of errors.
I can set up a script, i.e. 'Skill = 'expression' DiceRoll("d6+6")'
I don't use the GUI much, but I think that means you're creating a local variable called Skill
. This is a temporary place to store a value, and only exists until the current script finishes.
Try replacing Skill
with game.pov.Skill
, game.Skill
, or player.Skill
. This will probably work as you expected.
(There are three statusattribute lists in different places in the editor (though the online editor doesn't have all of them). In two of them, if you put the key as Skill
it will look for an attribute game.pov.Skill
; and the third will look for game.Skill
)
((game.pov
in this case refers to the object the player is currently controlling. You could use player
instead, which is the actual name of the object by default. But using game.pov
is a good habit to get into))