Saving

Lmfaocj

Active Member
Reaction score
1
I made a game that when you get to a high level you can choose to become level 1 with 3ed of your stats, but I am having trouble saving the ability's.
 

Lmfaocj

Active Member
Reaction score
1
:confused:
what do you mean by "saving the ability's." ??

Lol, you know how when you reset the level all your ability's reset I don't want it to reset, because it's annoying having to keep re-adding your ability's.
 

tooltiperror

Super Moderator
Reaction score
231
Are you going to have your map available to play online, or are you only playing offline?

It is slightly easier to work offline.
 

Lmfaocj

Active Member
Reaction score
1
Are you going to have your map available to play online, or are you only playing offline?

It is slightly easier to work offline.
Online

Edit: I am making a rpg map.
i am going to sleep now i will be back tomorrow for more ANSWERS ...... lol
 

XeNiM666

I lurk for pizza
Reaction score
138
are you trying to achieve like when i reached a certain level, ill can morph into another hero with more stats?
How about just using another unit (x-unit) with the same abilities and set the level of the abilities(x-unit) by the level of the previous one.
 

tooltiperror

Super Moderator
Reaction score
231
XeNi, he is talking about saving heroes between instances of maps. Which is a pain in the arse, because it requires generating and/or parsing text, or using the gamecache, but he wants it to be online.
 

XeNiM666

I lurk for pizza
Reaction score
138
i see.
this made me curious. Save load codes allows us to save things right? like integers?
So it's possible to save ability codes by integers and their levels?
sorry if my answer is a bit.. strange... I have no experience with save loads, gamecache and the like...
 

tooltiperror

Super Moderator
Reaction score
231
Well the entire premise of save and load codes is to take a string and change it to an integer, or effect, or unit rawcode, or whatever. They can get quite complicated, and usually not user friendly if you don't know JASS.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I made a game that when you get to a high level you can choose to become level 1 with 3ed of your stats, but I am having trouble saving the ability's.

actually i believe all he wants is to, when, lets say his paladin reaches lvl 99 he can choose to become lvl 1 again but with thrice as many attribute points, like in RagnarokOnline.
do the heroes have fixed abilities for their class? or can the players choose which abilities they want to learn at some kind of shop?
for the first case, check which class that hero is and check the level of the abilitys for the hero one by one saving the values in some integer array. if the hero doesnt have that ability the function "Level of Ability for (Unit)" returns 0.
now you can easily re-add the abilities (or if you use the standard wc3 learning system) you can increase his skill points and make the hero learn the abilities the common way depending on the levels saved in the integer variable array.

if you have problems or dont understand something ask again, i could write you that trigger.
 

Lmfaocj

Active Member
Reaction score
1
Yeah, can you please write a trigger I tried readding the skills but for some reason it does not work.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
here is a simple trigger, you have to choose the event yourself though:
Trigger:
  • SomeTrigger
    • Events
      • (Enter some event here)
    • Conditions
    • Actions
      • Set TempUnit = (Enter some unit in here, like for example (Triggering Unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of TempUnit) Equal to Paladin
        • Then - Actions
          • Set Ability[0] = Holy Light
          • Set Ability[1] = Divine Shield
          • Set Ability[2] = Devotion Aura
          • Set Ability[3] = Resurrection
          • Set Ability[4] = Attribute-Bonus
        • Else - Actions
      • For each (Integer A) from 0 to 4, do (Actions)
        • Loop - Actions
          • Set AbilityLevel[(Integer A)] = (Level of Ability[(Integer A)] for TempUnit)
      • Set TempPoint = (Enter some location the hero should be revived at here) example: ((Owner of TempUnit) start location)
      • Unit - Create 1 (Unit-type of TempUnit) for (Owner of TempUnit) at TempPoint facing Default building facing (270.0) degrees
      • For each (Integer A) from 0 to 4, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to AbilityLevel[(Integer A)], do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Ability[(Integer A)] for (Last created unit)) Equal to 0
                • Then - Actions
                  • Unit - Add Ability[(Integer A)] to (Last created unit)
                • Else - Actions
                  • Unit - Increase level of Ability[(Integer A)] for (Last created unit)
      • Unit - Remove TempUnit from the game
      • custom script: call RemoveLocation (udg_TempPoint)

Variables:
TempUnit = Some unit variable, the unit which shall be removed and re-created.
TempPoint = A point variable where the hero shall be re-created.
Ability[] = An array of abilities, set it proper to the abilities the hero shall have.
AbilityLevel[] = An array of integers, here are the levels of the abilities in the Ability[] array saved.
 

Lmfaocj

Active Member
Reaction score
1
Thank you for the trigger but do i have to make a If (All Conditions are True) then do (Then Actions) else do (Else Actions) for every hero?

Edit: never mind I found away to add it with my trigger
Trigger:
  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Hero level of (Triggering unit)) Greater than or equal to (>=) 350
      • (Owner of (Triggering unit)) Not equal to (!=) Neutral Hostile
      • (Owner of (Triggering unit)) Not equal to (!=) Neutral Passive
    • Then - Actions
      • Set RebirthInteger[1] = (Strength of (Triggering unit) (Exclude bonuses))
      • Set RebirthInteger[2] = (Agility of (Triggering unit) (Exclude bonuses))
      • Set RebirthInteger[3] = (Intelligence of (Triggering unit) (Exclude bonuses))
      • For each (Integer A) from 1 to 6, do (Set Item_RB[(Integer A)] = (Item carried by (Triggering unit) in slot (Integer A)))
      • For each (Integer A) from (Point-value of (Triggering unit)) to ((Point-value of (Triggering unit)) + 3), do (Set test[(Integer A)] = (Level of Ability[(Integer A)] for (Triggering unit)))
      • Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at RespawnPoint[(Player number of (Owner of (Triggering unit)))] facing (Random angle) degrees
      • Unit - Remove (Triggering unit) from the game
      • For each (Integer A) from 1 to 6, do (Hero - Create (Item-type of Item_RB[(Integer A)]) and give it to (Last created unit))
      • For each (Integer A) from (Point-value of (Last created unit)) to ((Point-value of (Last created unit)) + 3), do ( Do ActionFor each (Integer B) from 1 to test[(Integer A)], do (If ((Level of Ability[(Integer A)] for (Last created unit)) Equal to (==) 0) then do (Unit - Add Ability[(Integer A)] to (Last created unit)) else do (Unit - Increase level of Ability[(Integer A
      • Hero - Modify Strength of (Last created unit): Set to (RebirthInteger[1] / 3)
      • Hero - Modify Agility of (Last created unit): Set to (RebirthInteger[2] / 3)
      • Hero - Modify Intelligence of (Last created unit): Set to (RebirthInteger[3] / 3)
      • Player - Add 1 to (Owner of (Last created unit)) Current lumber
      • Set Yourunit[(Player number of (Owner of (Last created unit)))] = (Last created unit)
      • Set RebirthCount[(Player number of (Owner of (Last created unit)))] = (RebirthCount[(Player number of (Owner of (Last created unit)))] + 1)
    • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top