Help with Custom Script "VersionGet" --- Version Detection

Trithilon-V2

New Member
Reaction score
20
Ok....
Guys..since there is no Variable for Version, i had to use a handle to denote it...
Now i need a custom script code to print the version or at the very least check if the host is using version 1.22a
Here is my first try at jass as well...

Code:
Version Detection
    Events
        Map initialization
    Conditions
    Actions
        Custom script:   local handle h
        Custom script:   set h = VersionGet()
        Custom script:   call DisplayTextToForce( GetPlayersAll(), H2S(h))
How ever it seems H2S doesnt exist....what should i do?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
VersionGet() returns a value of type "version", and can be compared to either VERSION_REIGN_OF_CHAOS or VERSION_FROZEN_THRONE.
That's about it.


JASS:
function H2I takes handle h returns integer
    return h
    return 0
endfunction

function H2S takes handle h returns string
    return I2S(H2I(h))
endfunction



> check if the host is using version 1.22a

What for?

And, showing text at map init is not a very good idea. It might have disappeared already by the time the game starts.
 

Trithilon-V2

New Member
Reaction score
20
Basically...i have come up with an a system called "Ultimate inventory system".
Its makes the Unit have 2 inventory pages instead of 1 (12 slots)
Gives stacking benifits of items in the bacground page. (Without using Bonus mod or stuff)
So you see its almost a ready to use system w/o the need for defining items.
However ver 1.22a is a prerequisite.....
Or else when you switch pages the items will lose cooldown.....
So how do i check if the version is 1.22a so that the system can be disabled if its not?

Also i am getting and Error while saving the map which says "Expected name" and highlights the line "set h = call VersionGet()"

I have pasted the code you wrote upthere in my custom script section.
My new code is :-

Code:
Version Detection
    Events
        Time - Elapsed game time is 3.00 seconds
    Conditions
    Actions
        Custom script:   local handle h
        Custom script:   set h = call VersionGet()
        Custom script:   call DisplayTextToForce(GetPlayersAll(),H2S(h))
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
Custom script: set h = call VersionGet()
Don't include call. It's just
set h = VersionGet()

And why aren't you using a local version?
JASS:
local version v = VersionGet()
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
Well, that helps his syntax problems, but not with the actual "problem" at hand.
There's just no way to determine the version.


If your map runs on "latest patch", you can have a look at some details of a unit that seen some change in the latest patch.
With any luck, it's something like max health or so that can be tested.

However, what maps actually run "latest"? With "default" being the default...
 

Trithilon-V2

New Member
Reaction score
20
I tried that too.....however....
In,the latest stuff are just two detectable changes,
1:- The Xp given by dryad
2:- Armor of Ziggurat
However both seem to bedependant as in what version was the map made rather than the client version....
However its not confirmed how it behaves...
can any one tell of a nice working way?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top