That's pretty neat, but how would you go about doing something like this:I hope you realise that with the answer to your question you enter the async world, if you do that wrong you (or better the ones playing your map) will encounter desyncs.
One can do that with StringList in fdf. One creates a new Localized String which differes between the asset mode. I use "HD" or "SD" based on the current used asset mode:
You create 2 versions both writting to the same Key one with "HD" the other with "SD". One import both the one with "HD" marked as HD in asset manager, the other as SD. The 2 Files need to be imported with the same name. Then you create a toc file which loads the SD path, import that into the map and run it at map init or 0s. Now you Check if the Localized String is "SD" or "HD" and you now it.
That is done in the map attached to this post, if you test it in Reforged it will print "HD" and "1", In the other it prints "SD" and "2".
Would be better without having to create a custom Localized String, but I am not aware of such and don't wana search for it.
When I say "forced", I mean there is a setting on the world editor that requires players to be using classic or reforged. What you are describing is just using assets.@tulee i do my maps in classic and Play them in reforged with 6-7 other players mixed reforged and classic and there is never been a problem in 200 hosted games I don’t understand why you say forced if you do your map in reforged like I did in the beginning some models are invisible for classic players like dooads.. but if you use classic reforged players have automaticly the reforged models ( if not custom models)
Hmm, so I've never synced data before if that's what you mean, would it be a hassle if you showed me a simple example? In the meantime I'm going to try and get it to work.the result of my example is only known to oneself. one has to share it before it can be used by other players.
do
-- hook into Blizzards at 0.01s timerAction
local real = MarkGameStarted
function MarkGameStarted()
real()
local trigger = CreateTrigger()
local triggerAction = TriggerAddAction(trigger, function()
udg_AssetModeUsed[GetPlayerId(GetTriggerPlayer())] = BlzGetTriggerSyncData()
print(GetPlayerName(GetTriggerPlayer()),BlzGetTriggerSyncData())
end)
for index = 0, bj_MAX_PLAYERS - 1 do
BlzTriggerRegisterPlayerSyncEvent(trigger, Player(index), "AssetModeCheck", false)
end
BlzLoadTOCFile("war3mapImported\\AssetModeCheck.toc")
BlzSendSyncData("AssetModeCheck", GetLocalizedString("ASSET_MODE"))
-- clean up, 15s is arbitrary choosen, could be lower.
TimerStart(CreateTimer(), 15, false, function()
TriggerRemoveAction(trigger, triggerAction)
DestroyTrigger(trigger)
DestroyTimer(GetExpiredTimer())
end)
end
end
Thanks! This will definitely come in handy.It is not such a hassle, but unlike the other one it can not be done with one custom script line.
That Lua code runs at 0.01s loads the fdf files and uses BlzSendSyncData to tell the other players about the result. That SyncData is catched with a Trigger and events in that trigger one saves the send data to an array. Then one can read the Asset mode used by a player by reading that array.
Lua:do -- hook into Blizzards at 0.01s timerAction local real = MarkGameStarted function MarkGameStarted() real() local trigger = CreateTrigger() local triggerAction = TriggerAddAction(trigger, function() udg_AssetModeUsed[GetPlayerId(GetTriggerPlayer())] = BlzGetTriggerSyncData() print(GetPlayerName(GetTriggerPlayer()),BlzGetTriggerSyncData()) end) for index = 0, bj_MAX_PLAYERS - 1 do BlzTriggerRegisterPlayerSyncEvent(trigger, Player(index), "AssetModeCheck", false) end BlzLoadTOCFile("war3mapImported\\AssetModeCheck.toc") BlzSendSyncData("AssetModeCheck", GetLocalizedString("ASSET_MODE")) -- clean up, 15s is arbitrary choosen, could be lower. TimerStart(CreateTimer(), 15, false, function() TriggerRemoveAction(trigger, triggerAction) DestroyTrigger(trigger) DestroyTimer(GetExpiredTimer()) end) end end