• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Saving/ Loading

Status
Not open for further replies.
Level 10
Joined
Jun 21, 2007
Messages
643
I'll edxplain how to do it yourself that way you'll be able to implement it for other things


  • Save
  • Events:
    • Player - Chat Event - Enters "-save" as an exact match
  • Conditions:
    • None
  • Actions:
    • Set Variable - "unitExp" = experience of hero(your hero)
    • Game - Display Text (auto-timed) - to (triggering player) convert int to str("unitExp")
  • Load
  • Events:
    • Player - Chat Event - Enters "-load" as a partial string
  • Conditions:
    • None
  • Actions:
    • Comment "Back! :P"
    • Hero - Add XP - entered substrring 6-12 - Hide level up graphics
That will add the exp to the hero that you enter after -load

e.g. -load 123
will add 123 exp to the players hero

Now this save system is about as secure as an open biscuit tin so you need to add a 2-way encryption to it

a simple way to do this is to simply assign a string equivelant of each number

I.e 00=0 01=1... ...0Y=35 0Z=36 10=37 11=38 etc.

So we start from the top and go:

  • SaveEncrypt
  • Events:
    • Player - Chat Event - Enters "-save" as an exact match
  • Conditions:
    • None
  • Actions:
    • Set Variable - "unitExp" = experience of hero(your hero)
    • if( (length of string("unitExp" \ 2 x 2)) less than length of string("unitExp"))
      • Comment - this is a cunning way of seeing if the variable is odd or even
      • Comment - if its odd it wil ignore the .5 on the end
      • Comment - so 3/2 = 1.5 but as an int is 1 x 2 = 2 not 3
      • Comment - Coz we're dealing with pairs of digits we need to add a 0 on the front if
      • Comment - its odd otherwise it may multiply the expereince by 10 :-O
      • set variable - unitExpMod = string "0" + "UnitExp"
    • else
      • set variable unitExpMod = string("unitExp")
    • For Each integer 0 to length of string"unitExpMod"
      • Set variable - "unitExpEncTemp" = string(unitExpMod, substring(for loop int a -1,for loop int a)
      • if(unitExpEncTemp == 00)
        • Actions:
          • Set Variable - "unitExpEnc" = "unitExpEnc" + "00"
        • Else
          • Comment - Repeat all the way to 99
        • custom script: we need to 'skip' a digit each time so we add 1 to the for loop int a, can't remember the code for it but its pretty simple ^^#
    • End loop
    • Game - Display Text (auto-timed) - to (triggering player) convert int to str("unitExpEnc")
 
Last edited:
Level 12
Joined
May 4, 2008
Messages
1,111
lol its mostly ''hero add XP > entered substrring 6-30 (exemple)

its gona give ur guy the amount of xp from the 8th leter tot eh 30th with conversion string to interger :D
lets say he writes -load 29374 6 2 8
number 12345678910111213 and so on it will add 29374628 xp tot he hero :D but its better if u try to make one with letters too >.> find a way :D
 
Level 8
Joined
Jun 1, 2008
Messages
341
can som1 plz write me a trigger showing that when you save a code will be displayed and when that code is entered (-load (CODE)) the Experience will be given to the hero (by the way the experience is an interger in my multibord (similar to Undead Assult xD)). so can som1 plz write that trigger 4 me coz to be honest im realy confused by the trigger s shown above + rep to who gives this to me. Thanks
 
Level 5
Joined
May 6, 2008
Messages
175
umm can please do not double post or tell when you bump this. the upper one you posted is spam and double post.

btw

about the display word on saving thingy.
just put in action
game display to all player the text (anything u want)
 
Status
Not open for further replies.
Top