[SOLVED] Can someone interpret this error when exporting to Android?

mikhog

  • Posts: 151
I got my hands on an android pad and tried to export my game to it. I got past the first few bumps (managed to export the basic games in stencyl) so I went ahead and tried to export my flagship, the zombie shooter :)

I got some build errors in c++ though and it's really hard to know what may be causing them. I was thinking there could be some "flash-only" stuff that would be causing it but I have made sure that all those have #if flash /.../ #end stuff around them.

Here's the error from the log that seem to be causing the problem:

[LOG] Finished building for Android (or errored out): 1
[LOG] In file included from ./src/scripts/Design_78_78_TrainerShopBehaviour.cpp:76:
[LOG] include/scripts/Design_119_119.h:76: error: expected '(' before ')' token
[LOG] Running low on free memory: 100.0
[LOG] include/scripts/Design_119_119.h:76: error: expected '(' before ')' token
[LOG] include/scripts/Design_119_119.h:76: error: expected ')' before ';' token
[LOG] include/scripts/Design_119_119.h:76: error: expected ')' before ';' token


And in case you are literate in log-reading I'll include it in full below as well...

If anyone knows what could be the problem I would be very grateful. My girlfriend is a complete non-gamer and the only game she's ever played is that zombie shooter and I foolhardily promised her that "sure I could put that game on your phone, easypeasy" and I'm about to loose all credibility as a master hacker here... :)

« Last Edit: August 02, 2014, 05:26:46 am by mikhog »
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D

rob1221

  • *
  • Posts: 9459
Can you post TrainerShopBehavior?

Epic428

  • Posts: 1118
What do the related behaviors look like? It appears it's expecting certain parentheses at certain points within the code which is why it is failing.

Relevant behaviors from what I can tell are: Design_78_78_TrainerShopBehaviour.cpp:76, Design_119_119.h:76, SceneEvents_2.cpp:49, In those areas are there any code blocks used? If so perhaps there's something included that causes Flash to compile correctly, but when being excluded breaks the game. Maybe try removing all flash stuff entirely and recompiling to see if it works?

Without seeing the relevant logic being used its very hard to discern what the root cause is.
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

mikhog

  • Posts: 151
No there are no code blocks in TrainerShopBehaviour, the other one I'm not sure which one it is. I'll post TrainerShopBehaviour below. Don't judge me, it was scripted early in my Stencyl career :)

The way I interpret the error message the parentheses that are missing are missing in a c++-file generated from haxe. I guess a generated file would be a bit hard to read but can you read the resulting source code somehow? Maybe that could give me an idea what is wrong. I know c++ at least..
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D

Epic428

  • Posts: 1118
if you preview the code, granted it would be in haxe, not C++, and look for line 76, what is on that line? Perhaps, we would find the part of the code that when converted to C++ isn't being converted properly. Given the fact that you're compiling to android, a platform obviously not compiled to a regularly as say flash or maybe even iOS, that specific block causing the problem would very likely be something engine side that needs to be fixed.
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

rob1221

  • *
  • Posts: 9459
I can't tell what's wrong.  I recommend disabling parts of the behavior to narrow down the problem blocks.

mikhog

  • Posts: 151
if you preview the code, granted it would be in haxe, not C++, and look for line 76, what is on that line? Perhaps, we would find the part of the code that when converted to C++ isn't being converted properly. Given the fact that you're compiling to android, a platform obviously not compiled to a regularly as say flash or maybe even iOS, that specific block causing the problem would very likely be something engine side that needs to be fixed.

Well the first "if-statement" of this function is on that line in the haxe code. But I think, as it is mentioned that it's a .cpp-file, that it actually is in the c++ code, but maybe it puts everything on the same line or very close to it? I mean c++ and haxe are somewhat related after all and it might end up on pretty much the same line I guess.

public function _customEvent_OnPlusIntelligence():Void
    {

        if ((getGameAttribute("xp") >= cast((actor.say("TrainerShopBehaviour", "_customBlock_GetXpCostForIncrease", [(getGameAttribute("intelligence") + 1)])), Float)))
        {
            setGameAttribute("xp", (getGameAttribute("xp") - cast((actor.say("TrainerShopBehaviour", "_customBlock_GetXpCostForIncrease", [(getGameAttribute("intelligence") + 1)])), Float)));
            setGameAttribute("intelligence", (getGameAttribute("intelligence") + 1));
        }
        else
        {
            actor.setValue("Generic shop data script", "_message", "NEED MORE XP!");
            playSound(getSound(241));
        }
    }
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D

mikhog

  • Posts: 151
I can't tell what's wrong.  I recommend disabling parts of the behavior to narrow down the problem blocks.

Ok, thanks for taking the time to have a look anyway, I really appreciate it! It's not the first time you help me either :)
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D

Epic428

  • Posts: 1118
well from what I can see in the above code, it all looks good, as you said though C++ might shift things a few lines when converted. I recommend what rob said and disable parts of the behavior to isolate where it is being thrown. Seems like its relating to the sections with the "Get XP Cost" custom block. So I would start there.

Empty out each "when this hears" except one, verify if error thrown. If so remove that one and check again if so, then it's elsewhere, if not, then slowly put back each piece until the error is thrown, that's where the problem is.

Edit: you might also want to verify if the Custom block utilizes any code mode blocks, etc. It might actually be that the behavior with the custom block is the root cause.

Edit: Erp. No that custom block is contained in the same behavior lol. Still recommend doing the above though.
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

mikhog

  • Posts: 151
Ok thanks for the help. This is gonna take a lot of time, building is quite timeconsuming :)
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D

mikhog

  • Posts: 151
Ok so for some crazy reason android did not like a call to a global static function. I did some copy paste and created copies of this function in classes that needed it instead (ie custom block) and deleted the function. I have no idea why this works but it does. It only applied to Android, not to flash and I have looked for a reason (for example #if flash statements) but found none.
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D