jjc001's Forum Posts

  • Thank you again! I appreciate the help

  • awesome thanks so much for the replies, I will try them as soon as I get home!

    Another question, what if I wanted to insert data to the first empty cell or row, how would I do that?

  • Essentially, I want the condition to be:

    at end of layout

    if array at (0,all) contains 0

    then delete row

    Tagged:

  • Sorry, I should have been more specific, the value is in an array.

  • no for a variable comparison, if x = any value that is between 1 and thirty

  • such as 1 through 30, my brain thinks 1-30, but construct will think I mean minus.... I looked through the manuals several times and didn't see it, sorry if I missed it

  • awesome thanks so much everyone! I understand now!

  • Bear with me, I don't use construct as often as I would like....

    Try:

    object1 on collision object2 ----------- destroy object1

    --------- globalvariable1="a"|globalvariable1="b"|globalvariable1="c"=1 ------- subtract 3 from globalvariable2

    Is there a way to do a | in the midst of comparing global variables? I just see a drop down that I can't edit other than choosing one. If my understanding is not lacking, I would have to do each global variable= "whateverletter" as a separate sub event and that is what I was attempting to avoid. Eventually there will be 18 different possible values for globalvariable1 in this case (that mix and match combinations of 1 and 5), and 8 subevents already, each with another condition attached that is similar to the prior compare global variable, if I get it the way that I want. And this process will then need to be done an additional 18 times.

    A regexvariant would be

    test regex

    string: globalvariable1

    regex: "^[abc]$"

    flags: ""

    If you need to check for variable contents (a not being a string, but variable name), then the variant without regex will be easier.

    I didn't know that test regex was a thing, this may work, though it was not what I originally was hoping for. I'll have to do some more research, but I mostly would still Just like to know the proper format for finding comparing a global variable to multiple possibilities in text form

    if I'm not being clear, when I'm at this stage

    variable: globalvariable1

    comparison: =

    value: this is the part I don't know how to put multiple text possibilities separated by |

  • object1 on collision object2 ----------- destroy object1

    --------- globalvariable1="a"|"b"|"c" ------- subtract 3 from globalvariable2

    do i need parenthesis somewhere in my subevent? around all of it? or each individual set of ""?

  • Thank you so much guys, Aphrodite u found the problem.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • that didnt fix it :/ i ran it in debug mode and when i look at the webstorage that the value for "HighScore" doesnt have a name, only a value.

  • ok so just trying to get a simple highscore functioning, and it does but every time i close the game the highscore resets to zero or if i dont score i get NaN

    on the first layout (in reference to highscores) i have:

    global highscore = 0

    on start -

    local key "HighScore" exists - set highscore to WebStorage.LocalValue("HighScore")

    else - set local key WebStorage.LocalValue("HighScore") to 0

    on the game over layout (in reference to highscores) i have:

    score > WebStorage.LocalValue("HighScore") - set WebStorage.LocalValue("HighScore") to score

    ------------------------------------------------set highscore to score

    ------------------------------------------------set text to "Highscore" & highscore

    score < or equal to highscore - set text to "Highscore" & highscore

    just as a note when i change the "set text to "HighScore" & highscore to score"

    to

    "set text to "HighScore" & WebStorage.LocalValue("HighScore") to score"

    the output is just HighScore