Nepeo's Forum Posts

  • The browser is currently restricted in it's ability to open external editors for files, although the experimental local folder projects might work around.

    I generally advise that you basically just have function calls in event sheet scripts, then have the actual functions in script files. Makes it easier to work with.

    The text editor we use does have an automatic indentation option, but it's currently turned off as it incorrectly indents curly braces if you follow the brace on newline style. We could make this configurable, but it would likely be off by default.

  • Timing wise calling a function is the same as say... a nested event block. So it should complete during the current tick. Provided you don't have something like "wait N seconds" or "wait for previous async actions" inside the function.

    Yeah it sounds like you could fix it by stashing the data into a variable, or some other data structure. I don't think I have the CSV plugin lying around to check, but you might be able to check my guess by looking at the debug values. If it has something like "current iterator value" you can step through the event block and see what it changes to.

  • I think Chrome leverages at least part of the system text renderer, as I suspect Firefox does. So it might be an edge case related to the macOS font system used in this specific context. I'm not super familiar with our text rendering system, but I expect it's treading the pass less travelled when it comes to text rendering in the browser.

    Managed to find this mention of the Chromium text rendering.

  • While at the Schools and Academies show with Laura_D last week we talked a bit about mapping touch and gamepad controls to tile movement. I think she's planning to put some tutorials out about it, but I'll put the gist of the maths up here for you.

    This example is for a player that moves towards the touch location.

    	// 10 is rather arbitrary here, it needs adjusting based on your usage
    	DEAD_ZONE = 10
    
    	neutral_x = Player.x
    	neutral_y = Player.y
    	target_x = Touch.x
    	target_y = Touch.y
    
    	delta_x = target_x - neutral_x
    	delta_y = target_y - neutral_y
    	
    	magnitude = sqrt(delta_x * delta_x + delta_y * delta_y)
    	// add 180 to the angle, so that it's in the range 0..360
    	theta = angle(0, 0, delta_x, delta_y) + 180
    	
    	// checks to see if we have a sufficient offset from the neutral position
    	if (magnitude > DEAD_ZONE) {
    		// rotate the angle by 45 degrees ( range is now 45..405 )
    		theta = (theta + 45);
    		// divide by 90 to get a value from 0.5..4.5
    		// then round the value so that is is an whole number ( 1/2/3/4 )
    		// finally modulo the value by 4 so that it wraps around
    		// the range will now be 0..4
    		theta = round(theta / 90) % 4;
    		// theta is now 0 for west, 1 for north, 2 for east and 3 for south
    	}
    
    

    This should be relatively easy to map to a virtual analog stick, just use the center of the stick for the neutral position. You can ditch the math inside the if block if you just want the angle, it's just for mapping the angle to a 4 direction value. Also that math could be tweaked for 8 direction if wanted.

  • I'm going to hazard a guess that the plugin clears the current iterator value after it's finished a loop. Which is fine, except if you have a nested loop then the iterator value isn't usable after the inner loop has completed.

    loop {
    	// current iterator = outer
    	loop {
    		// current iterator = inner
    	}
    	// current iterator = null
    }
    

    The expected behaviour for using an expression at an invalid time it to emit some sort of null value ( empty string for string expressions, 0 for numerical ) so accessing iterator values when the plugin doesn't have an iterator would probably return zeroes.

    Typically a plugin can solve this by storing the current iterator before starting a loop then restoring it after the loop has completed.

  • The example you sent actually appears to render correctly for me, the emoji is in the Twemoji font and the text is mostly in the default font. The piece of text AFTER the emoji appears in a different font for some reason.

  • Might be that something in our BBCode parser doesn't like emoji, you got a minimal project I can take a peek at?

  • Are you using actual unicode emoji or something like emoji short codes like :smile:? It should be as simple as pasting the emoji into your text field, then setting the font.

  • fredriksthlm Yeah it is quite a confusing issue. In my mind you shouldn't need to set "child directed" as setting your content rating to "G" should imply that it's suitable for children.

    I expect the method to set content rating from the app is an additional method to allow more specific control ( per user as opposed to per app ).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just finished adding them, although I need to do some testing. There's 3 new actions:

    1. Set max advert content rating
    2. Tag for child directed treatment
    3. Tag for under age of consent

    I think you need to set the first to "General Audiences" and the second to true to meet the store guidelines to display ads to kids.

    The last one is a little more confusing, not much guidance is given on it. It appears to only be needed under GDPR areas, but quite how your supposed to know if your user is under the age of consent I have no idea. As per usual Admob says they are only providing the tools, and that you need to decide if you need them.

  • The particular section they appear to be complaining about is down to the type of advert you are showing, which we don't have any control over. However, there are a few settings available in the Admob SDK related to children which we could expose to developers. I believe the relevant ones are setting the "max_ad_content_rating" value and tagging the advert request for "child directed treatment".

  • Audio restrictions are quite irritating to work around, they were introduced to fight against those websites that autoplay music as soon as you open them. I vaguely recall another hack that existed the prevented tabs from going to background mode by using audio contexts as well, so that might have also been a consideration.

    But yeah easiest way is to have some sort of title screen, with a big "lets play" button or the like, and then create the context in that user gesture.

    Mikal the forum has formatting tools for JS, might make your comment a little more readable.

  • The emulator tends to be pretty buggy, and can have subtle issues with software/hardware configurations. If it runs on an actual device then it's a bug in the emulator.

  • This sounds like an Admob configuration issue. I'm not familiar with the guideline your referring to, could you link it for me so I can take a closer look?

    It's not possible to display a banner more than once, but I believe Admob (by default) swaps to a new advert periodically if the banner is open a long time. I'm not sure why that would be default if it's not allowed on the Play Store though. My only other guess is that one of the adverts you are showing is against the T & C's, which would be rather frustrating.

  • Salman_Shh Adding themes is pretty cool! Not sure if you've looked at it before but the Advanced Random plugin has some useful stuff for interpolating colours.