HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

WEU saveload code, storing into a variable, perhaps this is my mistake?

10-16-2006, 04:07 AM#1
Fr0zenLord
Hmm well, I was on TH.net a while ago, and got a minor question answered, and realized something, that perhaps my problem with setting my variable to the saveload code, was I did [GetPlayerId] instead of [GetConvertedPlayerId]

(For refering to a player)

would it matter? (Whats the diff)?

set udg_SaveLoadCode[GetPlayerId] = Final (The string for the code)
set udg_SaveLoadCode[GetConvertedPlayerId]?

Any difference?
10-16-2006, 05:57 AM#2
AceHart
AFAIR, you've been told to verify your indexes about two weeks or so ago...

Collapse JASS:
function GetConvertedPlayerId takes player whichPlayer returns integer
    return GetPlayerId(whichPlayer) + 1
endfunction


The difference is an "off by 1", which can, indeed, make all the difference.

If you set player 1's code at index 0 and try to read it at index 1,
or the other way around...
10-16-2006, 06:23 AM#3
Fr0zenLord
? not really, lolz I just did [GetConvertedPlayerId], it worked straight away