how do i add this code to my script?

Posted By: mikaldinho

how do i add this code to my script? - 02/25/10 19:11

in my main script i want to place a script that changes the level when the main character collides into a certain block (like running into a time portal) i know it is a template i downloaded,but here is the code i want to add:

Code:
//This is a product of Joey Bee Productions.  Please include in credits.


bmap loading_lv = <blank.bmp>;  //Loading screen
panel loadingscreen {
	bmap = loading_lv;   //loading screen name
	flags = refresh,d3d;
}

function load_level()
{
	loadingscreen.pos_x = (screen_size.x - bmap_width(loading_lv))/2;  //centers loading screen
	loadingscreen.pos_y = (screen_size.y - bmap_height(loading_lv))/2;

loadingscreen.visible = on;  //displays loading screen	
wait(3);
wait(-2);
loadingscreen.visible = off;  //clears screen
bmap_purge(loading_lv); 
LOAD_LEVEL <-->levelname<-->;  //level name 
  
}}


ACTION levelchange //*assign this to a map entity blocking the way out of the level*/!!!!
{

MY.INVISIBLE = ON;       //makes entitie invisible
MY.ENABLE_IMPACT = ON;   //enables player impact
MY.EVENT = load_level;  //function name

}




if you could tell me how to include this into my main script i would be thankful.

regards,
michael
Posted By: aztec

Re: how do i add this code to my script? - 02/25/10 20:05

wheres the problem?
just put this code into your current script or use the "include" command <- didnt script for long so I dont know how it actually works just look it up in the dictionary.

Second thing you do is go to WED give the time-portal the action " levelchange" take you player and move it into the portal.

Just modify the script the way you want it wink

regards

Aztec
Posted By: mikaldinho

Re: how do i add this code to my script? - 02/26/10 17:06

thanks aztec- it is just i have never scripted a levelchange code before, so i wont know what to do exactly.

thanks again,
michael.
Posted By: aztec

Re: how do i add this code to my script? - 02/26/10 17:13

yeah well I dont blame you for doing this at first but I now noticed that this may be the wrong forum.
I also asked this questions when I was new here.
So you might post it into the scripters-beginner section they are on top of the forum I think (Lite-C /C-script / Wdl)

regards

Aztec
Posted By: rvL_eXile

Re: how do i add this code to my script? - 02/26/10 17:17

Sleep(2); is old syntax, please use wait(-2); for this!

cYa Sebastian
Posted By: mikaldinho

Re: how do i add this code to my script? - 02/26/10 17:45

thanks for the little update- i will edit it in the copy i have on my computer and edit the copy in the code box.
© 2024 lite-C Forums