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
4 registered members (AndrewAMD, TipmyPip, NewbieZorro, Grant), 14,196 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 2 of 2 1 2
Re: [Newton] Levelchange / .cls problem [Re: Josh_Arldt] #46347
06/20/05 07:45
06/20/05 07:45
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
DS Kihaku has mentioned the following:

wait(3);
level_load(s_level);
wait(1);

The wait(3) BEFORE the level_load solve his problems.
If I have time today I´ll play around a little, too.


no science involved
Re: [Newton] Levelchange / .cls problem [Re: fogman] #46348
06/20/05 07:56
06/20/05 07:56
Joined: Jan 2003
Posts: 1,142
California
Daedelus Offline OP
Senior Developer
Daedelus  Offline OP
Senior Developer

Joined: Jan 2003
Posts: 1,142
California
Quote:

The wait(3) BEFORE the level_load solve his problems



I have tried that also. Didn't work for me.
My main level works just fine. Its just the others that I change to.


Formula Games - A place to buy and sell Indie games.
Re: [Newton] Levelchange / .cls problem [Re: Daedelus] #46349
06/20/05 08:50
06/20/05 08:50
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
I´ve played a little, this one works for me.

==================================================

string level_str = <testlevel.wmb>;
string level_str_2 = <testlevel_2.wmb>;
string newtonLevel_cls = <testlevel.cls>;
string newtonLevel_cls_2 = <testlevel_2.cls>;

function main()
{
freeze_mode = 1;
warn_level = 2;
wait(3);
level_load(level_str);
wait(1);
dll_handle = newtonHandle;
NewtonAddMap (level_str, splashscreen);
wait(3);
freeze_mode = 0;
mouse_mode = 1;
mouse_pointer = 1;
mouse_range = 1000;
while(1)
{
mouse_pos.x = POINTER.x;
mouse_pos.y = POINTER.y;
wait(1);
}
}

function levelchange
{
freeze_mode = 1;
warn_level = 2;
wait(3);
level_load(level_str_2);
wait(1);
dll_handle = newtonHandle;
NewtonAddMap (level_str_2, splashscreen);
wait(3);
freeze_mode = 0;
}

on_space = levelchange;

======================================================

I hope this is a part of what you need.

greets, fogman


no science involved
Re: [Newton] Levelchange / .cls problem [Re: fogman] #46350
06/20/05 20:21
06/20/05 20:21
Joined: Jan 2003
Posts: 1,142
California
Daedelus Offline OP
Senior Developer
Daedelus  Offline OP
Senior Developer

Joined: Jan 2003
Posts: 1,142
California
Thanks fogman,
Your method definitely works for an on_key method.
Whats strange though is if I assign a player impact action to an invisible entity calling your function, the objects fall through the floor in the next level.



Formula Games - A place to buy and sell Indie games.
Re: [Newton] Levelchange / .cls problem [Re: Daedelus] #46351
06/20/05 20:51
06/20/05 20:51
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany


Sorry, it´s to late for me now, but be sure, tomorrow I´ll take a look.
I want to learn as much as possible about the 3dgs Newton version,
so it´s helpful for me, too


no science involved
Re: [Newton] Levelchange / .cls problem [Re: fogman] #46352
06/21/05 15:28
06/21/05 15:28
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Now I´ve the same problems. It falls
trough the floor after level load.

I play a little with it.

[edit]

Duuhh, it´s a bit "spagetthicode", but it works.

The theory: Events calling functions in another kind as key-assigns...
Look at the manual at events.
When I was reading that, another way to call the function came into my mind...

I´ve an action on an entity, by an impact it calls a function.
This function set a variable to 1.

Another function, it´s called by main(), contains a while loop.
It´s checking if the variable is set to one.

--> while(variable == 0){wait(1);)

After that comes the new level load.

So you must call the level load indirectly, not with an event....

I hope you understand that all

Last edited by fogman; 06/21/05 20:05.

no science involved
Re: [Newton] Levelchange / .cls problem [Re: fogman] #46353
06/22/05 09:36
06/22/05 09:36
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Hi Daedelus, you dont understand my germlish, so I try to explain it
with code...

//===============================================
string level_str = <testlevel.wmb>;
string level_str_2 = <testlevel_2.wmb>;
string newtonLevel_cls = <testlevel.cls>;
string newtonLevel_cls_2 = <testlevel_2.cls>;

var impact_active = 0; // you´ll need this variable to check the event - call

// Here´s my main():

function main()
{
freeze_mode = 1;
warn_level = 2;
wait(3);
level_load(level_str);
wait(1);
dll_handle = newtonHandle;
NewtonAddMap (level_str, splashscreen);
wait(3);
freeze_mode = 0;
mouse_mode = 1;
mouse_pointer = 1;
mouse_range = 1000;
levelchange(); // The levelchange must be called in main()
while(1)
{
mouse_pos.x = POINTER.x;
mouse_pos.y = POINTER.y;
wait(1);
}
}
//=========================

//Here is the action of my levelchange entity:

action impact_test
{
while(player == null){wait(1);}
my.enable_impact = on;
my.event = impact_event;
}

//=========================

//On impact, this event is called:

function impact_event
{
if(impact_active == 1){return;} // is the value of the variable "one" ? Then return.
impact_active = 1; // if not, then now the value is "one".
}
//============================

//The levelchange function checks the value
//of the variable:

function levelchange
{
while(impact_active == 0){wait(1);} // Here it´s checking, after that begins the level load
sleep(3);
freeze_mode = 1;
warn_level = 2;
wait(5);
level_load(level_str_2);
wait(3);
dll_handle = newtonHandle;
NewtonAddMap (level_str_2, splashscreen);
wait(5);
freeze_mode = 0;
mouse_mode = 1;
mouse_pointer = 1;
mouse_range = 1000;
}
//===================================

So you don´t call the function directly with the event.

You use a variable as "switch" to turn the levelchange
function "on".

You´ve to call your levelchange function at gamestart
and it´ll wait until the variable is set to 1.

greets, fogman

Last edited by fogman; 06/22/05 09:39.
Re: [Newton] Levelchange / .cls problem [Re: fogman] #46354
06/22/05 20:31
06/22/05 20:31
Joined: Jan 2003
Posts: 1,142
California
Daedelus Offline OP
Senior Developer
Daedelus  Offline OP
Senior Developer

Joined: Jan 2003
Posts: 1,142
California
Thanks Fogman,
Sent ya a pm.
Can't wait to test this out when I get home


Formula Games - A place to buy and sell Indie games.
Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

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