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 / Script won't work with build game

Author
Message
WilliamK
12
Years of Service
User Offline
Joined: 15th Feb 2012
Location: Brazil
Posted: 29th Feb 2012 21:14
Question, does levels share script variables? For instance, my second level works perfectly, but not if I play in the build game from Level 1 to 2. If I build the game with only level 2, the scripts works.

So, if they share variables, I guess I will have to rename a few things up, as I re-use some set of scripts that has variables on it.

Thanks for any tip!

www.William-K.com
www.Wusik.com
WilliamK
12
Years of Service
User Offline
Joined: 15th Feb 2012
Location: Brazil
Posted: 29th Feb 2012 21:15
Will test it out later tonight I guess...

www.William-K.com
www.Wusik.com
WilliamK
12
Years of Service
User Offline
Joined: 15th Feb 2012
Location: Brazil
Posted: 29th Feb 2012 21:36
Yup, if I duplicate the script files and rename the variables so they don't share from level 1 to level 2, it works!

But I still want to know if this is correct, so for the next level I rename and copy it once more.

Thanks!

www.William-K.com
www.Wusik.com
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 1st Mar 2012 03:06
Are you talking about global variables (ex: globalvar=50,setvar=1"), or using variable system where you can use dimvar (ex: "dimvar=stamina,setvar=stamina 50").

Now I am still using v1.17 but have the variable system from the v1.18 source ported into our source. I can use both the "globalvar" and "dimvar", since "dimvar" did not exist in v1.17.

Here is an example script I use the "globalvar" command. It is taken from our WW2 game where I pick up a flashlight and two variables are called upon.



Notice the "state=31" line--> that "globalvar" I assigned to track how many inventory items I have collected. Variable #2 will increase by 1 and at the end of the level, my globalvar=2 value totals 6. When I go into my level 2, the global variable resets to zero, so I had to create a script to set my global variables to the values I wanted to "continue" on.

Now on the other side we have the "dimvar" command. Here is an example script from a demo I created that allows us to traverse levels, picking up inventory from one level and taking to any level.



Now in this script I use the "dimvar" command to specify the variable to call upon, and set the value for that variable (state 1 and 2 lines). When I go to any other level, the value remains.

So in my two examples, here is what I can tell you:

* global variables reset at the start of each level

* variables using "dimvar" retain their values.

So depending on my development and whether I use global variables such as my first example or dimvar from my second, I also set a trigger to set the values to *where* they need to be for that development at that point.

**NOTE** This is based on taking the variable system from v1.18 source to add "dimvar and other variable commands" that v1.17 did not have originally.


Twitter: @NFoxMedia
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 1st Mar 2012 09:46 Edited at: 1st Mar 2012 09:48
dimvar does more (but i think its not intended), they remain in THE WHOLE BUILDGAME^^, means even when you restart the buildgame after playing it, the dimvar doesnt reset but still moves on. i recognized this using a leveltimer that doesnt reset between levels. played the game (using autosaves) and saw timer overruns the loadingtimes, won (timer at 538 seconds), started new game direct after and look at the leveltimer: 569 at GAMESTART???

so you also can use this for a playtime-value when you dont reset it in gameover and gamewon.fpi/levelsetup.ini

didnt look if it overruns getting out of the game.exe, but maybe its viral^^

Login to post a reply

Server time is: 2024-11-24 03:14:36
Your offset time is: 2024-11-24 03:14:36