- Joined
- Apr 3, 2010
- Messages
- 1,101
I am not exactly sure what I have done wrong here. I think I am lacking understanding of how exactly hash tables work
This is meant to save the location of a Neutral Hostile Camp setup then reload it and recreate it at a random point on the map
This is meant to save the location of a Neutral Hostile Camp setup then reload it and recreate it at a random point on the map
-
Camp Location trigger Copy Copy
-
Events
-
Time - Elapsed game time is 0.00 seconds
-
-
Conditions
-
Actions
-
-------- Region variable init / Location point for totem (In this example Totem or key focus point is Tree of life) --------
-
Set Regions[0] = Region 000 <gen>
-
Set Regions[1] = Region 000 Copy 2 <gen>
-
Set Regions[2] = Region 000 Copy 3 <gen>
-
Set Regions[3] = Region 000 Copy 4 <gen>
-
Set Regions[4] = Region 000 Copy 5 <gen>
-
Set Treecord[0] = (Integer((X of (Position of Tree of Eternity 0000 <gen>))))
-
Set Treecord[1] = (Integer((Y of (Position of Tree of Eternity 0000 <gen>))))
-
Set Treecord[2] = (Integer((Facing of Tree of Eternity 0000 <gen>)))
-
-------- Kk Now to save the Camp setup --------
-
Hashtable - Create a hashtable
-
Set Hashtable = (Last created hashtable)
-
-------- Saving Destructables *If required* --------
-
-------- Change 500 to whatever the count of your doods is :L? --------
-
For each (Integer A) from 0 to 100, do (Actions)
-
Loop - Actions
-
Game - Display to (All players) the text: Value saved
-
Set Temp_RandomDestr = (Random destructible in Regions[0])
-
Hashtable - Save Handle OfTemp_RandomDestr as (Integer A) of 0 in Hashtable
-
Hashtable - Save ((Integer((X of (Position of Temp_RandomDestr)))) - Treecord[0]) as (Integer A) of 1 in Hashtable
-
Hashtable - Save ((Integer((Y of (Position of Temp_RandomDestr)))) - Treecord[1]) as (Integer A) of 2 in Hashtable
-
Hashtable - Save Treecord[2] as (Integer A) of 3 in Hashtable
-
Destructible - Remove Temp_RandomDestr
-
Wait 0.01 seconds
-
-------- Saving units --------
-
Set Temp_unit = (Random unit from (Units in Region 000 <gen>))
-
Hashtable - Save Handle OfTemp_unit as (Integer A) of 4 in Hashtable
-
Hashtable - Save ((Integer((X of (Position of Temp_unit)))) - Treecord[0]) as (Integer A) of 5 in Hashtable
-
Hashtable - Save ((Integer((Y of (Position of Temp_unit)))) - Treecord[1]) as (Integer A) of 6 in Hashtable
-
Hashtable - Save ((Integer((Facing of Temp_unit))) - Treecord[2]) as (Integer A) of 7 in Hashtable
-
Unit - Remove Temp_unit from the game
-
-
-
Game - Display to (All players) the text: Save complete
-
-
-
Camp Creation trigger Copy Copy
-
Events
-
Player - Player 1 (Red) types a chat message containing Spawn as An exact match
-
-
Conditions
-
Actions
-
Unit - Create 1 Tree of Life for Neutral Hostile at (Center of Regions[(Random integer number between 0 and 6)]) facing (Real(Treecord[2])) degrees
-
Set Totem_Temp = (Last created unit)
-
For each (Integer A) from 0 to 100, do (Actions)
-
Loop - Actions
-
Wait 0.20 seconds
-
Game - Display to (All players) the text: Doodad created
-
Destructible - Create a (Destructible-type of (Load (Integer A) of 0 in Hashtable)) at ((Position of Totem_Temp) offset by ((Real((Load (Integer A) of 1 from Hashtable))), (Real((Load (Integer A) of 2 from Hashtable))))) facing (Load (Integer A) of 3 from Hashtable) with scale 1.00 and variation 0
-
Wait 0.20 seconds
-
Unit - Create 1 (Unit-type of (Load (Integer A) of 4 in Hashtable)) for Neutral Hostile at ((Position of Totem_Temp) offset by ((Real((Load (Integer A) of 5 from Hashtable))), (Load (Integer A) of 6 from Hashtable))) facing (Real((Load (Integer A) of 7 from Hashtable))) degrees
-
Game - Display to (All players) the text: Unit created
-
-
-
Game - Display to (All players) the text: Creation Complete
-
-
Last edited: