Page 1 of 1

Compilation problem

PostPosted: Thu Jun 21, 2007 3:57 pm
by metal_pt
Hi!

I made a function that should create all the levels on my game.
The function works perfectly in "game mode". Unfortunately, when compiled, does not work, neither on PC nor PPC.

When I use the function's code instead of calling the function, it works perfectly, but that means I have to change the code wherever I call the function.

Any Ideas??

Best Regards,
Jorge Pinto

p.s. Sorry for my english.

PostPosted: Sun Jun 24, 2007 6:46 pm
by makslane
Can you post the code?

PostPosted: Sun Jun 24, 2007 8:46 pm
by metal_pt
Sure, here you go!

Code: Select all
void alllevels()
{
levelvars();
DestroyActor("bolab");
DestroyActor("bolar");
DestroyActor("bolag");
DestroyActor("estanha");
DestroyActor("bricks");
DestroyActor("bricks2");
stopSound(0);
CreateActor("neco", "normal", "(none)", "(none)", 175, 213, true);
if(level==1)
{
    CreateActor("bolar", "bola3", "(none)", "(none)", 220, 60, true);
    CreateActor("bolar", "bola3", "(none)", "(none)", 220, 60, true);
    makebrick(1,2,3,120,160);
    makebrick(1,2,3,150,160);
    makebrick(1,2,3,180,160);
    makebrick(1,2,3,210,160);
}else
    if(level==2)
    {
        CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
    }else
        if(level==3)
        {
            CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
        }else
            if(level==4)
            {
                 CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
            }else
                 if(level==5)
                 {
                     CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
                 }else
                     if(level==6)
                     {
                          CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
                     }else
                         if(level==7)
                         {
                             CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
                         }else
                             if(level==8)
                             {
                                 CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
                             }else
                                  if(level==9)
                                  {
                                      CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
                                  }else
                                      if(level==10)
                                      {
                                          CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
                                      }
CreateActor("ready", "ready2", "(none)", "(none)", 160, 120, true);
}


Thanks
Best regards

PostPosted: Sun Jun 24, 2007 11:46 pm
by makslane
I need to see the game too.

PostPosted: Mon Jun 25, 2007 12:11 am
by metal_pt
Ok,

You can download it here.

Thanks once again.

PostPosted: Tue Jun 26, 2007 12:18 am
by makslane
I will try fix the problem.

PostPosted: Tue Jun 26, 2007 2:26 am
by Game A Gogo
It would be a good idea also to shorten your code to this:

Code: Select all
void alllevels()
{
levelvars();
DestroyActor("bolab");
DestroyActor("bolar");
DestroyActor("bolag");
DestroyActor("estanha");
DestroyActor("bricks");
DestroyActor("bricks2");
stopSound(0);
CreateActor("neco", "normal", "(none)", "(none)", 175, 213, true);
if(level==1)
{
    CreateActor("bolar", "bola3", "(none)", "(none)", 220, 60, true);
    CreateActor("bolar", "bola3", "(none)", "(none)", 220, 60, true);
    makebrick(1,2,3,120,160);
    makebrick(1,2,3,150,160);
    makebrick(1,2,3,180,160);
    makebrick(1,2,3,210,160);
}else
    if(level>=2 && level<=10)
    {
         CreateActor("bolar", "bola1", "(none)", "(none)", 220, 60, true);
    }
CreateActor("ready", "ready2", "(none)", "(none)", 160, 120, true);
}

PostPosted: Tue Jun 26, 2007 10:11 am
by metal_pt
I understand your point Game a Gogo but each level will have different actors at different positions. It's only identical for testing purposes.
Thanks for your interest :)

Mak: update...

As far as I can see, it only crashes in the "startgame" actor.
Hope it helps :)
Thanks again for the great support you're offering.