Compilation problem

Non-platform specific questions.

Compilation problem

Postby metal_pt » Thu Jun 21, 2007 3:57 pm

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.
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score

Postby makslane » Sun Jun 24, 2007 6:46 pm

Can you post the code?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby metal_pt » Sun Jun 24, 2007 8:46 pm

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
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score

Postby makslane » Sun Jun 24, 2007 11:46 pm

I need to see the game too.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby metal_pt » Mon Jun 25, 2007 12:11 am

Ok,

You can download it here.

Thanks once again.
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score

Postby makslane » Tue Jun 26, 2007 12:18 am

I will try fix the problem.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Game A Gogo » Tue Jun 26, 2007 2:26 am

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);
}
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby metal_pt » Tue Jun 26, 2007 10:11 am

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.
]v[eta[_ - Using GE since June, 15 2007
Currently using v1.3.8 Registered
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest