save by OS version

For questions about using Classic.

Post » Thu Aug 16, 2012 4:19 pm

is it possible to save file to specific place depending on what operation system it is running on?

I mean if it is windows vista save it to c: etc...
else save it to d:etc...

can i do that?
i tried sys info, but there is no condition for OS type
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Post » Fri Aug 17, 2012 1:55 am

The only way I can think of is to write a plugin for that purpose.
B
6
Posts: 27
Reputation: 404

Post » Fri Aug 17, 2012 9:26 am

Elyzius: is it hard to make it? how can i learn to make plugins?
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Post » Fri Aug 17, 2012 10:20 am

After long time of trying I figured out how to do it without plugins...

It is a bit wierdly made application, but it seems working :)
i tried it on windows 7 a windows XP and for not it works...

if anyone here will need it i uploaded it here:
www.datafilehost.com/download-b72e8381.html
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Post » Fri Aug 17, 2012 10:49 am

There's a far more easier way.

SysInfo provides the "Get OS version" expression (SysInfo.GetOS). It is a string containing a bunch of information, e.g.

"Windows XP (Professional), (Terminal Services in Remote Admin Mode), (Multiprocessor Free), (x86-32 Processor) v5.1 Build:2600 Service Pack: 3"

Well, of all that text, all you need is the internal version number, in this case "v5.1". You can get this converted to a number using:

float(mid(SysInfo.GetOS, find(SysInfo.GetOS, ") v") + 3, 3))

After that your conditons should compare against the version numbers. It's 5.1 for Win XP, 6.0 for Win Vista and 6.1 for Win 7

A list of the version numbering can be found here: http://www.gaijin.at/lstwinver.php

And here is an example cap, using the description above: osversion.cap
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Aug 17, 2012 11:37 am

The browser shouldn't really have direct access to the file system. Be careful that browsers don't all together block your game :)

I'm referring to JS not modifying files - not the basics of a browser accessing the cache etc.superkew2012-08-17 11:38:35
B
22
S
7
G
3
Posts: 189
Reputation: 4,270

Post » Fri Aug 17, 2012 12:11 pm

[QUOTE=superkew] The browser shouldn't really have direct access to the file system. Be careful that browsers don't all together block your game :)

I'm referring to JS not modifying files - not the basics of a browser accessing the cache etc.[/QUOTE]
This is the Construct Classic help section
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Aug 18, 2012 9:43 am

tulamide: fantastic! really much better than my cap :)
thanks much
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Post » Sat Aug 18, 2012 1:33 pm

Hahaha. #fail me
B
22
S
7
G
3
Posts: 189
Reputation: 4,270

Post » Wed Aug 22, 2012 11:36 am

I need to use same path for windows 7 and for windows vista. will it work if I will make this? (i would try it, but i have not windows vista)


system: is global variable osversion equal to 6.1
or
system: is global variable osversion equal to 6.0

just need to know if i am using "or" conditon right for this case,
thanks
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests