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
0 registered members (), 18,654 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
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 | 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