Please Help with multi-map game cache triggering

Argentine

New Member
Reaction score
2
Help with multi-map game cache triggering

The problem with the below trigger is it will not get you back to map 1 from map 2, i do not know what event and conditions to set for map 1 to justify loading the hero only if the hero came from map 2. If anyone knows how, please reply. thanks.

EDIT: Since the first time i posted asking for help with the below trigger, I have fixed parts of it, but I can not get the hero to come back into map 1 from map 2 without the original starting hero appearing still. How do i tell the game if i loaded a hero/then delete starting unit/else do nothing?

If it helps, this is how I got my trigger to work: Using the following triggers, all I had to do was:

A. Make sure all files of map 1 and map 2 were identical inside and outside of the campaign (sometimes when making campaign maps changes can get lost and it can get confusing if you saved the map in the campaign and out of it, or just one or the other. Make sure you check this.

and B. I made sure all of the names of the variables, categories, game cache references ect... all match perfectly (they are case sensitive) on both maps.

I will explain below how this trigger works but first you will need to make variables for your triggers to function properly. You need variables to refer to certain things which change as you play.

The variables you need are:
Variable name Variable Type Initial Value
gold - Integer (array not checked) 0 (default)
hero - Unit (array not check) -none-
heroname - String (array not checked) -none-
testcache - Game Cache (array not checked) -none-
---------------------------------------------------------------

These variables should be the same on all of your maps.

Now that you have your variables created. Here are all my new triggers:

Trigger:
  • create cache
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game Cache - Create a game cache from test1.w3v
      • Set testcache = (Last created game cache)
      • Game Cache - Save testcache


From this trigger, the first action will create a "game cache" which is a temporary file on your computer to store the information about your game. It is not yet saved on your hard drive.

The second action set the cache you just created with the first trigger as the variable I made called "testcache" (you can name the variable whatever you want). This now allows for us to simply use our variable in other triggers to refer to "testcache" as the cache we created.

The third action will save the game cache on to your hard drive, making it possible to load the information stored in the game cache after this current map has been closed. This is so we can bring our hero across to another map (this only works in single player games).

The next trigger simply saves your game. There is no "event" or "condition" because this trigger was told to run by another trigger's action.

Next I store the hero inside the game cache.
Trigger:
  • store hero
    • Events
    • Conditions
    • Actions
      • Game Cache - Store hero as player of heros in testcache
      • Game Cache - Save testcache
      • Trigger - Run save resources <gen> (ignoring conditions)


The first action will refer to a variable called "hero" (you must create this as a variable and set your hero to equal this variable in another trigger, i explain further down).

This trigger uses "Game Cache - store unit as label of category in "last created game cache"

I then have to change all the above underlined words (will be underlined on the trigger editor). I set these parameters to what I will refer to them as in all other triggers.

All category, label and "from game cache" in all triggers must use the same names when referring to themselves. They are case sensitive and this is crucial. If you save a hero as "player" of "heroes" in "testcache" you must always resotore "player" of "heroes" in "testcache". Be consistent.

The third trigger I use in the above trigger will cause another trigger to run immediatly and without checking conditions.

The next trigger simply saves your game. There is no "event" or "condition" because this trigger was told to run by another trigger's action.
My trigger runs the next trigger:

Trigger:
  • save resources
    • Events
    • Conditions
    • Actions
      • Set gold = (Player 1 (Red) Current gold)
      • Game Cache - Store gold as gold of resources in testcache
      • Game Cache - Save testcache
      • Trigger - Run save hero name <gen> (ignoring conditions)


Save resources:
Here we are saving player 1's gold amount.

The first trigger: That's pretty straight forward. It uses the variable we made called gold and sets that variable to whatever player 1's current gold is.

Second Trigger: This takes the variable we set player 1's gold to and saves it in our "game cache" temporary folder.

Third Trigger This saves the game cache file to the hard drive so we can later load it into another map.

Next we will save the name of our hero
The next trigger simply saves your game. There is no "event" or "condition" because this trigger was told to run by another trigger's action.

Trigger:
  • save hero name
    • Events
    • Conditions
    • Actions
      • Set heroname = (Proper name of (hero))
      • Game Cache - Store heroname as heroname of heros in testcache
      • Game Cache - Save (Last created game cache)
      • Trigger - Run goto map 2 <gen> (ignoring conditions)


The first trigger sets the variable we made called "heroname" as whatever the name of the hero is, since we set whichever hero we wanted to set as the variable "hero" in another trigger.
The other triggers have been explained above :)

