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

[HELP] Codegen? Is there a way to save hero's ability?

Status
Not open for further replies.
You might need to use jass since IDK if you can convert an ability to its raw code using GUI...

but basically:
-Create an integer variable array
-Save the rawcode of each spell into an index of the array
-Then when you use the save command, just obtain the rawcode of the abilities and match it with those in the variable array to get its index and then save the index on the SaveLoad system
-Then when you use the load command, retrieve the index and use it to add the ability to the hero
 
Level 9
Joined
Aug 7, 2009
Messages
380
it just not working, can you show me an trigger for that :-?
EDIT: I used:
  • Trigger 1
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set ABILITIES_SAVE[1] = Flame Strike
    • Set ABILITIES_SAVE[2] = Phoenix
Ability save part
  • Trigger 2
  • Actions
    • For each (Integer B) from 1 to 2, do (Actions)
      • Loop - Actions
        • Set ABILITIES_LEVELOFABILITY[(Integer B)] = (Level of ABILITIES_SAVE[(Integer B)] for Hero)
        • Set SaveCount = (SaveCount + 1)
Ability load part
  • Trigger 3
  • Actions
    • Set LoadCount = (LoadCount + 1)
    • Unit - Add ABILITIES_SAVE[Load[LoadCount]] to Hero
    • Unit - Set level of ABILITIES_SAVE[Load[LoadCount]] for Hero to ABILITIES_LEVELOFABILITY[Load[LoadCount]]
What's the big deal? I think it's not even save the ability, 'cause the code when i save without ability and with ability is the same.??? :vw_wtf: Getting tired with this :vw_sad:
 
does the Hero have those skills? could you upload the map? it would be easier that way...

oh wait... you haven't saved the ability level into the Save[SaveCount]

your load trigger also seems wrong...

  • Actions
    • Set ABILITIES_SAVE[1] = Flame Strike
    • Set ABILITIES_SAVE[2] = Phoenix
  • For each (Integer B) from 1 to 2, do (Actions)
    • Loop - Actions
      • Set SaveCount = (SaveCount + 1)
      • Set Save[SaveCount] = (Level of ABILITIES_SAVE[(Integer B)] for Hero)
  • For each (Integer B) from 1 to 2, do (Actions)
    • Loop - Actions
      • Set LoadCount = (LoadCount + 1)
      • Set Level of ABILITIES_SAVE[(Integer B)] for hero = Load[LoadCount]
Note: this is assuming that the hero already has the ability
 
Status
Not open for further replies.
Top