Or would it work better as a widget?
I wanted it so the lowest tier Private started small then as the stats build you go to the next but all the stats have to be right in order to rank up.
ahh yea I forgot about the &&. I was coding right in twine rather than using visual studio code so it just all kind of blended together. Could it have all 4 Var or just 2? Like
Or does it need to be split up in two. Im thinking maybe doing this in a widget would be easier in the end, but then would it update the rank as the stats update while in the widget?
I just realized I dont think this whole thing will work like I want it to. The first part might with all of it being less than the nimbers I want to be a Private but the second set would still be less even at the first part so it would be confused as to what rank it needs. So there needs to be a way to say if strength is between 20 and 60 then rank is corporal and so on.
Ok I got this part working good now Thanks. Now the last step to do is hide the go to next page until all the steps are taken. I basically have it set so you have a dropdown menue for age a textbox for name and three popup links for radibuttons once all those are done I want a link to appear saying Next to go to a new passage.
There is no notvisited() function and has is not a valid operator
I suspect you want
<<if visited() < 5>>
[[Next|next]]
<</if>>
But I’m not 100% sure. Are you refreshing the passage after every pick? If not, the number of times the passage has been visited() will not change.
Generally it seems you want the game to react to you choosing values from dropdowns and radiobuttons. Sadly, there is no such function built into Sugarcube (i.e. the only events you can have the game react to are clicks on buttons and links with <<button>> and <<link>>).
To do what you want, you must take one of three approaches
Use <<repeat>> to check the state of the passage every X seconds (or less) to see if the conditions have been met
Use a javascript event handler to monitor the controls and do something when they are changed
Use a third party macro like <<on>> or <<listen>> or <<live>> to do the same thing as (2) but without having to write your own JS
In general, option 1 is a bad idea, for all that it is the only one available as a default macro, since it means the game is constantly running checks even when nothing is happening, which will slow down the browser.
Option 2 is fine if you are comfortable with custom javascript. You could monitor the clicks on the radiobuttons like this:
Yes The page refreshes each time. I have three groups one for career one for hobby and one for background each with radiobutton choices once the choice is made the main page with the links to them refreshes. I think I have this part all handled for the time being I need to add in time and day cycle which im already familiar with then to start adding events, which is where the fun comes in.
Well in that case the first code I gave you will work.
However, I’d say that — in general — refreshing the passage constantly is a bad idea. It fires events, it puts new entries in the history, it makes saves bigger, and it makes the passage visually flicker on screen. If you can move to a live model like the ones I described in my longer reply, then you will be better off.
yea thats unedrstandable but in this case its only going to be on this passage at the begining when creating the character and then never see it again during the game.