R0J0hound's Recent Forum Activity

  • You have your on function events and then events right after that. Those right after aren’t part of the function event, so they will run as normal. So it’s not a case of the function triggering, it’s just events running as normal.

    If those events were sub-events I’d the function then they would be part of the function and wouldn’t run without the function being called.

  • Had a quick look. I can't open the capx because it uses plugins i don't have and likely will never install. Anyways looked in the event sheet xmls. You have functions that do some things but you also have events that will run that aren't part of the functions. Are you sure it's not just those events that are running and making you think it's the functions?

  • Post the capx, and i'll narrow it down if it's a bug. Disable actions don't run, if the functions run, then they must be called from somewhere. I can't guess anything from a screenshot of events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That shouldn’t happen. If you’re sure you’re not calling the functions, then I guess it may be a bug. All I can say is I’ve used functions a lot and they only run when I call them.

  • It’s a computer thing. In base 10 numbers it adds up to 1, but in base 2 the number 0.1 can’t be perfectly represented. It’s actually a tiny bit smaller and after adding it 10 times The error is a bit bigger.

    Anyways you can read more about it by looking up floating point numbers on Wikipedia. You don’t see it in some software because when they display numbers they use less decimal digits so it rounds to 1, at least when it’s displayed. When dealing with decimals in general there is a small amount of approximation so you can’t expect numbers to be exact values.

    Anyways, rounding the number is one solution, as you have done. Another is to just add 1 every time and divide by 10 when you want to use the value.

    A third, albeit needlessly elaborate solution would be to do all the math in a base 10 way and store a decimal as two integers.

  • Say n is the number you want to display

    int(n)&”.”&zeropad(int(n*1000)%1000, 3)

  • You’ll have to look at the api of the export you used. They usually expose extra stuff to JavaScript. You’d have to just look at their docs. They typically have a plugin system to include more. The most I’ve fiddled with is extra stuff in nwjs, but it should be similar for other exports. You would use the browser execjs action to access it. That stuff isn’t minified.

  • If you look at one of the disabled lines I have that case covered.

    Execute js “global.myvar=“&textbox.text

    You could just as well do an Ajax request and then do

    Execute js “global.myvar=“&ajax.lastData

  • It’s declared in the first start of layout. “global” is the global object and we add myvar to it by assigning something to with global.myvar=. After that you can just use myvar instead of global.myvar.

  • If you have a number in a variable n, you can do this:

    e= int(log10(n))

    set text to int(1000*n/10^e)/1000&"x10^"&e

  • Grimmy

    You can do it with the browser plugin's execjs action and expression. The only learning curve is dealing with quotation marks ("). You'll want to use single quotes instead ('), or use "" when you want to use a " in Construct expressions.

    Anyways here's an example:

    https://www.dropbox.com/s/uhxb4e6eoypih ... .capx?dl=1

    There really is no reason to use a json plugin, other than error catching i suppose.

  • Paste an object with the destination out blend mode. That erases.