Page 1 of 1

A problem with a void function

PostPosted: Fri Jan 25, 2013 9:58 am
by lverona
You can tell I am working on a game, generating so much topics :)

Anyway, this one is weird, maybe there is a bug or maybe I am missing something.
I have a collision event and I decided to call a void function. This void function I write in global code space.

Code: Select all
void LifeBase1(){

life=life-1;
life_meter.textNumber=life;

}


However, it does not work. I tried to check this and put a PauseGameOn; inside there - and it worked! But for some reason the rest doesn't. When I put these lines into a Collision Script Editor - they work fine. Moreover, a strange thing happened - I commented those lines out in Collision Script Editor and put a function call again - and this time it worked! But then it stopped working again %)

This is weird.

Re: A problem with a void function

PostPosted: Fri Jan 25, 2013 10:05 am
by lverona
In fact, it is this line which does not execute:
life_meter.textNumber=life;

Re: A problem with a void function

PostPosted: Fri Jan 25, 2013 10:07 am
by lverona
Found the solution on the forum, apologize for not searching first. You can delete this thread, but if it stays, here is a workaround: viewtopic.php?f=1&t=12249