• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Whats Problem on this trigger??

Status
Not open for further replies.
Level 4
Joined
Dec 4, 2010
Messages
63
This system is really work,, but! it only works when i get the code and load it in a single game, so it could be 2 heroes in game but it was only a test map. anyway,,, it works my items back, the charges was back,, i seems good, but when i restart the game and load my code the only thing the change was the charges of my items, example it was 4 charges when i restart my game the charges gone......... why this happen what should i do????????. anyone can help me?? :vw_wtf:

Anyone can help i will give + rep

i hope i solved this.

can teach me how to upload a wider than this!!


Trigger 1


[TRIGGER=SaveLoad Save Copy
Events
Player - Player 1 (Red) types a chat message containing -save as An exact match
Conditions
Actions
Set SaveCount = 0
Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Set Hero = (Picked unit))
Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertUnit(GetUnitTypeId(udg_Hero))
Set SaveCount = (SaveCount + 1)
-------- Save players gold. --------
Set Save[SaveCount] = ((Triggering player) Current gold)
Set SaveCount = (SaveCount + 1)
-------- Save heroes level. --------
Set Save[SaveCount] = (Hero level of Hero)
Set SaveCount = (SaveCount + 1)
-------- Save heroes items. --------
Set Save[SaveCount] = (Number of items carried by Hero)
Set SaveCount = (SaveCount + 1)
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by Hero in slot (Integer A))) Not equal to (Item-type of No item)
Then - Actions
Set Item = (Item carried by Hero in slot (Integer A))
Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertItem(GetItemTypeId(udg_Item))
Set SaveCount = (SaveCount + 1)
Else - Actions
For each (Integer A) from 1 to 1, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
Then - Actions
Set Item_Charges[1] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
Set SaveCount = (SaveCount + 1)
Else - Actions
For each (Integer A) from 2 to 2, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
Then - Actions
Set Item_Charges[2] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
Set SaveCount = (SaveCount + 1)
Else - Actions
For each (Integer A) from 3 to 3, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
Then - Actions
Set Item_Charges[3] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
Set SaveCount = (SaveCount + 1)
Else - Actions
For each (Integer A) from 4 to 4, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
Then - Actions
Set Item_Charges[4] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
Set SaveCount = (SaveCount + 1)
Else - Actions
For each (Integer A) from 5 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
Then - Actions
Set Item_Charges[5] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
Set SaveCount = (SaveCount + 1)
Else - Actions
For each (Integer A) from 6 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
Then - Actions
Set Item_Charges[6] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
Set SaveCount = (SaveCount + 1)
Else - Actions
-------- Show Code --------
Custom script: set udg_Code = CodeGen_Compile()
Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code.[/TRIGGER]






[TRIGGER=/SaveLoad Load Copy
Events
Player - Player 1 (Red) types a chat message containing -load as A substring
Conditions
(Substring((Entered chat string), 1, 6)) Equal to -load
Actions
-------- Check if load is valid --------
Set Code = (Substring((Entered chat string), 7, 999))
Custom script: call CodeGen_Load(udg_Code)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SaveLoad_Valid Equal to False
Then - Actions
Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: Invalid code.
Skip remaining actions
Else - Actions
-------- Start loading, load the hero first. --------
Set LoadCount = 0
Unit - Create 1 SaveLoad_Hero[Load[LoadCount]] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
Set Hero = (Last created unit)
Selection - Select (Last created unit) for (Triggering player)
Set LoadCount = (LoadCount + 1)
-------- Now load players gold --------
Player - Set (Triggering player) Current gold to Load[LoadCount]
-------- Load heroes level --------
Set LoadCount = (LoadCount + 1)
Hero - Set Hero Hero-level to Load[LoadCount], Hide level-up graphics
-------- Now items --------
Set LoadCount = (LoadCount + 1)
For each (Integer A) from 0 to Load[LoadCount], do (Actions)
Loop - Actions
Set LoadCount = (LoadCount + 1)
Hero - Create SaveLoad_Item[Load[LoadCount]] and give it to Hero
Trigger - Turn off (This trigger)
For each (Integer A) from 0 to 1, do (Actions)
Loop - Actions
Set LoadCount = (LoadCount + 1)
Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[1]
For each (Integer A) from 2 to 2, do (Actions)
Loop - Actions
Set LoadCount = (LoadCount + 1)
Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[2]
For each (Integer A) from 3 to 3, do (Actions)
Loop - Actions
Set LoadCount = (LoadCount + 1)
Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[3]
For each (Integer A) from 4 to 4, do (Actions)
Loop - Actions
Set LoadCount = (LoadCount + 1)
Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[4]
For each (Integer A) from 5 to 5, do (Actions)
Loop - Actions
Set LoadCount = (LoadCount + 1)
Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[5]
For each (Integer A) from 6 to 6, do (Actions)
Loop - Actions
Set LoadCount = (LoadCount + 1)
Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[6].[/TRIGGER]

Trigger 2

http://s365.photobucket.com/albums/...oo96/rj_john12/?action=view&current=trig1.jpg
 

Attachments

  • Best_Naruto_Shippuden_images.jpg
    Best_Naruto_Shippuden_images.jpg
    22.5 KB · Views: 84
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
Let me help you...Maker means like this tag...


  • Events
  • Player - Player 1 (Red) types a chat message containing -save as An exact match
  • Conditions
  • Actions
  • -------- Find the players hero, and save it. I realize it leaks but it's just for demonstration. --------
  • Set SaveCount = 0
  • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Set Hero = (Picked unit))
  • Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertUnit(GetUnitTypeId(udg_Hero))
  • Set SaveCount = (SaveCount + 1)
  • -------- Save players gold. --------
  • Set Save[SaveCount] = ((Triggering player) Current gold)
  • Set SaveCount = (SaveCount + 1)
  • -------- Save heroes level. --------
  • Set Save[SaveCount] = (Hero level of Hero)
  • Set SaveCount = (SaveCount + 1)
  • -------- Save heroes items. --------
  • Set Save[SaveCount] = (Number of items carried by Hero)
  • Set SaveCount = (SaveCount + 1)
  • For each (Integer A) from 1 to 6, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Item-type of (Item carried by Hero in slot (Integer A))) Not equal to (Item-type of No item)
  • Then - Actions
  • Set Item = (Item carried by Hero in slot (Integer A))
  • Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertItem(GetItemTypeId(udg_Item))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 1 to 1, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[1] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 2 to 2, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[2] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 3 to 3, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[3] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 4 to 4, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[4] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 5 to 5, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[5] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 6 to 6, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[6] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • -------- Show Code --------
  • Custom script: set udg_Code = CodeGen_Compile()
  • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code



  • Events
  • Player - Player 1 (Red) types a chat message containing -load as A substring
  • Conditions
  • (Substring((Entered chat string), 1, 6)) Equal to -load
  • Actions
  • -------- Check if load is valid --------
  • Set Code = (Substring((Entered chat string), 7, 999))
  • Custom script: call CodeGen_Load(udg_Code)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • SaveLoad_Valid Equal to False
  • Then - Actions
  • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: Invalid code.
  • Skip remaining actions
  • Else - Actions
  • -------- Start loading, load the hero first. --------
  • Set LoadCount = 0
  • Unit - Create 1 SaveLoad_Hero[Load[LoadCount]] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
  • Set Hero = (Last created unit)
  • Selection - Select (Last created unit) for (Triggering player)
  • Set LoadCount = (LoadCount + 1)
  • -------- Now load players gold --------
  • Player - Set (Triggering player) Current gold to Load[LoadCount]
  • -------- Load heroes level --------
  • Set LoadCount = (LoadCount + 1)
  • Hero - Set Hero Hero-level to Load[LoadCount], Hide level-up graphics
  • -------- Now items --------
  • Set LoadCount = (LoadCount + 1)
  • For each (Integer A) from 0 to Load[LoadCount], do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Hero - Create SaveLoad_Item[Load[LoadCount]] and give it to Hero
  • Trigger - Turn off (This trigger)
  • For each (Integer A) from 0 to 1, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[1]
  • For each (Integer A) from 2 to 2, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[2]
  • For each (Integer A) from 3 to 3, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[3]
  • For each (Integer A) from 4 to 4, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[4]
  • For each (Integer A) from 5 to 5, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[5]
  • For each (Integer A) from 6 to 6, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[6]
  • [/hidden]
and I believe you need Game Cache save for this...correct me if Im wrong
 
Level 8
Joined
Apr 8, 2009
Messages
499
Let me help you...Maker means like this tag...


  • Events
  • Player - Player 1 (Red) types a chat message containing -save as An exact match
  • Conditions
  • Actions
  • -------- Find the players hero, and save it. I realize it leaks but it's just for demonstration. --------
  • Set SaveCount = 0
  • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Set Hero = (Picked unit))
  • Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertUnit(GetUnitTypeId(udg_Hero))
  • Set SaveCount = (SaveCount + 1)
  • -------- Save players gold. --------
  • Set Save[SaveCount] = ((Triggering player) Current gold)
  • Set SaveCount = (SaveCount + 1)
  • -------- Save heroes level. --------
  • Set Save[SaveCount] = (Hero level of Hero)
  • Set SaveCount = (SaveCount + 1)
  • -------- Save heroes items. --------
  • Set Save[SaveCount] = (Number of items carried by Hero)
  • Set SaveCount = (SaveCount + 1)
  • For each (Integer A) from 1 to 6, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Item-type of (Item carried by Hero in slot (Integer A))) Not equal to (Item-type of No item)
  • Then - Actions
  • Set Item = (Item carried by Hero in slot (Integer A))
  • Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertItem(GetItemTypeId(udg_Item))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 1 to 1, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[1] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 2 to 2, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[2] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 3 to 3, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[3] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 4 to 4, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[4] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 5 to 5, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[5] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • For each (Integer A) from 6 to 6, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Charges remaining in (Item carried by Hero in slot (Integer A))) Not equal to (Charges remaining in No item)
  • Then - Actions
  • Set Item_Charges[6] = (Charges remaining in (Item carried by Hero in slot (Integer A)))
  • Set SaveCount = (SaveCount + 1)
  • Else - Actions
  • -------- Show Code --------
  • Custom script: set udg_Code = CodeGen_Compile()
  • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code



  • Events
  • Player - Player 1 (Red) types a chat message containing -load as A substring
  • Conditions
  • (Substring((Entered chat string), 1, 6)) Equal to -load
  • Actions
  • -------- Check if load is valid --------
  • Set Code = (Substring((Entered chat string), 7, 999))
  • Custom script: call CodeGen_Load(udg_Code)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • SaveLoad_Valid Equal to False
  • Then - Actions
  • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: Invalid code.
  • Skip remaining actions
  • Else - Actions
  • -------- Start loading, load the hero first. --------
  • Set LoadCount = 0
  • Unit - Create 1 SaveLoad_Hero[Load[LoadCount]] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
  • Set Hero = (Last created unit)
  • Selection - Select (Last created unit) for (Triggering player)
  • Set LoadCount = (LoadCount + 1)
  • -------- Now load players gold --------
  • Player - Set (Triggering player) Current gold to Load[LoadCount]
  • -------- Load heroes level --------
  • Set LoadCount = (LoadCount + 1)
  • Hero - Set Hero Hero-level to Load[LoadCount], Hide level-up graphics
  • -------- Now items --------
  • Set LoadCount = (LoadCount + 1)
  • For each (Integer A) from 0 to Load[LoadCount], do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Hero - Create SaveLoad_Item[Load[LoadCount]] and give it to Hero
  • Trigger - Turn off (This trigger)
  • For each (Integer A) from 0 to 1, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[1]
  • For each (Integer A) from 2 to 2, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[2]
  • For each (Integer A) from 3 to 3, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[3]
  • For each (Integer A) from 4 to 4, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[4]
  • For each (Integer A) from 5 to 5, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[5]
  • For each (Integer A) from 6 to 6, do (Actions)
  • Loop - Actions
  • Set LoadCount = (LoadCount + 1)
  • Item - Set charges remaining in (Item carried by Hero in slot (Integer A)) to Item_Charges[6]
  • [/hidden]
and I believe you need Game Cache save for this...correct me if Im wrong


can't use game cache's for saving data in multiplayer games, right?

