- Joined
- Jun 9, 2013
- Messages
- 51
I am about to make a complex RPG game, where you have only one character who can use several "classes" (the boring mage, paladin etc.). This means you don't have more heroes to command at a time, but you can switch between Mage Mike and Assassin Mike at certain places (this has a system).
However, when I want to store my hero at the Game Cache, It seems that the cache is created well and it is loaded (gold and lumber transprt works) but my unit won't be created in the new map. Is there something about this? Perhaps I did something what I shouldn't?
Map1 (From):
[Create game cache, set variable Cache as "last created game cache", store gold, lumber, this works, okay.]
Game Cache - Store Hero_type(string variable) as Hero_type_str of Classes in Cache
Game Cache - Store (Entering unit) as Hero_type(string variable, same as above) of Classes in Cache
Unit - Remove (Entering unit) from the game
Game - Set the next level to Stratholme.w3x
Game - Save game as Game.w3z and change level to Stratholme.w3x (Skip scores)
In the second step (store Entering unit as HT) I use the variable because if I currently use villager, then Hero_Type variable contains "villager" and my hero will be saved as "villager". And this variable gets stored (Hero_type_str) and loaded into the other map to make Wc3 know which character I was using.
Map2 (to):
[create cache, set variable Cache as last created game cache, load gold and lumber]
Set STR_Hero_type = (Load Hero_type_str of Classes from Cache)
Game Cache - Restore STR_Hero_type of Classes from Cache for Player 2 (Blue) at (Center of MapSwap country FROM <gen>) facing 270.00
Set UNIT_Hero_selected = (Last restored unit)
Game Cache - Save CACHE_Cache
The seccond trigger runs 0.10 seconds after map initialization (perhaps I should change this, I saw a "map loaded" function).
Both "villager" units are exactly the same, I have copied it from the other map.
Btw still don't know how to upload triggers here, so if somebody could tell me the way I'd be thankful.
However, when I want to store my hero at the Game Cache, It seems that the cache is created well and it is loaded (gold and lumber transprt works) but my unit won't be created in the new map. Is there something about this? Perhaps I did something what I shouldn't?
Map1 (From):
[Create game cache, set variable Cache as "last created game cache", store gold, lumber, this works, okay.]
Game Cache - Store Hero_type(string variable) as Hero_type_str of Classes in Cache
Game Cache - Store (Entering unit) as Hero_type(string variable, same as above) of Classes in Cache
Unit - Remove (Entering unit) from the game
Game - Set the next level to Stratholme.w3x
Game - Save game as Game.w3z and change level to Stratholme.w3x (Skip scores)
In the second step (store Entering unit as HT) I use the variable because if I currently use villager, then Hero_Type variable contains "villager" and my hero will be saved as "villager". And this variable gets stored (Hero_type_str) and loaded into the other map to make Wc3 know which character I was using.
Map2 (to):
[create cache, set variable Cache as last created game cache, load gold and lumber]
Set STR_Hero_type = (Load Hero_type_str of Classes from Cache)
Game Cache - Restore STR_Hero_type of Classes from Cache for Player 2 (Blue) at (Center of MapSwap country FROM <gen>) facing 270.00
Set UNIT_Hero_selected = (Last restored unit)
Game Cache - Save CACHE_Cache
The seccond trigger runs 0.10 seconds after map initialization (perhaps I should change this, I saw a "map loaded" function).
Both "villager" units are exactly the same, I have copied it from the other map.
Btw still don't know how to upload triggers here, so if somebody could tell me the way I'd be thankful.