on_level Not functioning?

Posted By: DarkWhoppy_

on_level Not functioning? - 03/07/08 03:51

Just wondering... But isn't on_level suppose to return the a percent of the current level being loaded? A7.07 Extra Edition...

I get nothing and I have it setup just like the manual...

Code:
  function Update_LoadingBar(percent)
{
if(Load_Bar.visible == on)
{
Load_Bar.scale_x = (percent / 100); //0.1 to 1.0 range
}
wait(1);
}
on_level = Update_LoadingBar;


Posted By: Dark_samurai

Re: on_level Not functioning? - 03/13/08 17:14

I guess you have to make it like this:

Code:

while(on_level < 100)
{
Load_Bar.scale_x = (on_level/100);
}



Don't overgive the value and don't use wait!

Dark_Samurai
Posted By: HPW

Re: on_level Not functioning? - 03/13/08 17:22

If you use Lite-C, then you must use "if (is(Load_Bar, VISIBLE)) {...}" instead of "if (Load_Bar.visible == on) {...}" and don't use the wait(1);

on_level is working in my Lite-C Project and I use the following code:
Code:

function eb_fnc_ladebalken(var v_percent)
{
eb_pan_ladebalken.size_x = maxv(integer((screen_size.x-40)/100*v_percent), 1);
}

on_level = eb_fnc_ladebalken;


Posted By: DarkWhoppy_

Re: on_level Not functioning? - 03/17/08 02:18

Well... I stopped messing with it because it wouldn't do anything no matter what I tried..

And just earlier when I was doing a test on my project ... the load bar actually worked.

Went from zero to 100 percent and started the game...

Sadly, I have no clue as to why it didn't work before. Although, maybe my PC loaded the level too fast because most data was stored in the memory from other tests? That might've been it... Who knows...
© 2024 lite-C Forums