Nepeo's Recent Forum Activity

  • Is it showing you this error in the editor? I forgot there's a bug in the current beta that the script validator doesn't know that script blocks are async contexts.

    "fetch" returns a "promise" object, there's 2 ways of using a promise. Async/await is the newer, and easier to write way. But there's an older version which uses callbacks. The older format will be accepted by the script validator without any problems. Try this instead:

    	const url = "https://www.mydomain.com/upload/get_content.php";
    	const data = { posturl:document.referrer };
    
    	fetch(url, {
     		method: 'POST',
     		body: JSON.stringify(data),
     		headers:{
     			'Content-Type': 'application/json'
     		}
    	})
    	.then(res => res.text())
    	.then(data => runtime.callFunction("pub_id", data));
    
    
  • You do not have permission to view this post

  • Ah yeah the piece of code I gave you expects to be used in an event sheet script block. If your not using it like that you will need to place it into an async function so that the "await" operator works.

  • I've made some changes for the next release so that leading/trailing whitespace is removed on any Admob ID and the privacy policy. Should stop people getting caught out by this in the future. Thanks for bringing the issue to my attention.

  • The error isn't particularly descriptive, it's coming from the Admob SDK. I backtracked it and it's not actually related to the privacy URL, although it can generate the same error message. You have a space at the start of your publisher ID, which it's using to build a URL. Remove the space and it works fine.

  • There's a few things here, but I think the key thing is that $.post is a jquery function, jquery is no longer included in Construct so unless your including it yourself it won't work.

    I'm a little unsure about some of the edges here, but if I was trying to implement this now I would use:

    const url = "https://www.mydomain.com/upload/get_content.php";
    const data = { posturl:document.referrer };
    
    const res = await fetch(url, {
     method: 'POST',
     body: JSON.stringify(data),
     headers:{
     'Content-Type': 'application/json'
     }
    });
    
    const data = res.text();
    runtime.callFunction("pub_id", data);
    

    As in inline script in the event sheet. It uses the "fetch" API, which is native instead of being an external library.

  • The below log message isn't an error.

    [C3 advert] Event (interstitial created Error () Type () Amount (0))

    The log has the format Event ({MSG} Error ({ERR}) Type ({REWARD_TYPE}) Amount ({REWARD_AMOUNT})), note how the error part is empty in your message. It's just saying that it succeeded to create the interstitial.

    I can't really offer much assistance without a project to look at.

  • Each tilemap tile can be considered equivalent to a cheaper version of a sprite, but whereas each sprite has it's own texture a tile shares it's texture with all tiles of the same type. Greatly reducing the required VRAM and number of texture swaps required to render your scene.

    This thread isn't for requesting help on the Mobile Advert plugin, I left it open in case anyone had further questions about the change. If you want to ask for help on the plugin I suggest you create a new thread.

    kyberosc the error your seeing

    ERROR: Rejection from 'advert' handler 'Configure': unsupported URL

    is caused by using an invalid URL for your privacy policy.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's not just you, I totally agree about standard recursive descent. The way that precedence is decided by the control flow makes it feel quite inflexible, and you have to read a lot of code to actually understand the operator ordering.

    I've got a couple of personal projects on the go involving Pratt parsers, which are a variant on the operator precedence parser you link. The first being a JS parser written in JS and the second being a language prototype called Radiance(private repo. ATM) that compiles to JS.

    This is basically the core part of the Pratt parser logic...

    function parse (tokens, precedence) {
    	let next_token = tokens.lookahead();
    	let parselet = prefix_parselets.get(next_token);
    
    	if (parselet == null) {
    		throw UnexpectedToken(next_token);
    	}
    
    	let left = parselet.use(tokens);
    
    	while ( precedence < get_precedence( tokens.lookahead() ) ) {
    		let next_token = tokens.lookahead();
    		let parselet = mixfix_parselets.get(next_token);
    	
    		left = parselet.use(left, tokens);
    	}
    
    	return left;
    }

    It's quite flexible, you can do complex operators with multiple sub expression and non-standard precedence rules. Also changing the precedence is as simple as changing 1 number, which is nice.

    I find your parser experiments pretty impressive, it's obviously possible to implement such things using the event sheet but the type limitations must be pretty frustrating at times. Getting good error messages can require a fair bit of work, I think one of the most important parts is including an easy to understand location in the message. Some languages actually ascii diagrams of source code with arrows to the problem parts now... which is pretty nuts!

  • Right click the column you want to sort by, and select the sort direction you want. Doesn't work if you select the column header at the moment though.

  • You do not have permission to view this post

Nepeo's avatar

Nepeo

Member since 8 Mar, 2016

Twitter
Nepeo has 583,792 followers

Trophy Case

  • 8-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x3
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

13/44
How to earn trophies

Blogs