julius_sac's Forum Posts

  • 12 posts
  • oosyrag care to clarify/explain?

  • I'm trying to do something like

    runtime.globalVars.myGlobalBoolVar = runtime.objects.AJAX.LastData;
    

    The other thread said to save it to a global variable first, but that's not an option because the value is boolean, and Construct doesn't let you save booleans via expression.

    For full context, I'm using an AJAX request to make an external api call. When that api calls is finished I need the boolean value returned from that request, no matter if it's true or false, to be stored in a global variable.

  • thanks

    const mySliderInstance = runtime.objects.MySlider.getFirstPickedInstance();
    mySliderInstance.value = newValue;
    

    worked

  • I tried:

    runtime.objects.MySlider.value = newValue;
    

    but that didn't work.

  • This seems to have been fixed in one of the latest version of Construct. The first line of CSS I posted no longer works. While the second works just fine now. (which is what I wanted).

    I am curious to know which release addressed and fixed this issue so that I can inform my team

  • I use a CSS file (buttons.en-us.css) to customize my buttons and set them via the background property. In order for Construct preview to work properly I have to use an absolute path:

    background: url('assets/img/tutorial/TutorialBGIdle.png') no-repeat;
    

    But for other hosting sites when I publish the game (Scorm in my case), I have to use a relative path:

    background: url('../../img/tutorial/TutorialBGIdle.png') no-repeat;
    

    I can probably workaround this if I change my export structure to Flat instead of Folders, but since that's not recommend I wanted to see if anyone else has figured this out.

  • Nvm, this can be easily done using the "System" conditions/action. I was trying to use "Sprite" conditions/actions

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a few global objects (sprites and buttons). On most layouts I want them, but on a few I don't want those. On the layouts where I don't want them I destroy them (I can't just mark them invisible for WCAG reasons). If i go to a layout where I don't want them, and then do to a layout where I do want them I would like to be able to do something like:

    if (Sprite.count < 1) : create Sprite at Position 50,200 on Layer O

    However, i don't think "is visible" or "is on screen" are what I'm looking for in the conditions.

    And, "spawn another object" doesn't work in the conditions either.

  • The "wait 0" did work. Also, right after I posted I tried reversing the order and that worked as well. Thank you!!

  • I have something like a binary tree/choose your own adventure mechanic. I present multiple questions and the user can go right or left at each question. I keep track of this with a global variable called questionNumber. When the user clicks buttonRight, I would like for the global variable to be updated only once. However, with my current set up, the global variable is going from 0 to 2 to 6 to 15 from just one click.

  • That worked. Thanks!

  • I am trying to change a button image when the mouse is hovered over it. For now I am initially setting the button's background image on a "On start of layout event". However when I try to change the background image on a "Cursor is over..." event nothing happens.

    NOTE: I know this can be done easier using a sprite rather than a button, but I need this to be a button for WCAG accessibility reasons. Also, I did try to do inline javascript with the onmouseover() function but couldn't get that to work either.

  • 12 posts