Skip to main content

News

Recent Posts

11
Script Support / Re: GetVersion Question
Last post by Fat Cerberus -
Hm, not sure what would have caused that.  I made a lot of changes to the internal rendering since 4.5, but none of those should have slowed it down, if anything the upgrade should have made things a lot faster. :(
12
Script Support / Re: GetVersion Question
Last post by Miscreant -
Off Topic: Now, with the update to miniSphere 4.8: the graphics are displaying very slow and player movement is no longer fluid.
13
Script Support / Re: GetVersion Question
Last post by Fat Cerberus -
That's interesting, Sphere 1.5 is apparently not normalizing the path.  It's been my experience with Sphere 1.5 that the string returned by GetCurrentMap() is relative to maps/, but for some reason you have an extra redundant ../maps/ component in there.  Strange.

In any case if you're just trying to get the filename, this will work regardless of what its directory path is:

Code: [Select]
GCM_SA = GCM_S[GCM_S.length - 1];
14
Script Support / Re: GetVersion Question
Last post by Miscreant -
I just updated miniSphere and GetCurrentMap is not returning the same value...
15
Script Support / Re: GetVersion Question
Last post by Fat Cerberus -
If you upgrade to 4.8.4 then you won't need the version check for this.

To answer the original question though, you were using GetVersion() correctly, it returns 2.0 for miniSphere and 1.5 for Sphere 1.5.  Note that in JS, 2.0 === 2, i.e. there is no concept of an integer type.
16
Script Support / Re: GetVersion Question
Last post by Miscreant -
ah, looking at my backup dir. I had installed miniSphere 4.5.11
17
Script Support / Re: GetVersion Question
Last post by Fat Cerberus -
No no, I meant the version number of the engine, not the API version.  Are you using 4.8.4 or an earlier version?
18
Script Support / Re: GetVersion Question
Last post by Miscreant -
Quickly drawing the version number to the screen... it is 2.
19
Script Support / Re: GetVersion Question
Last post by Fat Cerberus -
Which version of miniSphere are you using?  In the latest versions GetCurrentMap() should return exactly the same string in both engines.  I fixed a bug a few versions ago where it would return the full SphereFS path of the map file, so maybe that's the problem you're having.
20
Script Support / GetVersion Question
Last post by Miscreant -
I've come across some parts of my code that function in Sphere 1.5 and do not function in miniSphere.

I'm trying to get the code to function in both. I thought that maybe if I added in the GetVersion it would make the code functional again. However, since I added in the GetVersion part var CurrMap is returning as undefined in both Sphere & miniSphere.

Perhaps this is not the way GetVersion functions?

Code: [Select]
var GCM = GetCurrentMap();
var GCM_S = GCM.split("/");
var GCM_SA;
var CurrMap;

if (GetVersion() < 2.0)
{
GCM_SA = GCM_S[1];
}else{
GCM_SA = GCM_S[3];
}

CurrMap = GCM_SA.slice(0, -4);