• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Custom Script Error

Status
Not open for further replies.
Level 3
Joined
Dec 20, 2010
Messages
48
I've tried the save&load system by Acehart but I've got some problems with the script.I can save it on its original map but when I paste the triggers into my map, there're errors on the custom script.Somebody plz help me :goblin_cry:

  • SaveLoad Save All Copy
    • 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
    • Conditions
    • Actions
      • -------- Prepare the save array with this player's Hero --------
      • Set SaveCount = 0
      • -------- Player's Gold --------
      • Set SaveCount = (SaveCount + 1)
      • Set Save[SaveCount] = ((Triggering player) Current gold)
      • -------- Take all Heroes --------
      • Set UnitGroup = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Set SaveCount = (SaveCount + 1)
      • Set Save[SaveCount] = (Number of units in UnitGroup)
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • -------- Save the Hero --------
          • Set SaveCount = (SaveCount + 1)
          • Set TempUnit = (Picked unit)
          • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Unit2Integer( udg_TempUnit )
          • -------- Hero Experience --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Hero experience of (Picked unit))
          • -------- Hero Position X --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Integer((X of (Position of (Picked unit)))))
          • -------- Hero Position Y --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Integer((Y of (Position of (Picked unit)))))
          • -------- How many items does he carry --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Number of items carried by (Picked unit))
          • -------- Add all items --------
          • 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 carried by (Picked unit) in slot (Integer A)) is owned) Equal to True
                • Then - Actions
                  • -------- The actual item --------
                  • Set SaveCount = (SaveCount + 1)
                  • Set TempItem = (Item carried by (Picked unit) in slot (Integer A))
                  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer( udg_TempItem )
                  • -------- The number of charges it has --------
                  • Set SaveCount = (SaveCount + 1)
                  • Set Save[SaveCount] = (Charges remaining in (Item carried by (Picked unit) in slot (Integer A)))
                • Else - Actions
      • -------- Turn values into code --------
      • Custom script: set udg_Code = SaveLoad_Encode()
      • -------- Show code to player --------
      • Quest - Display to (Player group((Triggering player))) the Secret message: Your code:
      • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
error.jpg


I would like to give +repp to anybody who helped me to solve this problems !
 
Last edited:
Level 3
Joined
Dec 20, 2010
Messages
48
I don't know anything from anything, but it looks like you got an extra spaces in:

Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Unit2Integer( udg_TempUnit )

Have you tried it with (udg_TempUnit) instead of ( udg_TempUnit )

Hey, thanks for comment.I will try it soon !:ogre_haosis:

Edit : None change . . . another solusiton ?
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
There is something wierd in what you are trying to archieve or I'm a Santa.
SaveLoad_Unit2Integer - it's a name of custom function?
If not, such function doens't exists. You can't convert unit to integer this way. If you want to get 'id' of that unit (the integer which represents that unit) use function GetHandleId(<unithere>).

Post link to that system.
 
Level 3
Joined
Dec 20, 2010
Messages
48
There is something wierd in what you are trying to archieve or I'm a Santa.
SaveLoad_Unit2Integer - it's a name of custom function?
If not, such function doens't exists. You can't convert unit to integer this way. If you want to get 'id' of that unit (the integer which represents that unit) use function GetHandleId(<unithere>).

Post link to that system.

Well, it works ! It became 3 errors (from five -> look at picture above).What about these :

  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer( udg_TempItem )
I must change it to GetHandleId too ?


  • Custom script: set udg_Code = SaveLoad_Encode()
I don't understand about this one.Solution please ?

Thx
 
Level 3
Joined
Dec 20, 2010
Messages
48
Okey, look in system map's header for rest of the system..
To find map header click on 'map icon' in tirgger editor (above all the triggers). Copy and paste the whole code to your map's header. Now you can use custom functions SaveLoad etc. and use everything you have at the first trigger you have shown to us.

Done, and success ! Thanks mate.+repp
 
Status
Not open for further replies.
Top