Game caches.. (how to store a unit? :S)

Potatisbil

New Member
Reaction score
6
ok...so i've tried using :
Code:
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to moo 
    Actions
        Game Cache - Store (Triggering unit) as Muu of Category in (Last created game cache)
        Game Cache - Restore Muu of Category from (Last created game cache) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 0.00
But it doesnt seem to work... can any kind soul out there help me? :>


My intention is to just to make a copy of a unit..

EDIT: i meant i want to make an exact copy of a Hero :p
 
P

Pawnable

Guest
.... why do game caches?

Code:
Actions
  Set unit[0] = Moo
  Set tempPoint = (Position of (Casting Unit))
  Unit - Create 1 unit[0] at tempPoint facing 0.0
  Set unit[0] = No unit
  Custom Script:     call RemoveLocation(udg_tempPoint)
 

jonadrian619

-___-
Reaction score
240
Game Caches? maybe you could read my thread about a full tutorial of making game caches. Search the World Edit Helpzone and look for 'game cache tutorial. That could help.


Maybe you could read this:

Game Cache Actions
Here are the actions of the Game Cache category which are shown in the trigger editor. To create a Game Cache action, click the New Action (Hotkey Ctrl+R) button and click a 'Game Cache - ' Action. Each action has useful details and examples.


Game Cache - Create Game Cache
- Creates a new Game Cache from a map. The Game Cache should be created from your map. Type the map filename in the 'MapName.w3v' field value and change it to your map's filename. The game cache should be from your map so that it's functions will work properly. If the map filename you have typed does not exist, the cache will be created.

Game Cache - Save Game Cache
- Saves the game cache, using the same filename from which it was created. If you use the Actions; Store Integer,Boolean, Unit, etc., then using the Save Game Cache action will save those objects and are available for restoration.

Game Cache - Store Unit
- Stores unit as a Label in a Category in an existing Game Cache. 2 ways to select a unit. First select a function like last created unit, picked unit, etc. Or to store a particular unit, select a unit in the map then use the unit's variable in the field (ex. Peon 0015 <gen>).
"Store Unit" Field Values
- Store Unit (The field wherein your selected unit will be stored) as Label (The unit's label in a category. You can type any) of Category (The category wherein the label will be saved) in (Last Created Game Cache). You can also change it's value like a Game Cache variable or simply last created game cache.

Game Cache - Store Real
- Same as 'Store Unit' but more different. You'll have to store a Real number this time. A Real number is a decimal (ex. 1.00, 1.25, 2.79, etc.).
"Store Unit" Field Values
- Same as the 'Store Unit' fields, but the object stored is a Real number this time. Also create individual categories for the values.

Game Cache - Store Integer
- Same as 'Store Unit' but much more different. You'll have to store an Integer this time. An Integer is a non-decimal or plain number. (ex. 1, 2, 3, 4, 5, etc.).
"Store Unit" Field Values
- Same as the 'Store Unit' fields, but the object stored is an Integer this time. Also create individual categories for the values.

Game Cache - Store Boolean
- Same as 'Store Unit' but much more different. You'll have to store a Boolean value this time. A Boolean value is a value that associates with events and conditions. (ex. 'A unit enters Region 001' then follows the condition 'Triggering unit is a Hero equal to True'. The Boolean value is set to true, so the unit that enters Region 001 should be a hero. If the condition is met, then the actions will be initiated).
"Store Unit" Field Values
- Same as the 'Store Unit' fields, but the object stored is an Integer this time. Also create individual categories for the values.

Game Cache - Restore Unit Facing Angle
- Restores a unit 'Label' from a created Category in a game cache. This action restores or loads a stored unit for a player in a region facing a particular facing angle. The angle is shown in degrees.

Game Cache - Restore Unit Facing Point
- Same as the 'Restore Unit Facing Angle' action. But the unit loaded this time faces a region, not the facing angle itself.

Game Cache - Reload All
- Reloads all game cache from the computer's disk.

Game Cache - Clear Game Cache
- Clears all labels of all categories in a game cache.

Game Cache - Clear Category
- Clears all labels of a specific category in a game cache.
 

mase

____ ___ ____ __
Reaction score
154
Code:
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to moo 
    Actions
[indent]Game Cache - Create Cache as Units with Category of Category
[indent]Set gamecache = Last Created Cache
        Game Cache - Store (Triggering unit) as Muu of Category in (gamecache)
        Game Cache - Restore Muu of Category from (gamecache) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 0.00
There was no created cache... And as pawnable said, why use cache?
 

Potatisbil

New Member
Reaction score
6
I've edited now, made a little mistake in the post first :p my intention was to make a copy of a hero unit(same lvl,items and suck)

But the problem must be that i forgot to create the game cache.... :banghead:
gah... thanks :p

EDIT: worked now :p

Oki, i'll follow yer advice Sfilip :p
~Potatisbil
 

SFilip

Gone but not forgotten
Reaction score
634
Do not make the game cache every time. Its supposed to be done only once, on Map Initialization.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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