Save/Load Code, Yet Another

TDestroyer

New Member
Reaction score
0
OK i figured it out, i was picking up items in a (integer A loop), and i had another (integer A loop) running when items where picked up. So they interfered with each other. All i had to do was make some of the loops B loops and now it works.
 

LoveTD's

New Member
Reaction score
34
I wanted to add collours to the lower case alphabetic characters and this is what I've came up with:

JASS:

function SaveLoad_Color takes string s returns string
    local integer i = StringLength(s)
    local string c
    local string r = ""

    loop
        set i = i - 1
        set c = SubString(s,i,i + 1)
        if c == "0" or c == "1" or c == "2" or c == "3" or c == "4" or c == "5" or c == "6" or c == "7" or c == "8" or c == "9" then
            set r = "|cffffcc00" + c + "|r" + r
        elseif c == "-" then
            set r = "|cffdddddd-|r" + r
        elseif c == "a" or c == "b" or c == "c" or c == "d" or c == "e" or c == "f" or c == "g" or c == "h" or c == "i" or c == "j" or c == "k" or c == "l" or c == "m" or c == "n" or c == "o" or c == "p" or c == "q" or c == "r" c == "s" or c == "t" or c == "u" or c == "v" or c == "w" or c == "x" or c == "y" or c == "z" then
            set r = "|c0000ff80" + c + "|r" + r
        else
            set r = c + r
        endif
        exitwhen i <= 0
    endloop
    return r
endfunction


the problem is: I get 3 compile errors:

Expected expression @:
JASS:
        elseif c == "a" or c == "b" or c == "c" or c == "d" or c == "e" or c == "f" or c == "g" or c == "h" or c == "i" or c == "j" or c == "k" or c == "l" or c == "m" or c == "n" or c == "o" or c == "p" or c == "q" or c == "r" c == "s" or c == "t" or c == "u" or c == "v" or c == "w" or c == "x" or c == "y" or c == "z" then


Expected 'endif" @:
JASS:
else


Expected 'endif" @:
JASS:
endif


can someone help me out on this?
 

No_exit

Regular User (What is Custom User Title?)
Reaction score
40
@ LoveTD's: You forgot an or between
c == "r" c == "s"
Fixed:
JASS:
elseif c == "a" or c == "b" or c == "c" or c == "d" or c == "e" or c == "f" or c == "g" or c == "h" or c == "i" or c == "j" or c == "k" or c == "l" or c == "m" or c == "n" or c == "o" or c == "p" or c == "q" or c == "r" or c == "s" or c == "t" or c == "u" or c == "v" or c == "w" or c == "x" or c == "y" or c == "z" then


That will probably fix all error messages.
 

Leazy

You can change this now in User CP.
Reaction score
50
This is the first time I take time to look into a save/load code, god damn smart way how you did it man, and it's mad easy to implement! GJ & +rep

