Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
So I was writing a simple behavior that will perform one of several specified actions randomly based if the values of 2 Coppercube variables are high enough. Code works Perfectly fine in windows, it does not in Android. Any ideas why? Link to my js file: https://drive.google.com/file/d/... |
||||
|
|
||||
|
Don't you get errors like IfResource5A and ActionSet5A and B is not defined.....?? |
||||
|
It was a longer code block than this that's all the same from IfResource5A all the way to IfResource1A. When I cut out the repeating code (i couldn't fit it into the post) i left IfResource5A code not IfResource1A code. I updated the post. to eliminate confusion here is the JS file: https://drive.google.com/file/d/... |
||||
|
Are you saving and loading coppercube variables, i can't remember correctly if we can load and save variables on android. Var ResA = ccbGetCoppercubeVariable(this.resourceA) Am assuming that u are using save and load variable for this. I didn't checked the code in coppercube, am just answering by reading it. Currenlty i am on a place on earth where i can't reach out to a computer. I just have my mobile device and i can't do much help. In march i will return to my hometown and then only am able to get my hands back on this engine. These relatives here are really a headache. |
||||
|
wrote: It was a longer code block than this that's all the same from IfResource5A all the way to IfResource1A. When I cut out the repeating code (i couldn't fit it into the post) i left IfResource5A code not IfResource1A code. I updated the post. to eliminate confusion here is the JS file: https://drive.google.com/file/d/... Have you tried to set a global variable outside your main behavior function then save variables to them rather than coppercube variables? Global variables can hold more than numbers and strings compared to cooppercube variables. Example:
|
||||
|
thanks for the responses. I used the coppercube variables as i need to access those values from multiple scripts aside from this one. Like I said the script works just fine in all but Android target, and it sems like the issue is having several switch cases or if/elseif statements with ccbInvoke Action() method. This isn't the first time i've had this issue with a script and the common factor was this. |
||||
|
wrote: thanks for the responses. I used the coppercube variables as i need to access those values from multiple scripts aside from this one. Like I said the script works just fine in all but Android target, and it sems like the issue is having several switch cases or if/elseif statements with ccbInvoke Action() method. This isn't the first time i've had this issue with a script and the common factor was this. It was a longer code block than this that's all the same from IfResource5A all the way to IfResource1A. When I cut out the repeating code (i couldn't fit it into the post) i left IfResource5A code not IfResource1A code. I updated the post. |
||||
|
The solution is to use ccb behaviors. see i made a switch case ... in javascript and it worked fine in windows. But on android no. I have to convert the conditions code to the behavior in the editor. using the behavior "if your variable has a value do it" .... and others is like coding visually. I hope you understand. about android read data and sqlva have not tried yet hope it is possible because I am making a game for android with ccb. |
|