Gamestudio Links
Zorro Links
Newest Posts
How to select between IB accounts by script?
by Jack_Zodiac. 06/12/26 23:17
Zorro tutorial ideas?
by pr0logic. 06/12/26 13:36
Max Number of Strategies in /Strategy folder
by Martin_HH. 06/12/26 08:50
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
Z9 getting Error 058
by k_ivan. 06/10/26 14:38
ZorroGPT
by TipmyPip. 06/10/26 13:07
Z12 live performance
by alx. 06/09/26 20:42
Lapsa's very own thread
by Lapsa. 06/08/26 22:41
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (Quad, TipmyPip, pr0logic), 2,041 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
level change question #171158
12/04/07 21:49
12/04/07 21:49
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
hi, i created two levels and there is an entity which calls level_load on impact. but when the level_load is executed the current level disappears and the other is not appearing. only the skycube remains visible.

any ideas what could be wrong here?


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: level change question [Re: ello] #171159
12/05/07 05:09
12/05/07 05:09
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
your code?

Re: level change question [Re: Shadow969] #171160
12/05/07 07:26
12/05/07 07:26
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
well, nothing special:
Code:

action levelChange()
{
while(vec_dist(player.x,my.x)>64)
{
my.pan -= 3*time_step;
wait(1);
}
level_load(my.string1);
}


.. where entities string1 is set to the wmb name of the next level via weds propertie-tab


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: level change question [Re: ello] #171161
12/05/07 11:04
12/05/07 11:04
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
You should not load a level through a level entity.
Make an own function for that, because the action that loads the level will be terminated when it loads a level.
This should give you a start:

ENTITY* level_change_ent;

action level_changer()
{
level_change_ent = me;
}


function levelChange()
{
while(!levelchange_ent){wait(1);}
while(vec_dist(player.x,levelchange_ent.x)>64)
{
levelchange_ent.pan -= 3*time_step;
wait(1);
}
level_load(levelchange_ent.string1);
}

You should make this function as startup or start it in main(). Don“t start it through an action. Then it should work.


no science involved
Re: level change question [Re: fogman] #171162
12/05/07 11:42
12/05/07 11:42
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
thanks, gonna try this tonight:)

Re: level change question [Re: ello] #171163
12/05/07 19:39
12/05/07 19:39
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
sadly, that doesnt work...
the same thing happens as before. only the skycube is drawn and nothing more...

Re: level change question [Re: ello] #171164
12/05/07 20:17
12/05/07 20:17
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
ok, i found the problem, its not the way i used a level-entity, but the entity string seems to be the problem. if i write level_load("nextlevel.wmb"); it works fine...

edit:
if i use the following script it works. it seems that entity.string1 is already erased when the level_load is called:
Code:

STRING* nextLevel = "#100";

action ei()
{
str_cpy(nextLevel,my.string1);
set(my,PASSABLE);
while(!player) wait(1);
while(vec_dist(my.x,player.x)>50)
{
my.pan -= 5*time_step;
wait(1);
}
level_load(nextLevel);
}



Last edited by ello; 12/05/07 20:23.

www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.

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