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 (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 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 | 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