Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Bug Report (https://forums.graalonline.com/forums/forumdisplay.php?f=193)
-   -   Windows v6 beta test (https://forums.graalonline.com/forums/showthread.php?t=134257598)

Tigairius 01-22-2011 07:48 PM

Stefan did that on purpose for efficiency. On kingdoms iphone we have to create a new object each time we want new text basically. After about 30 objects or so, modulus back to 0.

Crow 01-22-2011 08:24 PM

Quote:

Originally Posted by Tigairius (Post 1624875)
Stefan did that on purpose for efficiency. On kingdoms iphone we have to create a new object each time we want new text basically. After about 30 objects or so, modulus back to 0.

I know he did. The behavior should be optional, though. I also asked him personally about it, and he replied that it shouldn't even do that with text particles or something like that. He also said I should try two particle types and setting both vars the same, for that would eliminate his optimization, but that didn't work either.

Admins 01-26-2011 12:08 AM

Ok next version will have emitter.particle.uniqueparticle = true/false, will be released this weekend or so.

Crow 01-26-2011 06:03 PM

Quote:

Originally Posted by Stefan (Post 1625536)
Ok next version will have emitter.particle.uniqueparticle = true/false, will be released this weekend or so.

Thank you <3

Fulg0reSama 01-26-2011 06:44 PM

Quote:

Originally Posted by Stefan (Post 1625536)
Ok next version will have emitter.particle.uniqueparticle = true/false, will be released this weekend or so.

I got a friend to tell bout this.

Geno 01-26-2011 10:48 PM

graal runs on my netbook when using V6.

the last version would not run...so

Thanks! :)

MrOmega 01-27-2011 01:19 AM

Here's an issue I'm having. I'm using GraalControl.onMouseDown() and call a function from within side this. Now within this function I call another and same again in the next function. The params in getDist() are always the params of onMouseDown(), not the ones I send.
PHP Code:

function GraalControl.onMouseDown()
{

  
doActions();

}

function 
doActions()
{

  
someFunction();

}

function 
someFunction()
{

  
temp.dist getDistplayer.xtemp.nx);

}

function 
getDisttemp.x1temp.x2temp.y1temp.y2)
{

  if ( 
params.size() == 4)
    return (((( 
temp.x2 temp.x1) ^ 2) + (( temp.y2 temp.y1) ^ 2)) ^ 0.5);

  if ( 
params.size() == 2)
    return ((( 
temp.x2 temp.x1) ^ 2) ^ 0.5);



Basically in getDist the params are that of onMouseDown() regardless.

cbk1994 01-27-2011 01:45 AM

Quote:

Originally Posted by MrOmega (Post 1625806)
Basically in getDist the params are that of onMouseDown() regardless.

This is intentional. You have to give the parameters names. Stefan explained it somewhere but I can't find the post.

EDIT:
Quote:

Originally Posted by Stefan (Post 1463493)
The params[] array is only created when the script is called (doesn't even need to be a function, GS1 style). That is either on an event, or when you call a function of another object. To get a variable number of parameters either use func(arg1, arg2, arg3, arg4 etc) and ignore the arguments that you don't want, or pass the parameters as array.

Currently accessing the parameters for each function as array is not possible because it would mean a big speed slowdown, although if it's really important to have it then we could add something like temp.functionparams[] which dynamically converts the function parameters to variables.


fowlplay4 01-27-2011 01:50 AM

Quote:

Originally Posted by MrOmega (Post 1625806)
Here's an issue I'm having. I'm using GraalControl.onMouseDown() and call a function from within side this. Now within this function I call another and same again in the next function. The params in getDist() are always the params of onMouseDown(), not the ones I send.

Basically in getDist the params are that of onMouseDown() regardless.

Provide an actual working script (especially in Bug Reports) with some output if you want to help get the issue resolved.

Edit: So it's intentional.

PHP Code:

//#CLIENTSIDE

function onCreated() {
  echo(
"== Created ==");
  
getSomevalue(12);
}

function 
GraalControl.onMouseDown() {
  echo(
"== Clicked ==");
  echo(
"MouseDown: " params);
  
somefunction();
  
this.scheduleevent(1"CheckParams""");
}

function 
onCheckParams() {
  echo(
"check: " params);
}

function 
somefunction() {
  echo(
"somefunction: " params);
  
someotherfunction();
}

function 
someotherfunction() {
  echo(
"someotherfunction: " params);
  
temp.getsomething getSomevalue(12);
}

function 
getSomevalue() {
  echo(
"getsomevalue: " params);
  echo(
"getsomevalue params: " a SPC b SPC c SPC d);


echos..

PHP Code:

== Created ==
getsomevalue
getsomevalue params0 10  
== Clicked ==
MouseDown0,414,540,1,0
somefunction
0,414,540,1,0
someotherfunction
0,414,540,1,0
getsomevalue
0,414,540,1,0
getsomevalue params
0 10  
check
""

My advice, don't rely on the params array when you can specify parameters in the function. In your case just add a second function.

cbk1994 01-27-2011 02:29 AM

Quote:

Originally Posted by MrOmega (Post 1625806)
PHP Code:

  if ( params.size() == 2)
    return ((( 
temp.x2 temp.x1) ^ 2) ^ 0.5);




On second look at your code... lol?

MrOmega 01-27-2011 02:49 AM

Quote:

Originally Posted by cbk1994 (Post 1625814)
On second look at your code... lol?

What? It checks to see if it's getting the dist from two points or just the xdist/ydist. 4 params means its getting it from two actual points...

cbk1994 01-27-2011 02:52 AM

Quote:

Originally Posted by MrOmega (Post 1625818)
What? It checks to see if it's getting the dist from two points or just the xdist/ydist. 4 params means its getting it from two actual points...

You don't see anything wrong with:

http://u.graalcenter.org/i/lolwtff.gif

?

MrOmega 01-27-2011 02:55 AM

Quote:

Originally Posted by cbk1994 (Post 1625821)
You don't see anything wrong with:

http://u.graalcenter.org/i/lolwtff.gif

?

Well when you put it in that view I do. But it basically acts as abs(); I could do abs( temp.x2 - temp.x1);

@fowlplay4:
What do you mean add a second function...

Why can't I just recreate the params array when I call a function?

fowlplay4 01-27-2011 03:14 AM

Quote:

Originally Posted by MrOmega (Post 1625823)
Well when you put it in that view I do.

@fowlplay4:
What do you mean add a second function...

Why can't I just recreate the params array when I call a function?

You have complete control over what data you pass to it, instead of checking for how many parameters you pass to a certain function, write a function to take exactly how many parameters you need.

I.e:

PHP Code:

function getDist2(temp.x1temp.x2) {
  
// code for just two points here



WhiteDragon 01-27-2011 03:19 AM

Alternatively, write an n-dimensional distance function that accepts an array of tuples.


All times are GMT +2. The time now is 10:22 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.