D
Dja Majista
Guest
Yeah, I'm kind of disappointed that I had to visit a forum for this but what can I say? I'm stumped. Right now, I'm working with a simple hero loading system between two levels, and I think I've mimicked the demo campaign almost exactly. But I get the same problem every time. I implemented a little troubleshooting system in here at the end of each level. Basically, I set it up so that the game displays a message telling me whether there are values stored in the cache or not. At the end of the first level it finds both the string that I stored as well as the unit. But on the second level, when I'm supposedly doing the same thing, it sees neither the string nor the unit. So my best guess is, that the game cache doesn't transfer over for whatever reason or I've just loaded the game cache improperly on the second map.
Keep in mind, I'm doing this on a campaign and the filename is David Campaign.w3n. I'm supposed to change that to .w3v when creating a game cache right right?
Keep in mind, I'm doing this on a campaign and the filename is David Campaign.w3n. I'm supposed to change that to .w3v when creating a game cache right right?
Code:
--Map1--
Name
Events
Player - Player 2 (Blue) types a chat message containing <Empty String> as A substring
Conditions
Actions
Game Cache - Create a game cache from David Campaign.w3v
Set Map1 = (Last created game cache)
Set Name = (Entered chat string)
Game Cache - Store (Entered chat string) as Name of Map1.w3x in Map1
FINAL Final Sequence
Events
Unit - A unit enters Flamestrike <gen>
Conditions
Actions
Game Cache - Store Protagonist as Protagonist of Map1.w3x in Map1
Game Cache - Store Muradin Bronzebeard 0019 <gen> as Muradin of Map1.w3x in Map1
Game Cache - Save Map1
Wait 2.00 seconds
If ((Protagonist is stored as a Unit of Map1.w3x in Map1) Equal to True) then do (Game - Display to (All players) the text: Unit stored properl...) else do (Game - Display to (All players) the text: Protagonist was NOT...)
Game Cache - Restore Protagonist of Map1.w3x from Map1 for Player 2 (Blue) at (Center of Last scene <gen>) facing 0.00
If ((Name is stored as a String of map1.w3x in Map1) Equal to True) then do (Game - Display to (All players) the text: Name stored properl...) else do (Game - Display to (All players) the text: Name not stored pro...)
Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
Game - Set the next level to Maps\Map2.w3x
--Map 2--
Map Initialization
Events
Map initialization
Conditions
Actions
Game Cache - Create a game cache from David Campaign.w3v
Set Map1 = (Last created game cache)
Trigger - Run Load characeter <gen> (checking conditions)
Load characeter
Events
Conditions
Actions
Game Cache - Reload all game cache data from disk
Game Cache - Restore Protagonist of Map1.w3x from Map1 for Player 2 (Blue) at (Center of Region 000 <gen>) facing 0.00
Game Cache - Restore Muradin of Map1.w3x from Map1 for Player 2 (Blue) at (Center of Region 001 <gen>) facing 0.00
Set Protagonist = (Last restored unit)
If ((Protagonist is stored as a Unit of Map1.w3x in Map1) Equal to True) then do (Game - Display to (All players) the text: --Protagonist exist...) else do (Game - Display to (All players) the text: Character was not s...)
If ((Name is stored as a String of map1.w3x in Map1) Equal to True) then do (Game - Display to (All players) the text: Name stored properl...) else do (Game - Display to (All players) the text: Name not stored pro...)