The next trigger simply saves your game. There is no "event" or "condition" because this trigger was told to run by another trigger's action.

Trigger:
  • goto map 2
    • Events
    • Conditions
    • Actions
      • Game - Save game as testautosave.w3z and change level to Maps\test2.w3x (Skip scores)


This next trigger i made to be able to trigger leaving one map to goto another.

Trigger:
  • Trigger map 2
    • Events
      • Unit - A unit enters goto map 2 <gen>
    • Conditions
      • (((Entering unit) is A Hero) Equal to True) and (((Hero level of (Entering unit)) Equal to 4) and ((Owner of (Entering unit)) Equal to Player 1 (Red)))
    • Actions
      • Set hero = (Entering unit)
      • Trigger - Run store hero <gen> (ignoring conditions)


You can have the "event" and "conditions" be whatever you want them to be.
My trigger uses "entering a region" (this is a region set with the "region layer" screen on the terrain map.)

My condition is "the unit entering the region is a Hero AND is level 4 or higher AND is owned by player 1."

My first action then sets the entering unit as the unit that is stored as the variable "hero". This variable, as you know, is in other triggers and used to load this hero in the other maps.

The last trigger action:
"Trigger - Run store hero <gen>(ignoring conditions)" fires off the trigger sequence we programmed above.

And now here are my map 2 triggers


Before making the triggers, we have to remake all the exact same variables we made in the first map with the same names.

After the variables are made you have to actually create the game cache again, this time from the exact same file name as the first map, using the event "map initialization"
Trigger:
  • load cache
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game Cache - Create a game cache from test1.w3v
      • Set testcache = (Last created game cache)
      • Game Cache - Restore player of heros from testcache for Player 1 (Red) at (Center of come from map 1 &lt;gen&gt;) facing 0.00


First we made the game cache again.

Second action we use sets the variable to the game cache we made (we did this in the first map)

The third action will restore the hero we saved in map 1 at the specified point.

Next we'll load our gold amount from the first map.

Trigger:
  • load gold
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set gold = (Load gold of resources from testcache)
      • Player - Set Player 1 (Red) Current gold to gold


I used the "hashtable" trigger action to set the players "gold" variable to the same gold variable stored from the first map.

Second I used "player - set property" to set player 1's current gold to the amount from our variable.

Next we recall the hero's proper name:

Trigger:
  • heroname
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set heroname = (Load heroname of heros from testcache)


The above trigger action is a hashtable trigger again.

And here's the trigger I made for when I got frustrated (i took out my frustration on my hero) Im not going to explain these triggers, they are too simple and off topic:

Trigger:
  • nerd rage
    • Events
      • Player - Player 1 (Red) types a chat message containing WTFDIE as An exact match
    • Conditions
    • Actions
      • Unit - Create 50 Green Dragon for Neutral Hostile at (Position of Paladin 0001 &lt;gen&gt;) facing (Random angle) degrees

Thank you in advance for any and all insight!
 

Argentine

New Member
Reaction score
2
bump

bumping only because the entire basis of this post is different than when originally posted.
 

gutter

New Member
Reaction score
0
followed everything to a tee, but for some reason i cant find this trigger :-/
Game Cache - Save testcache
:banghead:
 

Argentine

New Member
Reaction score
2
You have to make a variable called "testcache" or whatever you want to call it.

The variable tpye is "game cache" and it is not an array.

Note that there are two sections of "game cache" to look in. they are seperated by some other triggers. it is called "Game Cache - Save Game Cache"
 

gutter

New Member
Reaction score
0
thanks for the reply. i checked both sections and still no luck...i even searched it. what else could be wrong? any ideas?
 

gutter

New Member
Reaction score
0
omg i got it now...did some reading and apparently i had to install 1.24d :nuts: sorry for wasting your time and thanks a bunch for your tutorial
 

J08

New Member
Reaction score
0
Baffled...

So im working on a multi map rpg and in my way is this lousy trigger to save my active hero, and load him with all stats etc. intact, into a new map. I've followed everything in the above tutorial perfectly double checked like 8 thousand times tried 3 other tutorials on the same topic and still i come out empty handed... can someone plz help me somehow...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • 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!

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top