Game Cache

salem

New Member
Reaction score
3
Just want to know if there's a way to save and load strings using the game cache in multiplayer maps?

For example if i host a map and store the string "Test 1" and save the game cache. If i host the map again some other time, will i be able to load the string i saved before ("Test 1")?

Apparantly, it works perfectly for singleplayer maps, but when i host the map in multiplayer mode, it suddenly stops working...

I searched the forums for "store string" found many things, most include jass coding which i know nothing about. Everything that i found however had to do with storing units, but i need something much simpler, i just want to store strings.
 

SFilip

Gone but not forgotten
Reaction score
634
lets just say that one map cannot use the same cache twice in multiplayer...as far as i know that is.
 

Lobster

Old Fogey ofthe site
Reaction score
90
They are called save/load codes, just type in save and you wil see some posts on it.
 

salem

New Member
Reaction score
3
Lobster said:
They are called save/load codes, just type in save and you wil see some posts on it.

i looked over these as well, but they are all about saving/loading heroes or units. And I'm not exactly sure how they work, but i don't think that they load your hero from nothing.

Like from what i understood without spending a good 20 min reading the whole thing, the save/load codes will simply give you a code to use so you can load your hero with all his items. The code describes your hero and the items he has so that when you enter the code in the next game, you think that you "loaded" the hero but you actually made one with exactly the same items/proprieties of the hero you saved.

anyhow back on the subject. The triggers that i have work perfectly in singleplayer maps, and i know that they do not work in multiplayer maps, so i just wanted to know if there's a way around it.
 

SFilip

Gone but not forgotten
Reaction score
634
the only way to do something like that is, as mentioned, using load/save codes.
i dont see what is wrong with creating the unit again...yet the problem is to create a good save/load system but when you do its all ok.
 

salem

New Member
Reaction score
3
SFilip said:
the only way to do something like that is, as mentioned, using load/save codes.
i dont see what is wrong with creating the unit again...yet the problem is to create a good save/load system but when you do its all ok.

nono, i don't want to save or load units. i just want to save and load strings, texts.
 

SFilip

Gone but not forgotten
Reaction score
634
oh...that makes it simple at least.
you encrypt strings easily and turn them intro integers for example this way:
a=2
b=4
c=6
etc.
pretty complex though so you might aswell post what you need exactly.
 

salem

New Member
Reaction score
3
okay, well i'm trying to make an auto suggestion system, where the players are able to leave their comments simply by typing a chat command:
for example, "-suggest" is the chat command that triggers the system "-suggest I really like this map, however i think that you should..."
So what i did after is, i stored what the players said using the chat command in a quest tab so i can view it easily.

In singleplayer everything works perfectly, the strings and can be easily stored and loaded so you would have a list of comments left by all the players who used the "-suggest" function.

In multiplayer... you can't load anything from game cach.
I've found a way to counter it, but it ain't that pretty... Now sinse the whole point of my system is to give players an easy way to send me feedbacks, knowing that most of them will not bother going to a website or sending an email, my system will allow the player to leave a comment in-game and view the comments of others.

So what i've done to counter this multiplayer malfuntion of game cache is, after the end of each game, i would save the game, i would then load it and view the comments that the players left which are stored in a quest tab "F9".

Here's a copy of the triggers i used (not sure if these would help or not).


This is what controls the "-suggest" command.
Code:
Enter Suggestion
    Events
        Player - Player 1 (Red) types a chat message containing -suggest as A substring
        Player - Player 2 (Blue) types a chat message containing -suggest as A substring
        Player - Player 3 (Teal) types a chat message containing -suggest as A substring
        Player - Player 4 (Purple) types a chat message containing -suggest as A substring
        Player - Player 5 (Yellow) types a chat message containing -suggest as A substring
        Player - Player 6 (Orange) types a chat message containing -suggest as A substring
        Player - Player 7 (Green) types a chat message containing -suggest as A substring
        Player - Player 8 (Pink) types a chat message containing -suggest as A substring
        Player - Player 9 (Gray) types a chat message containing -suggest as A substring
        Player - Player 10 (Light Blue) types a chat message containing -suggest as A substring
        Player - Player 11 (Dark Green) types a chat message containing -suggest as A substring
        Player - Player 12 (Brown) types a chat message containing -suggest as A substring
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Length of (Entered chat string)) Greater than or equal to 30
            Then - Actions
                Trigger - Run Check quest description length <gen> (checking conditions)
                Game Cache - Store (Player_Color[(Player number of (Triggering player))] + (  + (Entered chat string))) as Comment of Suggestions in Cache
                Game - Display to (Player group((Triggering player))) the text: (Thank's for your comment: " + ((Entered chat string) + ".))
                Set Suggestions_quest_description[Suggestions_quest_number] = (Suggestions_quest_description[Suggestions_quest_number] + (  + (Load Comment of Suggestions from Cache)))
                Game Cache - Store Suggestions_quest_description[Suggestions_quest_number] as (Comment + (String(Suggestions_quest_number))) of Suggestions in Cache
                Game Cache - Save Cache
                Quest - Change the description of Suggestions_quest[Suggestions_quest_number] to Suggestions_quest_description[Suggestions_quest_number]
                Quest - Flash the quest dialog button
            Else - Actions
                Game - Display to (Player group((Triggering player))) the text: Minimum suggestion ...


Since i'm storing all the suggestions in a quest tab, and the quest tabs have limited space, I need to verify that the quest tab is not full or the game would crash when i try to store more strings in it. If the quest tab is full, this trigger will make a new one and give it a different number.
Code:
Check quest description length
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Length of Suggestions_quest_description[Suggestions_quest_number]) Greater than or equal to 1827
            Then - Actions
                Set Suggestions_quest_number = (Suggestions_quest_number + 1)
                Game Cache - Store Suggestions_quest_number as quest_number of Suggestions in Cache
                Game Cache - Save (Last created game cache)
                Quest - Create a Optional quest titled (Suggestions ( + ((String(Suggestions_quest_number)) + ))) with the description Suggestions_quest_description[Suggestions_quest_number], using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
                Set Suggestions_quest[Suggestions_quest_number] = (Last created quest)
            Else - Actions


