Darkrevenger
New Member
- Reaction score
- 1
As mentioned in this thread http://www.thehelper.net/forums/showthread.php/158225 there is a system to save and load data for Warcraft 3 maps. The demo map attached also shows how you can make it save a hero, and has functions for saving reals, integers, strings and booleans.
However, it seems to me that using this system would cause desyncs in a multiplayer game, with alot of usage of GetLocalPlayer to set.. things... as shown below.
Could someone clarify on how this system works? I know that this requires localfiles to be enabled, but putting that aside this could be a useful way to read data from text files, which is something that I've always thought to be impossible.
However, it seems to me that using this system would cause desyncs in a multiplayer game, with alot of usage of GetLocalPlayer to set.. things... as shown below.
JASS:
function AddString takes integer Offset,string S,player P returns nothing
if GetLocalPlayer()==P then
if not SyncBool then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"|cffff0000Error|r: Data not allocated for this player")
return
elseif Offset<0 or Offset>8190 then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"|cffff0000Error|r: Incorrect offset on Add String function")
return
endif
call Preload("\")\ncall SetPlayerName(Player(15),\""+S+"\")\ncall SetPlayerTechMaxAllowed(Player(13),1,"+I2S(Offset)+")\ncall ExecuteFunc(\"Execute_STRING_DATA\")\n//")
endif
endfunction
Could someone clarify on how this system works? I know that this requires localfiles to be enabled, but putting that aside this could be a useful way to read data from text files, which is something that I've always thought to be impossible.