andyclausen's Recent Forum Activity

  • Hello

    I'm developing a Parse.com plugin for C2, and I get this annoying error.

    When I set the value to a variable in C2 using an expressesion, it gets turned into 0.1 for any integer or float.

    When I log to the console directly from runtime, it returns the correct result. When I do it using C2, it returns 0.1 in the console log.

    This is my code in runtime:

    Exps.prototype.QueryHighest = function (ret,par0,par1,par2)
    {
    	var Object = Parse.Object.extend(par0);
    	var query = new Parse.Query(Object);
    	
    	// Retrieve the values descending
    	query.descending(par1);
    	 
    	query.first({
    		success: function(result) {
    			var Return = result.get(par2);
    			console.log(Return);
    			if(isNaN(Return)){
    				ret.set_string(Return);
    				console.log("set_string");
    			}else if(!isNaN(Return)){
    				if(isInt(Return)){
    					ret.set_int(Return);
    					console.log("set_int");
    				}else{
    					ret.set_float(Return);
    					console.log("set_float");
    				};
    			}else{
    				ret.set_any(Return);
    				console.log("set_any");
    			};
    		},
    		error: function(error) {
    			alert("Error: " + error.code + " " + error.message);
    		}
    	});
    };[/code:re1csazq]
    
    And for the edittime:
    [code:re1csazq]AddStringParam("class","Which class does the object lie in?");
    AddStringParam("search attribute","The attribute whose value you want to search for.");
    AddStringParam("attribute","The attribute whose value you want to get.");
    AddExpression(0, ef_return_any, "Parse query: highest result", "Search Query", "QueryHighest", "Returns the highest value from a specified attribute.");
    [/code:re1csazq]
    
    And in C2:
    [img="http://i.imgur.com/sbBdWbQ.png?1?5042"]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
andyclausen's avatar

andyclausen

Member since 20 Aug, 2014

None one is following andyclausen yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies