Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Levelchange for lite-c? #282973
08/05/09 00:10
08/05/09 00:10
Joined: Jan 2004
Posts: 60
D
Deha Offline OP
Junior Member
Deha  Offline OP
Junior Member
D

Joined: Jan 2004
Posts: 60
Hi there!
Can somebody explain me how to write a simple Levelchange in lite-c? I only found a script for C-Script.It would be nice if an image would appear during the levelchange.

Hallo!
Kann mir jemand vielleicht erklären, wie ich einen Levelwechsel in Lite-C hinbekomme? Ich habe nur ein Script in C-script finden können.
Schön wäre es,wenn zwischen dem Levelwechsel ein Bild kurz angezeigt werden könnte.

Last edited by Deha; 08/05/09 00:11.
Re: Levelchange for lite-c? [Re: Deha] #282975
08/05/09 00:53
08/05/09 00:53
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
hi, you will need to use the "level_load" function to load a new level. While this level is loading you can show a loading bar or image. To do this look at the "on_level" event in the manual.

It gets a percentage value and so you can show your image until the value is 100.

Re: Levelchange for lite-c? [Re: Deha] #282982
08/05/09 03:14
08/05/09 03:14
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline
Serious User
Nowherebrain  Offline
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Try this...

set the action in WED to an object "trigger", when you collide with it it will call the function "level_event".
Code:
var load_level
function level_event()
{
	load_level = 1;
	if(load_level == 1)
	{
		if(level < 4 && level != 0) //3 is the maximum level created
		{
			level += 1;
			if(level == 1)
			{
				level_load("thruster1.wmb");
				wait(3);
			}
			if(level == 2)
			{
				level_load("thruster2.wmb");
				wait(3);
			}
			if(level == 3)
			{
				level_load("thruster3.wmb");
				wait(3);
			}
		}
		else
		{
			//player x/z -385,-183
			level_load("thruster.wmb");
			level = 1;	
		}
		if(level == 0)
		{
			level_load("thruster.wmb");
			level += 1;		
		}
		load_level = 0; 
	}
}
action colider()
{
	my.emask |= ENABLE_IMPACT;
	my.event = impact_event;
	set(my,POLYGON);
}



Last edited by Nowherebrain; 08/05/09 03:16.

Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: Levelchange for lite-c? [Re: Nowherebrain] #283015
08/05/09 09:28
08/05/09 09:28
Joined: Jan 2004
Posts: 60
D
Deha Offline OP
Junior Member
Deha  Offline OP
Junior Member
D

