Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I'm trying to use the ?: operator in my game, but it causes an error on startup. The temp.exe file crashes causing the Windows error reporting service to trigger. This happens in XP and Vista.
Here the expression as I'm using it in the code.
PlayerDeck.Value('num_cards')<0 ? 52 : 0[/code:397z7hxl]
It's in an action that attempts to increment the value of PlayerDeck.Value('num_cards') by either 52 or 0
Am I using the expression correctly?
I think it's a bit buggy. You might want to throw brackets around every operand:
(PlayerDeck.Value('num_cards') < 0) ? (52) : (0)
If that doesn't help, it's probably totally broken, so ditch it and use subevents instead.
Develop games in your browser. Powerful, performant & highly capable.
I tried brackets everywhere and even took out the spaces:
It still gave the same error so I guess I'll have to go with the subevents.
I added the bug to the tracker, so hopefully it'll be fixed soon.
ooh, thanks. I still haven't even gone through and learned how to submit a bug report.
You people are too nice.