A problem with a void function

Game Editor comments and discussion.

A problem with a void function

Postby lverona » Fri Jan 25, 2013 9:58 am

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.
lverona
 
Posts: 221
Joined: Tue Apr 24, 2012 11:54 am
Score: 1 Give a positive score

Re: A problem with a void function

Postby lverona » Fri Jan 25, 2013 10:05 am

In fact, it is this line which does not execute:
life_meter.textNumber=life;
lverona
 
Posts: 221
Joined: Tue Apr 24, 2012 11:54 am
Score: 1 Give a positive score

Re: A problem with a void function

Postby lverona » Fri Jan 25, 2013 10:07 am

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
lverona
 
Posts: 221
Joined: Tue Apr 24, 2012 11:54 am
Score: 1 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest