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

Need a special save-load code

Status
Not open for further replies.
Level 10
Joined
May 31, 2007
Messages
645
Hello everyone!

I want to ask for a favor:
I am making a map that will be RPG-RTS and i need a save-load code that will save:
- Units
- Unit Abilities
- Heroes
- Hero Abilities
- Hero Items
- Gold, Lumber, Food

If anyone can make me a code to save them all (and having too many characters), i would be very grateful. I really need the code as soon as possible. If nobody can make it then at least help me make it myself!!!

Hawk07
 
Last edited:
Level 9
Joined
Jun 26, 2007
Messages
659
i am very busy now and can't pay attention to them
but you're not to busy to pay attention to people who will saying you exactly the same thing as the tutorial? admit that you're just too lazy to search...

summary, you want to make a map but you're too busy to do it quickly by yourself
conclusion: your map isn't an vital emergency, you've all the time to finish it
go read the tutorial when you will be less busy
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
saving that much stuff would certainly be hard.

It would probably end up being horrendously long. A segment for units/how many of that unit, the units' individual abilities, a segment for heroes, a segment for items, a segment for heroes' abilities, a segment for resources, a segment for food. That's already freaking huge, you should try something a little less ambitious before tackling something enormous like that. With a tutorial or without, it's going to take a long time. Wait until you're not busy, then figure out where the tutorials are.

Also, shouldn't this be in the triggering section?
 
Level 10
Joined
May 31, 2007
Messages
645
Yeah guys, i am busy making the map! The problem is I am very new to the whole triggering thing and have no idea how to use JASS as well! That's why I am asking for help. I am making my map right now and have to work on many things. I know the code is ambitious, but I've seen even more complicated codes than this one, so I believe there's a chance of making one. I don't mind it being very long, I just need it work right. If it could use only numbers, it would be much easier to write down. I already have a code to save heroes and items, hero abilities and levels and is really short. Based on such a small code, adding units as well will not make it extraordinarily long or I think so...

P.S. Can you give me the link to the tutorial of making a code to give a look? Is there any other way to save the data I want without making such triggers (I guess no)?
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
Units and the units' individual abilities will make the code hugely long, unless you only expect players to be running around with two or three units total (excluding the hero). Using only numbers would also make the code longer, as you are restricted in what symbols you can use for individual things. An example of this is, 255 in base ten is FF in base 16. Having additional symbols available allows you to shorten how you express numeric values, which is what all your data will be stored as.

I couldn't find the save/load tutorials, but if it's single player you can save it in the game cache and then load the stuff later.
 
Level 9
Joined
Jun 26, 2007
Messages
659
The problem is I am very new to the whole triggering thing and have no idea how to use JASS as well!
one more reason to read the tutorial.
you can't come here and simply said "how does it works?"

read tuto, study existing map, and come back when you've more specific question.

but first, why do you want to save units? to start a fight on a map and finish it on an other one? is your game multiplayer or single one?
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
read tuto, study existing map, and come back when you've more specific question.
He asked for a link. I conducted a Search of the Tutorials Section, using both "save" and "load" as keywords, and didn't find the tutorial, although that may have just been me looking at it and not registering that I saw it.

Edit: I just conducted a Search of the Tutorials Section using the keyword "code", and failed to find the Save/load code tutorial.
 
Level 9
Joined
Jun 26, 2007
Messages
659
and with "cache"?

and maybe we should know before if it's single player or multi

anyway, i was answering to the words "I am very new to the whole triggering thing"
so he should reads tuto about triggerring, not only save and load, but also more generic triggering tuto.
 
Level 3
Joined
Jul 15, 2007
Messages
36
I can offer one suggestion: Kode is a premade save/load system, that plugs in fairly easily, and can be manipulated with GUI (Although the hero save is in JASS).

It can save as many variables as you like. You have to make your own definitions to be able to interpret the code, though, because rawcodes for unit names in particular are very VERY big.

For example, if you have 8 possible hero types, you make a unit-type array; Hero_Type[1] being mountain king, Hero_Type[2] being illidan, etc. etc. When you process the code, and it returns "2" , you run a trigger "Create N units of type "Hero_Type[returnedvalue]" at loc facing direction"

I wouldn't save what unit types they have; instead save how many of each unit typoe they have; a number from 1 - 20 is much smaller than the rawcodes. Even if you have 50 different units, it is still easier.

Gold, lumber, food are easy.

If there is a limit to the abilities a hero can have (i.e. 4) and it depends on the hero type that is loaded, you can have predefined "1 = Slam", "2 = Chain lightning" "3 = heal" "4 = drunken brawler" and have whcih four it is vary on the unit; you return 4 values from the code, and whallah!
if you want to think even more, you can use a "binary" code to compress it more, where 2 = slam, 4 = chain lightning, 8 = heal, 16 = drunken brawler, so that 2 = slam alone, 10 equals heal and slam, 20 = drunken brawler and chain lightning (i.e 2 ^ 2 (chain lightning) + 2 ^ 4 (drunken brawler) = 20 )

I would do similar with the unit abilities available (as long as they are global. once you start defining seperate abilities for each unit you run into trouble)



Hope that helps. I do reccomend Kode. I believe it is available on this site, but the link above gives you teh how-to information

Cheers, and good luck


=============={edit}==============

if you are making a single-player map, you can use something called gamecaches; they are used to save information for campaigns, for instance, and also in advanced spells to make them multi-user-instancable (for example, structs). This only works for single-player to load the next time the map is played.

A save/load is essential for multiplayer.
 
Level 10
Joined
May 31, 2007
Messages
645
Well, actually it will be multiplayer and here's something from the scenario:
The players will begin with a Hero and some very strong units that will use to fight against vast hordes of monsters and get to their citadel. The hero will be able to buy some mercenaries (i don't want to save the mercenaries, only the beggining units that will have a 6-slot inventory as well as the hero and unique abilities acquired from some specially triggered items). After they reach the Citadel, they will be able to go wherever and they'll get items and so.

I thought again the whole thing and decided that if letters can make the code shorter, no problem. About the Kode system, i gave it a look previously, but I can't understand it at all, so I can't make a succesful code. If someone could help me modify it a little...



...I amy abandon the project, not because of the code but becuse i am unable to complete something else. Anyway, if anyone makes the code or has some more helpful information, please post it here, as it may prove to be useful!!!
 
Last edited:
Status
Not open for further replies.
Top