KreKre's Recent Forum Activity

  • Browser.ExecJS("eval('" & yourString & "');")

    I think that will return a string with the evaluated value. And then you can do:

    Browser.ExecJS("!isNaN(""" & value & """);")=1?float(value)%1<>0?float(value):int(value):value

    which will give you it as either a float,int,or string if it isn't NaN.

    This was extremely helpful, thank you so much! It wouldve taken me ages to research that. Thanks a lot

  • Hello!

    If I have a text variable that looks for example like this: "5+7+2*8", is there any way of it calculating the values of that, and then making the answer a number variable? So in the end I would get a number variable with the value of 28.

    Any help would be greatly appreciated

    Regards,

    Kriss

  • Hi, it's easy. Take a look at my example:

    I did the exact same thing (or so I think anyway), yet it didnt work. SO, I remade the whole thing, and now it magically works... yay

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello! I have a user input box, with the type set to Number. I want to be able to set a numerical global variable to what the user inputted in the box after clicking on a button. So something like On Button pressed, set GlobalVariable to UserInput.Text. I have tried this, however it doesnt seem to work. Any ideas why?

    Any help would be greatly appreciated

    Regards,

    Kriss

  • You need to pick the correct instance you want the event to take action on by specifying it in the conditions.

    In this case, your condition should be Sprite - compare instance variable - instancevariable = textbox.text.

    Thanks a lot, this was perfect for my intention.

    Im guessing that there is no way to make this non-case sensitive? Its not a massive problem, but it would be a good thing.

  • Hello! Id like to make something like this. If Textbox.Text = Sprite.InstanceVariable, set Sprite Visible. But, I dont understand how to make it so that it only sets the particular instance of the sprite that has its instance variable = Textbox.Text. I can only make it work on all instances of that sprite, not the one in particular that has an instance variable equal to the user input.

    Id really appreciate any help here.

    Regards,

    KreKre

  • Allright, I tried doing that, but it didnt really work out the way I wanted it to. I managed to solve the problem myself now, but it took 40+ events to do so lel.

  • Hey there!

    I need to make a reload system for my game. Right now, you have 6 bullets, and each time you shoot, the variable decreases by 1. For reloading, I wanted to make it so that it reloads each bullet with a 0.5 second delay in between each bullet, and I also want the reloading to stop, in other words not finish, if the player shoots during the reload. Ive tried doing something with while loops, but it really isnt working out... Does anyone have any idea of how this can be achieved?

    Will be very grateful for an answer

  • Thanks a lot for the help

  • Hello! Im new to the forum (noob)

    I need a little help with centering my character. I have used the Scroll To behaviour, and it works wonderfully, centering my character in the window. The problem is that I have added a UI on the right side of the screen, which obscures about 1/6 of the game window. This means that the player cant see as much to the right of him as he can to the left, which is quite annoying. I would like it if it's possible to use the Scroll To behaviour to center the character between the left edge of the UI window and the left edge of the window.

    Any help in this matter will be much appreciated.

KreKre's avatar

KreKre

Member since 19 Dec, 2016

None one is following KreKre yet!

Trophy Case

  • 7-Year Club
  • Email Verified

Progress

8/44
How to earn trophies