• 🏆 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!

Skill points

Status
Not open for further replies.
Level 13
Joined
Jun 3, 2011
Messages
1,058
Hello guys i have a question i have this system that every time you level up you gain 1 lumber (used for skill points) and also i have a save and load system how can i make the system load its skill points equivalent to its level?
 
Level 13
Joined
Jun 3, 2011
Messages
1,058
Post the triggers of your save/load system and skill points, and I will see if we can do anything to modify it, so you don't have to completely add a new system

  • SaveLoad Init Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Some configurables --------
      • Set SaveLoad_Alphabet = aA5bB0cCdDeE9fFgGhH8iIj1JkK4lLmMn7NoOp3PqQrRsStTu2UvV6wWxXyYzZ
      • Set SaveLoad_CheckName = True
      • Set SaveLoad_HyphenSpace = 4
      • Set SaveLoad_Lower = |c002a4580
      • Set SaveLoad_Number = |cffffcc00
      • Set SaveLoad_Upper = |cff1142aa
      • -------- Abilities --------
      • Set SaveLoad_Ability[1] = |cffdc143cHero's Aura|r |cffffd700[Achivement]|r
      • Set SaveLoad_AbilityCount = 1
      • -------- Store all the items you want to be able to be saved below. --------
      • Set SaveLoad_Item[1] = Absolute
      • Set SaveLoad_Item[2] = Hard Rock
      • Set SaveLoad_Item[3] = |c00408080Cooked Meat|r
      • Set SaveLoad_Item[4] = |c00408080Uncooked Meat|r
      • Set SaveLoad_Item[5] = |c00FFFFFFClass Promotion|r
      • Set SaveLoad_Item[6] = |cff00ffffLusaka Ring|r
      • Set SaveLoad_Item[7] = Value
      • Set SaveLoad_Item[8] = Value
      • Set SaveLoad_Item[9] = Value
      • Set SaveLoad_Item[10] = Value
      • Set SaveLoad_Item[11] = Value
      • Set SaveLoad_Item[12] = Value
      • Set SaveLoad_Item[13] = Value
      • Set SaveLoad_Item[14] = Value
      • Set SaveLoad_Item[15] = Value
      • Set SaveLoad_Item[16] = |cff00ff00Emeral Gem|r
      • Set SaveLoad_ItemCount = 16
      • -------- Store all the heroes you want to be able to be saved below. --------
      • Set SaveLoad_Hero[1] = Defender
      • Set SaveLoad_Hero[2] = Life Taker
      • Set SaveLoad_Hero[3] = Wind Shooter
      • Set SaveLoad_Hero[4] = Wise One
      • Set SaveLoad_Hero[5] = |cffFFFF84GameMaster|r
      • Set SaveLoad_Hero[6] = Jester
      • Set SaveLoad_Hero[7] = Assassin
      • Set SaveLoad_Hero[8] = Clown
      • Set SaveLoad_Hero[9] = Rouge
      • Set SaveLoad_Hero[10] = Slayer of the night
      • Set SaveLoad_Hero[11] = Assassin
      • Set SaveLoad_Hero[12] = Swindler
      • Set SaveLoad_Hero[13] = Warrior
      • Set SaveLoad_Hero[14] = Crusader
      • Set SaveLoad_Hero[15] = Tank
      • Set SaveLoad_HeroCount = 15
      • -------- Don't modify below this line. --------
      • Set SaveLoad_Base = (Length of SaveLoad_Alphabet)
      • Set SaveLoad_Char = <Empty String>
      • Set Load[0] = 0
      • Set LoadCount = 0
      • Custom script: call CodeGen_Init()
  • SaveLoad Save 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
      • -------- 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 players Lumber --------
      • Set Save[SaveCount] = ((Triggering player) Current lumber)
      • 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)
      • -------- Save heroes 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-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
      • -------- Show Code --------
      • Custom script: set udg_Code = CodeGen_Compile()
      • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
  • SaveLoad Load Copy
    • 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
    • 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) matching (((Matching unit) is A Hero) Equal to True)) and do (Unit - Remove (Picked unit) from the game)
      • Unit - Create 1 SaveLoad_Hero[Load[LoadCount]] for (Triggering player) at (Center of Region 002 <gen>) 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 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
 
Level 8
Joined
Oct 12, 2011
Messages
483
I suppose you could add new sections to the code for each hero skill and store their level as an integer. You would need to store somewhere the order you take the ability levels from hero, as you don't want to save the level of an ability then load it as the level of a different ability. i.e. You would take the level of each skill and store it as an additional value to put into the code.
 
Status
Not open for further replies.
Top