Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / globalvars passing maps?

Author
Message
Omegamer
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: There
Posted: 14th Jul 2011 14:42
Hey guys I´m having a question today.
I want to make a game that need global variables to stay over different levels.
So as example I allow the player to carry up to 3 medipacks and if the player has only 1 or 2 he will have them if he passes to the next level.
My question is if globalvars are resetted at the start of a new level or not

<a target='_blank' href='http://imageshack.us/photo/my-images/20/omegamer.png/'><img src='http://img20.imageshack.us/img20/1126/omegamer.th.png' border='0'/></a>
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 14th Jul 2011 15:06
My understanding is that global variables are not reset over levels. I'll try and test this tonight.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
Omegamer
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: There
Posted: 14th Jul 2011 15:20 Edited at: 14th Jul 2011 15:21
Thanks would be nice.
I have no time to test it myself since I have lots of stuff to do so you´d really do me a favor

[img]http://img20.imageshack.us/img20/1126/omegamer.th.png[\img]
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 15th Jul 2011 08:11
OK i did my test and I can cofirm that the custom global variables (the ones you create using "dimvar") do get retained between levels. The standard global variables, however, do not.

By standard I mean the original global variables numbered 0 to 99 and accessed using "globalvar=". These are reset at the start of each level which, to me, if a bug. These were meant to be retained between levels I thought, so I'm going to raise a bug report on this.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
Omegamer
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: There
Posted: 15th Jul 2011 13:14
Thx for your help.
I will try my thing with the dimvar-commands if you want to know why I need it just mail me

http://img20.imageshack.us/img20/1126/omegamer.th.png

Login to post a reply

Server time is: 2024-11-24 06:55:56
Your offset time is: 2024-11-24 06:55:56