Joined: Jan 2004
Posts: 60
Ok, thanks for your help,but it did not work for me..:-(
(sorry i'm a noob in lite-c)
I have paste this code under the mainfunction as a new action.
When i open Wed i can assign an entity the behaviour colider.
But when i try to start the level, an error message appears:

'Error in Main line 24: syntax error
< function level_event()
>'

What i have to do?
By the way...which position in the script must be changed in "my" wmp level?^^
Thanks for your help!

Re: Levelchange for lite-c? [Re: Deha] #283024
08/05/09 10:29
08/05/09 10:29
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Code:
var load_level

...

function level_event()
{
	load_level = 1;
	if(load_level == 1)
	{
		if(level < 4 && level != 0) //3 is the maximum level created
		{
			level += 1;
			if(level == 1)
			{
				level_load("thruster1.wmb");
				wait(3);
			}
			if(level == 2)
			{
				level_load("thruster2.wmb");
				wait(3);
			}
			if(level == 3)
			{
				level_load("thruster3.wmb");
				wait(3);
			}
		}
		else
		{
			//player x/z -385,-183
			level_load("thruster.wmb");
			level = 1;	
		}
		if(level == 0)
		{
			level_load("thruster.wmb");
			level += 1;		
		}
		load_level = 0; 
	}
}
action colider()
{
	my.emask |= ENABLE_IMPACT;
	my.event = impact_event;
	set(my,POLYGON);
}



function main()
{
  ...
  level_event();
  ...
}



this order and calling...



but.. i rewrote it.. seems a bit more easier for a beginner ^^

Code:
function level_event(STRING* levelname)
{
	str_cat(levelname, ".wmb");
	level_load(levelname);
	wait(3);
	str_cmp(levelname, "");
}
action colider()
{
	my.emask |= ENABLE_IMPACT;
	my.event = impact_event;
	set(my,POLYGON);
}



function main()
{
	...
	level_event("Leveldatei");  // call level without "*.wmb" ending
	...
}



Last edited by Espér; 08/05/09 10:41.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Levelchange for lite-c? [Re: Espér] #283032
08/05/09 10:46
08/05/09 10:46
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
You forgot the breakpoint (;) in the variable "load_level".

Re: Levelchange for lite-c? [Re: Cowabanga] #283046
08/05/09 11:54
08/05/09 11:54
Joined: Jan 2004
Posts: 60
D
Deha Offline OP
Junior Member
Deha  Offline OP
Junior Member
D

Joined: Jan 2004
Posts: 60
It's me again!^^
Sorry that i cannot handle this by myself!
It's so nice that all of you want to help me. ;-)
I try to use the code for a beginner like me, but it did not work,too! :-(

Errormessage: 'impact event' undeclared identifier
<my.event = impact_event;
>

I think the best is i will show you what i've tried.
By the way...
'I've called my level coast'
...
#include '....c`'
/////////////////////////////////////////////////////////////////////////////////////////////////////

function level_event(STRING* Coast)
{
str_cat(Coast, ".wmb");
level_load(Coast);
wait(3);
str_cmp(Coast, "");
}
action colider()
{
my.emask |= ENABLE_IMPACT;
my.event = impact_event;
set(my,POLYGON);
}

function main ()
{
video_mode = 8; // 1024x768
video_depth = 32; // 32-Bit
video_screen = 1; // 1= Fullscreen

level_event("Coast");

handle = media_loop("rpg.mp3",NULL,60);

Where is my mistake?



Last edited by Deha; 08/05/09 11:55.
Re: Levelchange for lite-c? [Re: Deha] #283051
08/05/09 12:10
08/05/09 12:10
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
All Flags are declared as CAPS writers..

impact_event => needs to be => IMPACT_EVENT


here´s my levelloader ( from my jump´n run ).. perhaps it helps you:
Code:
var levelnum          = 0;
STRING* numgiver = "#10";

function loader(STRING* levelname, levelnum)
{
	if(levelnum != 0)
	{
		str_for_num(numgiver, levelnum);
		str_cat(levelname, "_");
		str_cat(levelname, numgive);
	}
	str_cat(levelname, ".wmb");
	level_load(levelname);
	wait(3);
	str_cmp(levelname, "");
	str_cmp(numgiver, "");
	levelnum = 0;
}

function main()
{
	...
	loader("Leveldatei", 1);  // call level without "*.wmb" ending. The number is the number of the level.
	                          // Just call the levelfile f.e.: Leveldatei_1.wmb, Leveldatei_3.wmb.
	                          // If you don´t need levelnumbers, let levelnum == 0
	...
}




Last edited by Espér; 08/05/09 12:10.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Levelchange for lite-c? [Re: Espér] #283148
08/06/09 03:09
08/06/09 03:09
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline
Serious User
Nowherebrain  Offline
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
odd....this

"my.event = impact_event;"
do you mean...
"if(event_type == EVENT_IMPACT)"
I'm reffering to caps btw.

works fine on my end...I have to get to work. I will actually work on this tonight....I never tested that code btw...sorry. I just thought it would be easy to understand for someone new.

Last edited by Nowherebrain; 08/06/09 03:11.

Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: Levelchange for lite-c? [Re: Nowherebrain] #283177
08/06/09 09:13
08/06/09 09:13
Joined: Jan 2004
Posts: 60
D
Deha Offline OP
Junior Member
Deha  Offline OP
Junior Member
D

Joined: Jan 2004
Posts: 60
So thanks all for your help!
Finally i have a code that not appears any error message!^^
It not worked yet, because i do not know how to start this event to load the second level.I think i have to test it in a player move and an object must assign a colider action,right?

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1