Edit: I might have been a little too enthusiastic (not saying it's great though) but how do I add so it also saves ability levels? I understood everything but this line:

Code:
Custom script:   set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer( udg_TempItem )

What should I replace that with if I'm storing ability levels?

Thanks in advance
 

Leazy

You can change this now in User CP.
Reaction score
50
Owe, that's what I tried first, I dunno why I changed it though... it's easier than I thought. Thanks!
 

LoveTD's

New Member
Reaction score
34
I have another question on this system:

is it possible to make a code whenever the game ends instead of typing
-save? There won't be a lot of leavers this way ;)

I tryed this:

Trigger:
  • My game is ending
    • Events
      • My game ends <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" />
    • Conditions
    • Actions
      • Set Save[1] = Total_Score_of_player[1]
      • Set Save[2] = double_kills_player[1]
      • Set Save[3] = triple_kills_player[1]
      • Set Save[4] = overkills_player[1]
      • Set Save[5] = killtaculars_player[1]
      • Set Save[6] = killtrocitys_player[1]
      • Set Save[7] = killinmanjaros_player[1]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 1 (Red) for 60.00 seconds the text: Code
      • Set Save[1] = Total_Score_of_player[2]
      • Set Save[2] = double_kills_player[2]
      • Set Save[3] = triple_kills_player[2]
      • Set Save[4] = overkills_player[2]
      • Set Save[5] = killtaculars_player[2]
      • Set Save[6] = killtrocitys_player[2]
      • Set Save[7] = killinmanjaros_player[2]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 2 (Blue) for 60.00 seconds the text: Code
      • Set Save[1] = Total_Score_of_player[3]
      • Set Save[1] = Total_Score_of_player[3]
      • Set Save[2] = double_kills_player[3]
      • Set Save[3] = triple_kills_player[3]
      • Set Save[4] = overkills_player[3]
      • Set Save[5] = killtaculars_player[3]
      • Set Save[6] = killtrocitys_player[3]
      • Set Save[7] = killinmanjaros_player[3]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 3 (Teal) for 60.00 seconds the text: Code
      • Set Save[2] = double_kills_player[4]
      • Set Save[3] = triple_kills_player[4]
      • Set Save[4] = overkills_player[4]
      • Set Save[5] = killtaculars_player[4]
      • Set Save[6] = killtrocitys_player[4]
      • Set Save[7] = killinmanjaros_player[4]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 4 (Purple) for 60.00 seconds the text: Code
      • Set Save[2] = double_kills_player[5]
      • Set Save[3] = triple_kills_player[5]
      • Set Save[4] = overkills_player[5]
      • Set Save[5] = killtaculars_player[5]
      • Set Save[6] = killtrocitys_player[5]
      • Set Save[7] = killinmanjaros_player[5]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 5 (Yellow) for 60.00 seconds the text: Code
      • Set Save[1] = Total_Score_of_player[6]
      • Set Save[2] = double_kills_player[6]
      • Set Save[3] = triple_kills_player[6]
      • Set Save[4] = overkills_player[6]
      • Set Save[5] = killtaculars_player[6]
      • Set Save[6] = killtrocitys_player[6]
      • Set Save[7] = killinmanjaros_player[6]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 6 (Orange) for 60.00 seconds the text: Code
      • Set Save[1] = Total_Score_of_player[7]
      • Set Save[2] = double_kills_player[7]
      • Set Save[3] = triple_kills_player[7]
      • Set Save[4] = overkills_player[7]
      • Set Save[5] = killtaculars_player[7]
      • Set Save[6] = killtrocitys_player[7]
      • Set Save[7] = killinmanjaros_player[7]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 7 (Green) for 60.00 seconds the text: Code
      • Set Save[1] = Total_Score_of_player[8]
      • Set Save[1] = Total_Score_of_player[8]
      • Set Save[2] = double_kills_player[8]
      • Set Save[3] = triple_kills_player[8]
      • Set Save[4] = overkills_player[8]
      • Set Save[5] = killtaculars_player[8]
      • Set Save[6] = killtrocitys_player[8]
      • Set Save[7] = killinmanjaros_player[8]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 8 (Pink) for 60.00 seconds the text: Code
      • Set Save[2] = double_kills_player[9]
      • Set Save[3] = triple_kills_player[9]
      • Set Save[4] = overkills_player[9]
      • Set Save[5] = killtaculars_player[9]
      • Set Save[6] = killtrocitys_player[9]
      • Set Save[7] = killinmanjaros_player[9]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 9 (Gray) for 60.00 seconds the text: Code
      • Set Save[2] = double_kills_player[10]
      • Set Save[3] = triple_kills_player[10]
      • Set Save[4] = overkills_player[10]
      • Set Save[5] = killtaculars_player[10]
      • Set Save[6] = killtrocitys_player[10]
      • Set Save[7] = killinmanjaros_player[10]
      • Set SaveCount = 7
      • Custom script: set udg_Code = SaveLoad_Encode()
      • Game - Display to Player Group - Player 10 (Light Blue) for 60.00 seconds the text: Code


but this didnt work... When I tryed loading this code it said that its an invalid code :(
(didn't loop it since I wanted to see if it works first.. And it didnt :()
 

Bitterstone

New Member
Reaction score
1
Gold & Lumber

I tried this out and i'm afraid this is way too advanced for me even though i've been programming and used the Warcraft Editor for many many years, though i've never ever created a single Custom Script so I don't get any of that. :banghead:

Well, my problem is, I can't seem to get Gold and Lumber to be saved and loaded properly in the "Save Load Hero with items" section. It's probably really easy once you get the hang of it but I just can't get it right.
 

xXGauntletXx

New Member
Reaction score
4
Even if he did, I'm sure there are others here that can help with it, like Romek or andrewgosu.

Anyway this code is working perfectly for me.
 

Lmfaocj

Active Member
Reaction score
1
Lol, Thank you for the code.... This is the first code that ever worked for me... And it's so easy to learn how to edit it to how you want it.
but the only thing that i am having trouble with is the abilities.
 

Lmfaocj

Active Member
Reaction score
1
Trigger:
  • Set AATempInteger = SaveCount
    • Set SaveCount = 1


Trigger:
  • Do Multiple ActionsFor each (Integer SaveCount) from (SaveCount + 1) to AATempInteger, do (Actions)
    • Loop - Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to Save[(SaveCount + 1)], do (Actions)
        • Loop - Actions
          • Custom script: call SelectHeroSkill( GetLastCreatedUnit(), udg_SaveLoad_Abilities[ udg_Save[ udg_SaveCount ] ] )
      • Set SaveCount = (SaveCount + 1)

How does that work?
 

tonton302

Member
Reaction score
0
When i tried to use this save system in my map i saved thn tried to load and it wuld only load the item in slot 1. tried to fix bout 3 times and it never worked...

does any1 no wats wrong?

thanks
 

Animoi666

New Member
Reaction score
0
When i tried to use this save system in my map i saved thn tried to load and it wuld only load the item in slot 1. tried to fix bout 3 times and it never worked...

does any1 no wats wrong?

thanks

-bump-


i got the Exact same problem, haven't managed to solve it yet.
Ace, could you help?
 

Sui-cookie

You can change this now in User CP.
Reaction score
49
guys, seriously =.= stop posting help things here.
POST IN THE DAMN HELP SECTION!

When it's posted there We'll probably help. sorry for being so blunt.. but if you read the responses i wouldn't have had to post this :/

~And btw, ace is gone. has been :/ for a looong time. Though i think he still hangs out and watches from some random account as to whats going on >.>
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top