Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (1 invisible), 15,173 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
MaliceTheMaker, Haitao_Ren, JimSimons, julienp, julienper
19248 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