Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
level changing #428770
09/02/13 22:14
09/02/13 22:14
Joined: Aug 2013
Posts: 78
Nottingham
DuaneDawson Offline OP
Junior Member
DuaneDawson  Offline OP
Junior Member

Joined: Aug 2013
Posts: 78
Nottingham
was just wanting to know how you level change.
was reading through the aum. and it says
when you do a level change things are not loaded into the next level.
so you have to write the script to add them to the next level.?

can I just make each level with the same main_function
and calling all the same includes.?
and load a different level.
when you reach a marker/model with a function, in the level when it is walked on so it change to the next level.?

if so how do I write the function.?


cheers

Re: level changing [Re: DuaneDawson] #428773
09/03/13 01:13
09/03/13 01:13
Joined: Nov 2005
Posts: 204
Bavaria
HellThunder Offline
Member
HellThunder  Offline
Member

Joined: Nov 2005
Posts: 204
Bavaria
You don't have to set every Entity by script, but you can. It is also possible to prepare levels with WED. A compiled WMB File does not really need a script file or a main function.
Just change the Map inside a function.

Use "level_load"...
Code:
level_load("yourmap.wmb");


...to change the map.

Something like a onTouchEvent (Just I call it like that wink )
Keyword here is " Event_Push".

It should look like this...
Code:
function level_Change() { 
	
	while(1){ 
	
		if(event_type == EVENT_PUSH){
			level_load("YourMap.wmb");
			wait_for(level_load);
			return;
		}	
		
		wait(1);
	}
}
action touch_Entity() { 
	my.emask = ENABLE_PUSH;
	my.group = 2;
	
	while(1){
		wait(1);
		my.event = level_Change; 
	}
}



Your Player must walk through the touch_Entity, which could be a Wall or something (do not Forget to activate the "INVISIBLE" flag in WED).

You Need to Change your movement code too.

Code:
Action Player(){
...
my.group = 2;
my.emask = ENABLE_PUSH;
...
}



And you Need to activate the right collision mode flag "IGNORE_PUSH".

Code:
Action Player(){
...
	c_move(my, nullvector, my.move_x, USE_BOX | IGNORE_PASSABLE | GLIDE | IGNORE_PUSH);...
}



Create your own JRPG and join our community: https://www.yrpgtoolkit.com
Re: level changing [Re: HellThunder] #428776
09/03/13 04:24
09/03/13 04:24
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
I would not set the event in a while loop btw.
Code:
action touch_Entity() { 
	my.emask |= ENABLE_PUSH;
         my.event = level_Change; 
	my.group = 2;
	
	while(1){
		wait(1);
	}
}

and emask needs |= not =


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: level changing [Re: rayp] #428785
09/03/13 08:26
09/03/13 08:26
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Quote:
I would not set the event in a while loop btw.

This is true since the event function is called every time the EVENT_PUSH occurs so you don't need the while loop.

Quote:
and emask needs |= not =

This is only partially correct. "|=" adds the event to the existing list of events and "=" sets the event list to (only) EVENT_PUSH.

Re: level changing [Re: PadMalcom] #428788
09/03/13 08:56
09/03/13 08:56
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Quote:
This is only partially correct. "|=" adds the event to the existing list of events and "=" sets the event list to (only) EVENT_PUSH
Youre right...maybe i was too tired ^^


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: level changing [Re: rayp] #428856
09/04/13 15:58
09/04/13 15:58
Joined: Aug 2013
Posts: 78
Nottingham
DuaneDawson Offline OP
Junior Member
DuaneDawson  Offline OP
Junior Member

Joined: Aug 2013
Posts: 78
Nottingham
hi I have done what you have said.
but when I walk into the wall I get this error message

malfunction w1511.

invalid call in event level_change

cheers

Re: level changing [Re: DuaneDawson] #428871
09/04/13 22:15
09/04/13 22:15
Joined: Aug 2013
Posts: 78
Nottingham
DuaneDawson Offline OP
Junior Member
DuaneDawson  Offline OP
Junior Member

Joined: Aug 2013
Posts: 78
Nottingham
ok I got it to work if it right. had to place a wait(1);
like this.

if(event_type == EVENT_PUSH){
wait(1);
level_load("YourMap.wmb");

cheers,

it seems to load the next level.

but its not showing the level, all I see is a blue screen.

im using the same main_function.
on level2 as in level1.
is this right?
do I need to set things up?

cheers

Re: level changing [Re: DuaneDawson] #428872
09/04/13 22:21
09/04/13 22:21
Joined: Aug 2013
Posts: 78
Nottingham
DuaneDawson Offline OP
Junior Member
DuaneDawson  Offline OP
Junior Member

Joined: Aug 2013
Posts: 78
Nottingham
ok just did another test and it dose load.
it just the camera dose not start at the player pos.

could you tell me how do I have the camera fixed to the player pos. all the time?

cheers

Re: level changing [Re: DuaneDawson] #428879
09/05/13 04:38
09/05/13 04:38
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Belongs to the code ure using. If u placed a player model in wed with a player action attached, simply place this model with the same action in your new level. In most cases this will solve the problem.


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;

Gamestudio download | chip programmers | 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