This creates the Game Cach and loads the important variable that all game cache variables depend upon "Suggestions_quest_number".
Code:
Create and load Game Cach
    Events
        Map initialization
    Conditions
    Actions
        Game Cache - Create a game cache from Footman.w3v
        Set Cache = (Last created game cache)
        Set Suggestions_quest_number = (Load quest_number of Suggestions from Cache)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Suggestions_quest_number Equal to 0
            Then - Actions
                Set Suggestions_quest_number = 1
            Else - Actions
        For each (Integer A) from 1 to Suggestions_quest_number, do (Actions)
            Loop - Actions
                Set Suggestions_quest_description[(Integer A)] = (Load (Comment + (String((Integer A)))) of Suggestions from Cache)
        Game Cache - Save Cache


This will allow me to clear the game cache
Code:
Clear Cache
    Events
        Player - Player 1 (Red) types a chat message containing -clear as A substring
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Name of (Triggering player)) Equal to namegoeshere
               
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Entered chat string) Equal to -clear suggestions
            Then - Actions
                Game Cache - Clear all labels of Suggestions in Cache
                Game Cache - Save Cache
                Game - Display to (Player group((Triggering player))) the text: Cache "Suggestions"...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Entered chat string) Equal to -clear cache
            Then - Actions
                Game Cache - Clear Cache
                Game Cache - Save Cache
                Game - Display to (Player group((Triggering player))) the text: Cache cleared.
            Else - Actions


And this is where i create the quests at the beginning of the map
Code:
Quest
    Events
        Time - Elapsed game time is 3.00 seconds
    Conditions
    Actions
        Quest - Create a Optional quest titled Votes with the description At the start of the..., using icon path ReplaceableTextures\WorldEditUI\DoodadPlaceholder.blp
        Quest - Create a Optional quest titled Units 1 with the description ----------Orcs:  Le..., using icon path ReplaceableTextures\WorldEditUI\Editor-Random-Unit.blp
        Quest - Create a Optional quest titled Units 2 with the description ----------Undead:  ..., using icon path ReplaceableTextures\WorldEditUI\Editor-Random-Unit.blp
        Quest - Create a Required quest titled Comments with the description To leave a comment,..., using icon path ReplaceableTextures\WorldEditUI\Editor-Random-Building.blp
        Quest - Create a Optional quest titled Advanced Features with the description The Shade unit, loc..., using icon path ReplaceableTextures\WorldEditUI\Editor-MultipleUnits.blp
        Quest - Create a Optional quest titled King of The Hill with the description KOTH stands for Kin..., using icon path ReplaceableTextures\WorldEditUI\Editor-MultipleUnits.blp
        Quest - Create a Required quest titled Heroes & Bounty with the description A hero's normal bou..., using icon path UI\MiniMap\MinimapIcon\MinimapIconGold.blp
        Quest - Create a Required quest titled Changes Beta3c with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes Beta3d with the description ------ Changes in B..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes v1.00 with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes v1.01 with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes v1.02 with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes v1.02a with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes v1.02b with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes v1.02c with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes v1.03 with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes v1.03b with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        Quest - Create a Required quest titled Changes v1.04 with the description -------- Changes in..., using icon path ReplaceableTextures\CommandButtons\BTNAcorn.blp
        For each (Integer A) from 1 to Suggestions_quest_number, do (Actions)
            Loop - Actions
                Quest - Create a Optional quest titled (Suggestions ( + ((String((Integer A))) + ))) with the description Suggestions_quest_description[(Integer A)], using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
                Set Suggestions_quest[(Integer A)] = (Last created quest)
        Quest - Flash the quest dialog button
 

salem

New Member
Reaction score
3
bumping this.
You don't need to find a solution, i just want to know if it is possible or not to know if i should keep the effort up or stop wasting my time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top