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 / How work SVAR's and READSETUPLINE?

Author
Message
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 25th Mar 2015 16:18 Edited at: 25th Mar 2015 16:20
I have a timer script. It started when I run a new game. I want to quit the game after my timer has maintained its value (I use two Vars for this - "hour" and "min").
How can I read the values stored in the setup.ini?

I changed the script a bit titlepage: (new game - resets the timer and starts a new game, load game - does not reset the timer and starts the game.)

My timer is always reset to 0. How does it work?

P.S. I'm trying it in built game.

Timer:


titlepage.fpi:


setup.ini [GAMEPROFILE]:


In written setup.ini 0:15 o'clock.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 25th Mar 2015 19:43
hukuta94
Are you just wanting a timer that counts down, then restarts the game after a countdown? I don't think I follow what you mean.
Also, is this a "preset" timer or user input?

My games never have bugs. They just develop random features..
Lots and lots of random features...
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 25th Mar 2015 20:06
ncmako
You do not understand. The timer counts up. For example, I was playing 1 hour 15 minutes. I left the game. My time is preserved in the setup.ini. Then again, I run the game to continue. The timer should show 1:15. But the timer does not read variables from setup.ini.

How to read variables from setup.ini?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 26th Mar 2015 16:54 Edited at: 26th Mar 2015 16:56
hukuta94
I just realized, some of this code is from the GUI-X9.exe.
I never really used it much, and there wasn't much documentation
for it either. I made a timer that counts up using the "dimvar=x" and works good, with minutes and seconds.
Here is some of it...

The only problems I ran into with this was saving.
If I used only the seconds variable it saved & reloaded
fine where I left off. If I used both variables (sec & min's)
it did not save properly? I'll play a little with it and see
if I come up with a solution.
best

My games never have bugs. They just develop random features..
Lots and lots of random features...
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 26th Mar 2015 18:33 Edited at: 26th Mar 2015 18:40
ncmakothank you, but I made myself. and it works!

I understand how it works:

1) Each time you run the menu, you need to create these variables (makesvar = 0 TimeHour GameHour, makesvar = TimeMin 0 GameMin)
2) Now you need to download them from the setup.ini (readsetupline = TimeHour GameHour, readsetupline = TimeMin GameMin)
3) Now you can use variables!
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 26th Mar 2015 18:39
now I have a new problem. After I made the GUI menu commands, pause the game was not working. Pause switch, but I can not move the cursor and press the button. What did I do wrong? Pause on and off without any problems.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 26th Mar 2015 18:47
hukuta94
Great! Glad you got it working
As for the GUI-X9 commands I can tell you a lot of people had problems getting it to work properly in the past.
I will play with it tonight a little bit and see if "pause game" works for me.
best

My games never have bugs. They just develop random features..
Lots and lots of random features...
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 27th Mar 2015 03:49
ncmako
looking forward to a response
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 27th Mar 2015 05:52
hukuta94
Played with GUI-X9 a bit and got it working. Made a new menu and
applied toa game. The "pausegame" is working fine for me.
Repeated the "pause" several times and saved games, unpaused
and the game was fine. Did not see any problems with it.
Using V1.20_1.14

My games never have bugs. They just develop random features..
Lots and lots of random features...
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 27th Mar 2015 06:58
ncmako, hm. I use unoff. path by s4real.

v1.20.19_beta_v1.20 final e
http://forum.thegamecreators.com/?m=forum_view&t=208795&b=21

Can you download your test game?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 27th Mar 2015 14:30 Edited at: 27th Mar 2015 16:11
hukuta94
Sure, are you using the "escape" key or command like "pausegame"?
I was using just the "escape" key to pause.

edit: strike that hukuta. after several more attempts to
apply the GUI-X9 menu to a game it does not seem to
work anymore. V1.20_1.14 & v1.20.19_beta_v1.20 final e.
Worked fine for one build, now it doesn't?
I did notice some elements for the menu did not transfer
correctly over to the build (like loading bar..ect)
Will look into further....sorry

My games never have bugs. They just develop random features..
Lots and lots of random features...
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 29th Mar 2015 21:41
ncmako
I using default "setuplevel.fpi" by fpsc standart and by GUI-X9. Both doesn't work.

This is very strange
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 30th Mar 2015 09:15
Eureka! Works! Important notes:

If you use the GUI in your game, then GUI should be used everywhere:
1) Main Menu
2) loading screen
3) Pause the game
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 30th Mar 2015 10:22
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 30th Mar 2015 16:52
hukuta94
That's awesome I see you got the loading bar to work also.
Which FPSC version exactly did you use to get this to work?
Looks really good hukuta!
Quote: "If you use the GUI in your game, then GUI should be used everywhere"

I thought that was what I was doing, but apparently not? I'll
have to look over it again.
best

My games never have bugs. They just develop random features..
Lots and lots of random features...
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 30th Mar 2015 17:40
ncmako
Quote: "I use unoff. path by s4real.

v1.20.19_beta_v1.20 final e
http://forum.thegamecreators.com/?m=forum_view&t=208795&b=21
"


Thank you for your comments
Mriganka
10
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 30th Mar 2015 19:28
Would you mind posting some sort of a sample code? It would really help me understand GUIX9.

hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 30th Mar 2015 20:09 Edited at: 30th Mar 2015 20:09
Mriganka
I took a standard gui script as a base, then I edited for me. In my script has a lot of added variables.

title page:


setuplevel:


loading page:

ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 30th Mar 2015 20:36 Edited at: 30th Mar 2015 20:40
hukuta94
Quote: "If you use the GUI in your game, then GUI should be used everywhere"

I think I got it working finally. Applied GUI-X9 to all. But I noticed a lot of differences with yours and mine. Mine uses "makehud=" where yours has "hudreset="
Did your manually rewrite it or did GUI-X9 write it for you
that way?
Here a snippet of my "setuplevel"


My games never have bugs. They just develop random features..
Lots and lots of random features...
hukuta94
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location: Russian Federation
Posted: 30th Mar 2015 21:28
"hudreset" it is status of ammo count, lives etc.
I got to make it work, and it works for me

Login to post a reply

Server time is: 2024-11-23 09:30:56
Your offset time is: 2024-11-23 09:30:56