So after a little bit of digging I found on the sugar cube wiki a way to increase/decrease a 'stat' value with the following;
Strength: <<click "[-]">><<set $Str-->><<replace "#stats-str">><<print $Str>><</replace>><</click>> <<set $Str to 10>><span id="stats-str"><<print $Str>></span> <<click "[+]">><<set $Str++>><<replace "#stats-str">><<print $Str>><</replace>><</click>>
What I don't yet have however, is a means to implement a minimum/maximum amount for each stat. I also tried to implement a system in which each stat increase or decrease would impact on the number of stat points that could be allocated.
Here is the exact macro I attempted to utilize;
Stat Points: <<set $Skills to 20>><span id="#skills"><<print $Skills>></span>
<<if $Str-->><<replace "#skills">><<set $Skills++>><<print $Skills>><</replace>><</if>>
<<if $Str++>><<replace "#skills">><<set $Skills-->><<print $Skills>><</replace>><</if>>
Instead, the number of points for 'Strength' can increase without changing the number of points for 'Stats' whatsoever, and with no error message.
My plan was to get it working with 'Strength' first, so that thereafter I could do the same with the rest of the stats so that +1 in strength would mean -1 in Stat Points and vice versa. After that, then I could work on doing the same with the rest of the stats.
I also managed to incorporate difficulty settings by altering the number of stat points that would be available.
Anyone about who could offer some insight into this?
Comments
Additionally, as long as you keep naming your stat element IDs similar to "stats-str", then you could use the following CSS to make them display a bit nicer:
It even works with the 'click' macro! Currently I prefer the 'Click' macro as I'm not sure how to alter how buttons are displayed yet on the style sheet (all I really need is to change the color to green). Is there something on the wiki? Haven't checked in a while, been working on making my own music x)
I have plans down the line for integrating an in-game save system using E.G. going to bed/sleeping as a means of passing time/saving the game and storing it somewhere, but one thing at a time for definite.
Also, I've seen evidence that people can embed you-tube videos into their projects.. Would it be possible with an animated gif/non you-tube video (such as an MP4 or similar) instead?
I'm very much still in the midst of trying to understand all the terminology surrounding this, but I'm getting much closer thanks to my own experimentation with it, and of course with helpful people such as yourself providing valuable assistance thanks again!
When the Value of the Stat reaches maximum or minimum output, is it possible to replace the individual 'Click/Button' related to maximum/minimum output with empty space, or at least a message underneath the appropriate stat?
( <<If $Str lt5>>
<<Print $StrMin>>
<</if>> )
Just so as people won't be frantically clicking a button wondering why it won't increase or decrease (to soft proof it to those who are less tech-literate).
I have tried doing both myself, but to no avail.
The aforementioned macro does not display an error message, yet nor does it display the text I have associated with '$StrMin'.
I cannot perceive as to whether the wiki contains information on how to replace a 'Click' macro in this manner. Is it Possible to do so/something similar?