Gamestudio Links
Zorro Links
Newest Posts
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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AbrahamR), 717 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
changing levels #285772
08/20/09 00:35
08/20/09 00:35
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
i have problems with going from one level to another, when i finish one level and the new one is loaded i want the items, lives, power, etc keeps the account of the old level and i want it to set all over to 0 as is a new level
do i have to scrip the whole game in one script or i have to make separate scrips for each level?

Re: changing levels [Re: Funeral] #285802
08/20/09 09:09
08/20/09 09:09
Joined: Jul 2009
Posts: 16
E
episch Offline
Newbie
episch  Offline
Newbie
E

Joined: Jul 2009
Posts: 16
so when the new level start set the variablen from the player and stuff to 0
and i think you shout splitt you script into pices

Re: changing levels [Re: episch] #285951
08/21/09 17:32
08/21/09 17:32
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
ok but am not sure how to do that... any example to show me?

Re: changing levels [Re: Funeral] #285961
08/21/09 18:52
08/21/09 18:52
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Even if you split your script into pieces you can't run a script per level. When you split your script into individual files and add them using #include, the engine merges it into one.

Define your variables like this...

var ammo = 150;
var health = 100;
etc

and then when you load a new level with 'level_load' they will still be the same. If you want to reset them I would write a function to do that and then call that after level_load...

void ResetSettings()
{
ammo = 150;
health = 100;
}


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

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