-->Game Cache<-- need help

swe_suffer

New Member
Reaction score
20
... Just take a look. Can any1 see whats wrong? ...
Code:
save
    Events
        Player - Player 1 (Red) types a chat message containing -save  as A substring
    Conditions
    Actions
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Triggering player) Equal to (Player((Integer A)))
                    Then - Actions
                        Game Cache - Store Hero[(Integer A)] as (Substring((Entered chat string), 7, 8)) of (Name of (Triggering player)) in Save_game_cache
                        Set current_gold[(Integer A)] = ((Player((Integer A))) Current gold)
                        Game Cache - Store current_gold[(Integer A)] as ((Substring((Entered chat string), 7, 8)) + GOLD) of (Name of (Triggering player)) in Save_game_cache
                        Game Cache - Save Save_game_cache
                        Game - Display to (Player group((Player((Integer A))))) for 20.00 seconds the text: (|cff00FF00Game Saved!|r  + (Hero (Level |cffFFFF00 + ((String((Level of Hero[(Integer A)]))) + (|r)  + ( and  + ((String(current_gold[(Integer A)])) + (was saved in slot: |cffFFFF00  + ((Substring((Entered chat string), 7, 8)) + |r. Please take a print scree
                    Else - Actions
                        Do nothing

And this:

Code:
load
    Events
        Player - Player 1 (Red) types a chat message containing -load  as A substring
    Conditions
    Actions
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        hassaved[(Integer A)] Equal to 0
                        (Triggering player) Equal to (Player((Integer A)))
                    Then - Actions
                        Game Cache - Restore (Substring((Matched chat string), 7, 8)) of (Name of (Triggering player)) from Save_game_cache for (Player((Integer A))) at (Center of Check Race <gen>) facing 0.00
                        Set current_gold[(Integer A)] = (Load ((Substring((Entered chat string), 7, 8)) + GOLD) of (Name of (Triggering player)) from Save_game_cache)
                        Player - Set (Player((Integer A))) Current gold to current_gold[(Integer A)]
                        Game - Display to (Player group((Player((Integer A))))) for 10.00 seconds the text: (|cff00FF00Hero Loaded!|r A level |cffFFFF00 + ((String((Hero level of (Last restored unit)))) + (|r together with |cffFFFF00 + ((String(current_gold[(Integer A)])) + |r gold!))))
                        Set hassaved[(Integer A)] = 1
                    Else - Actions
                        Game - Display to (Player group((Player((Integer A))))) for 5.00 seconds the text: |cffFF0000ALREADY L...

The problem is when you load you dont get a hero... and yes:
Code:
Game Cache - Create a game cache from THE_NAME_OF_THE_CACHE.w3v

I hope is isnt "name of triggering player"...
It makes me MAD!:mad:
 

swe_suffer

New Member
Reaction score
20
Just one thing... this it worked when i changed substring to 123 but does any1 know how i can make it work whith a substring?
 
S

Sunny_D

Guest
i suggest you use the edit button next time... =p

anyway, as you compare trigger player with player 1 to 8, i assume that you should add more events to both triggers:

Code:
    Events
        Player - Player 1 (Red) types a chat message containing ... as A substring
        Player - Player 2 (Blue) types a chat message containing ... as A substring
        Player - Player 3 ....

because, in your current trigger, only player 1 can be the (triggering player)
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
i don't think it's for online becuz if it was ppl wouldn't have used the long way of making save load codes i guess it's just for single player...
 

BlackNerubia

New Member
Reaction score
12
Its basically the fact that you cant store online maps, but I've been thinking about it a lot and i was thinking about that problem with the expertise of all the Jass'ers on this forum theres probably a way to either make a external file or actually a mini server, eh just a thought anyways yeah its probably for offline
 
General chit-chat
Help Users

      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