also, i had a similar problem some time ago and i made this:


  • SaveLoad Save JT
    • Events
      • Player - Player 1 (Red) types a chat message containing -save as An exact match
      • Player - Player 2 (Blue) types a chat message containing -save as An exact match
      • Player - Player 3 (Teal) types a chat message containing -save as An exact match
      • Player - Player 4 (Purple) types a chat message containing -save as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -save as An exact match
      • Player - Player 6 (Orange) types a chat message containing -save as An exact match
      • Player - Player 7 (Green) types a chat message containing -save as An exact match
      • Player - Player 8 (Pink) types a chat message containing -save as An exact match
    • Conditions
    • Actions
      • -------- Find the players hero, and save it. I realize it leaks but it's just for demonstration. --------
      • Set SaveCount = 0
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching ((Matching unit) Equal to Player_Hero_Array[(Player number of (Triggering player))])) and do (Set Hero = (Picked unit))
      • Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertUnit(GetUnitTypeId(udg_Hero))
      • Set SaveCount = (SaveCount + 1)
      • -------- Save players gold. --------
      • Set Save[SaveCount] = ((Triggering player) Current gold)
      • Set SaveCount = (SaveCount + 1)
      • -------- Save players lumber. --------
      • Set Save[SaveCount] = ((Triggering player) Current lumber)
      • Set SaveCount = (SaveCount + 1)
      • -------- Save heroes EXP. --------
      • Set Save[SaveCount] = (Hero experience of Hero)
      • Set SaveCount = (SaveCount + 1)
      • -------- Save heroes items. --------
      • Set Save[SaveCount] = (Number of items carried by Hero)
      • For each (Integer Integer_A_Replacement) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by Hero in slot Integer_A_Replacement)) Not equal to (Item-type of No item)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Charges remaining in (Item carried by Hero in slot Integer_A_Replacement)) Greater than 0
                • Then - Actions
                  • Set SaveCount = (SaveCount + 1)
                  • Set Save[SaveCount] = 1
                  • Set SaveCount = (SaveCount + 1)
                  • Set Item = (Item carried by Hero in slot Integer_A_Replacement)
                  • Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertItem(GetItemTypeId(udg_Item))
                  • Set SaveCount = (SaveCount + 1)
                  • Set Save[SaveCount] = (Charges remaining in (Item carried by Hero in slot Integer_A_Replacement))
                • Else - Actions
                  • Set SaveCount = (SaveCount + 1)
                  • Set Save[SaveCount] = 2
                  • Set SaveCount = (SaveCount + 1)
                  • Set Item = (Item carried by Hero in slot Integer_A_Replacement)
                  • Custom script: set udg_Save[udg_SaveCount] = CodeGen_ConvertItem(GetItemTypeId(udg_Item))
                  • Set SaveCount = (SaveCount + 1)
            • Else - Actions
              • Set SaveCount = (SaveCount + 1)
              • Set Save[SaveCount] = 0
              • Set SaveCount = (SaveCount + 2)
      • Set SaveCount = (SaveCount + 1)
      • -------- Show Code --------
      • Custom script: set udg_Code = CodeGen_Compile()
      • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
      • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: Credits to JTtheGho...
  • SaveLoad Load JT
    • Events
      • Player - Player 1 (Red) types a chat message containing -load as A substring
      • Player - Player 2 (Blue) types a chat message containing -load as A substring
      • Player - Player 3 (Teal) types a chat message containing -load as A substring
      • Player - Player 4 (Purple) types a chat message containing -load as A substring
      • Player - Player 5 (Yellow) types a chat message containing -load as A substring
      • Player - Player 6 (Orange) types a chat message containing -load as A substring
      • Player - Player 7 (Green) types a chat message containing -load as A substring
      • Player - Player 8 (Pink) types a chat message containing -load as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 6)) Equal to -load
    • Actions
      • -------- Check if load is valid --------
      • Set Code = (Substring((Entered chat string), 7, 999))
      • Custom script: call CodeGen_Load(udg_Code)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SaveLoad_Valid Equal to False
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: Invalid code.
          • Skip remaining actions
        • Else - Actions
      • -------- Start loading, load the hero first. --------
      • Set LoadCount = 0
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Unit - Remove (Picked unit) from the game)
      • Unit - Create 1 SaveLoad_Hero[Load[LoadCount]] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set Hero = (Last created unit)
      • Selection - Select (Last created unit) for (Triggering player)
      • -------- Now load players gold --------
      • Set LoadCount = (LoadCount + 1)
      • Player - Set (Triggering player) Current gold to Load[LoadCount]
      • -------- Now load players Lumber --------
      • Set LoadCount = (LoadCount + 1)
      • Player - Set (Triggering player) Current lumber to Load[LoadCount]
      • -------- Load heroes EXP --------
      • Set LoadCount = (LoadCount + 1)
      • Hero - Set Hero experience to Load[LoadCount], Hide level-up graphics
      • -------- Now items --------
      • Set LoadCount = (LoadCount + 1)
      • For each (Integer Integer_A_Replacement) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set LoadCount = (LoadCount + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Load[LoadCount] Not equal to 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Load[LoadCount] Equal to 1
                • Then - Actions
                  • Set LoadCount = (LoadCount + 1)
                  • Hero - Create SaveLoad_Item[Load[LoadCount]] and give it to Hero
                  • Set LoadCount = (LoadCount + 1)
                  • Item - Set charges remaining in (Last created item) to Load[LoadCount]
                • Else - Actions
                  • Set LoadCount = (LoadCount + 1)
                  • Hero - Create SaveLoad_Item[Load[LoadCount]] and give it to Hero
                  • Set LoadCount = (LoadCount + 1)
            • Else - Actions
              • Set LoadCount = (LoadCount + 2)

so far that code has worked withouth errors for me. try it out if you like ^__^
 
Level 4
Joined
Dec 4, 2010
Messages
63
Really thanks!!! Animoi666 it could a really big help!!!!,,,,,,,,, but the one thing is i can't do what on that trigger is.,,,, can give me a demo map of your trigger,, if you want

,,,,,,,anyway i will give all help me to solved my problem +rep...............
 
Level 4
Joined
Dec 4, 2010
Messages
63
i already test his trigger but when i load my char,,,,, nothing created,????? i already checked my trigger and its very similar,,,

Variables:
Integer_A_Replacement = Interger
Player_Hero_Array = Unit Array(1)
 
Level 8
Joined
Apr 8, 2009
Messages
499
i already test his trigger but when i load my char,,,,, nothing created,????? i already checked my trigger and its very similar,,,

Variables:
Integer_A_Replacement = Interger
Player_Hero_Array = Unit Array(1)

just send me your map and i'll implant it for you .__.
 
Status
Not open for further replies.
Top