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

save/load issue

Status
Not open for further replies.
http://www.hiveworkshop.com/threads/codegen-1-0-2.177395/

That one should work a lot better then the codeless one until everyone realizes how to use local files which likely will be another year at least though I hope sooner.

That one is slightly easier to use and works in the Vanilla world editor.

But, there's really no reason to not implement a code-less loading system anymore. Enabling local files is completely optional, you can still load with a code if you don't have it enabled.

You can integrate whatever save system you like with it as well.
 
Level 6
Joined
May 20, 2014
Messages
228
You can't just import a system and expect it to work on itself. Every save/load system you have to manually add what hero to save, what part of the player's to save (gold/lumber/some your own variable that you might have added that serve as a counter for progression) etc etc., if you're experiencing some difficulty because 'it doesn't work' then you haven't modified the system to your needs, or you might have done something wrong or did not follow the documentation.
 
Level 10
Joined
Feb 27, 2016
Messages
617
Ok guys it seems like i am noob
but guys i also think nobody even cares about my map what i expected already its just not a lot of fun to have 2 dislikes on your map video and also if its gonna release i know there is gonna be NOBODY who would like to play it...
i hope you get what i was trying to say.... :-(
 
Last edited:
Level 20
Joined
Feb 23, 2014
Messages
1,264
Yes, you are new.
And you're making a rookie mistake - you begin your map making adventure with a too ambitious idea. Just start with something more basic. I's easier to learn how the editor works if you do it step by step.

Also... What did you expect? You have a vision in your head and I'm sure that to you its an awesome one, but what people see in your video is... Just some map that is extremely basic and barely had any development put into it.

I don't want to be rude, but what you shown so far could easily be replicated within a few minutes by pretty much any map maker who knows what he is doing.

If this was someone else's map - would you be interested in it in the state it is now? I'm pretty sure not. What I'm trying to say is that if you want people to be interested in your map, you have to flesh it out more first, so that there is something the viewers might get excited about.

Or, at the very least you need to convey a passionate and intruiging vision that you have for your project. And it has to be concrete - you didn't really do that.

I'm nit trying to discourage you - I just want you to explain what probably was the reason behind those dislikes.
 
Level 9
Joined
May 21, 2014
Messages
580
Ok guys it seems like i am noob
but guys i also think nobody even cares about my map what i expected already its just not a lot of fun to have 2 dislikes on your map video and also if its gonna release i know there is gonna be NOBODY who would like to play it...
i hope you get what i was trying to say.... :-(
Yes, you are new.
And you're making a rookie mistake - you begin your map making adventure with a too ambitious idea. Just start with something more basic. I's easier to learn how the editor works if you do it step by step.

Also... What did you expect? You have a vision in your head and I'm sure that to you its an awesome one, but what people see in your video is... Just some map that is extremely basic and barely had any development put into it.

I don't want to be rude, but what you shown so far could easily be replicated within a few minutes by pretty much any map maker who knows what he is doing.

If this was someone else's map - would you be interested in it in the state it is now? I'm pretty sure not. What I'm trying to say is that if you want people to be interested in your map, you have to flesh it out more first, so that there is something the viewers might get excited about.

Or, at the very least you need to convey a passionate and intruiging vision that you have for your project. And it has to be concrete - you didn't really do that.

I'm nit trying to discourage you - I just want you to explain what probably was the reason behind those dislikes.

This. Also, search for tutorials. Deep studying can lead you to something.
Before posting 'nobody cares', try comprehending your said vision; not get discouraged. It happens to all of us. You ain't alone.

So, in order to solve your current problem now, you have to set steps on how to do it and know what exactly are the features you wanted to add.

So, Save/Load code, is it not?

What is a Save/Load code in my map?
It is something that I need so that I can STORE some statistics and status and data and whatever so that the next game they play my map, they have benefits according to what they have progressed through my map.

In order to have a Save-Load code feature, you need the following prerequisites or requirements to even implement a such.
1. You need a complete set of features of your map.
Why is this? Because to begin with, you are saving statistics and status of current game or units through a code.
Do you already have the full features? As far as I know, this is implemented when your map is near finished in what I assume isn't yet.
2. You need knowledge of string manipulation and massive data storage.
Yes. You need to know which data structures to use. What are Data Structures? What is String Manipulation? Well, you go learn it, lad.
3. ???
I will leave the other requirements to you. I want you to learn the art of making something. This is a very crucial method. You gotta learn it.
 
Level 9
Joined
May 21, 2014
Messages
580
thx for feedback...
vid:

It is best to leave Save/Load feature for now because your map isn't even 99% finished. Reread my post for you. You need to have full features so that you can decide and easily code your own save/load.

If you code and make the save/load feature right now, and you added a lot more stuff, you will have to edit the save/load feature again.
 
Level 10
Joined
Feb 27, 2016
Messages
617
I am way to noob to make a save/load by myself
and the thing is that i learn slow i wanna complete this map asap
so i just need the save/load i know EVERYTHING else or i search it but just this pls just say how i have to do i dont say that you already explaint it cause i dont get that post
just make a video or a REAL tatorial so i can see step for step what i have to do i do everything right the save/load schould work but just its being disabled due errors so pls triggerhappy or any of you guys just say me what i have to do and dont say: you have to learn it cause i WONT.
 
Last edited:
Level 9
Joined
May 21, 2014
Messages
580
I am way to noob to make a save/load by myself
and the thing is that i learn slow i wanna complete this map asap
so i just need the save/load i know EVERYTHING else or i search it but just this pls just say how i have to do i dont say that you already explaint it cause i dont get that post
just make a video or a REAL tatorial so i can see step for step what i have to do i do everything right the save/load schould work but just its being disabled due errors so pls triggerhappy or any of you guys just say me what i have to do and dont say: you have to learn it cause i WONT.

That's that then. You have entered the demise and dark ages. Tutorial? Even if I create a tutorial for you, you won't be able to follow. Why? Because you won't even really get what I'll be saying. You'll be bombarded with terms and things like that that are too technical. Saying that you refuse to learn is also saying that you want someone to do it for you.

You don't get the post? String manipulation? Well that's the end then, lol. because creating the save load code is all about string manipulation.
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
That's that then. You have entered the demise and dark ages. Tutorial? Even if I create a tutorial for you, you won't be able to follow. Why? Because you won't even really get what I'll be saying. You'll be bombarded with terms and things like that that are too technical. Saying that you refuse to learn is also saying that you want someone to do it for you.
This^.
I was going to write something to him as well, but then I realized that unless I waste a ton of my time to write a noob-friendly tutorial for him, he just won't listen anyway. I think we should just let him do whatever he wants - it will fail horribly, but I guess he just has to learn it the hard way.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Here. An interactive noob friendly tutorial. I personally think it is an amazing tutorial. I wrote it many years ago. To run it, play the map. Don't try to go through the code in World Editor. Play the map.

https://github.com/nestharus/JASS/blob/master/jass/Tutorials/Interactive Saving and Loading Tutorial (1).w3m?raw=true


Also, in the map, when you get to CRC, it says to add one first... uhm, here is a smarter way

Create code
Calculate checksum
Recreate code by first adding checksum and then appending everything to code


When loading code, load code to get checksum out (get list of values)
Recompile code with list of values, calculate checksum, compare checksums

This will reduce the size of the code at the cost of some speed.
 
Last edited:
Level 31
Joined
Jul 10, 2007
Messages
6,306
Well, if a code is made up of values, it is up to you to push values into the code. You have to define what values you want to save.

There is even more than this though... you also have to create what are called catalogs.


This is true for either codeless or non-codeless save/load.


Otherwise it is as simple as this (not actual code, but very similar)


JASS:
call save(5) // arbitrary number I picked
call save(12) // arbitrary number I picked
call save(6) // arbitrary number I picked

call load() // 5 for codeless, 6 for non-codeless
call load() // 12
call load() // 6 for codeless, 5 for non-codeless

If you notice, loiading is backwards in non-codeless : ).


So, to begin with, save/load is as easy as what I just put. You just save numbers. You call load to load them up in either the order you saved them in or reverse order depending on the system. The system will document the order.

Beyond this, the catalogs will turn a big number like 34983943 ijnto a number like 1. The map I posted demonstrates this.

Oh, but wait, there is more.

There are techniques for saving inventories, coordinates, gold, lumber, health, mana, abilities, and so forth. The map I posted goes over these techniques. There is also a very useful lib called save/load with snippets that contains all of the algos you need + catalogs. You can then throw these into TriggerHappy's codeless save/load (until I get mine up) and you've got yourself a good combo.


People are recommending you learn how save/load work because to do good save/load, you need to understand it. The system is just there so you don't have to code it ^_^. save/load is a semi-complicated business. A lot of the people on THW know how save/load works at this point. I like to think my efforts with the tuts and stuff contributed to this : ).


Now, if you know next to nothing about mapping, my recommendation is to save the beast of save/load for last. That is everyone else's recommendation too. Don't take save/load lightly : p.

TriggerHappy's save/load is about as difficult to use as acehart's, making it one of the easiest to use save/load systems in the community. However, it is lacking tuts and stuff ; (, as noted by Bribe.



The map I posted goes over all of the techniques. Save/load with snippets contains the algorithms. TriggerHappy's lib contains a decent codeless save/load system. Combine these to get your knowledge, your algorithms, and your lib. Alternatively, if you are really ambitious, you can take TriggerHappy's synchronization lib and combine it with my StringPacket algorithm from my synchronization lib, then you can take the wc3 hack stuff for bitwise and combine it with my BitInt and you've got godmode.
 
Last edited:
Level 10
Joined
Feb 27, 2016
Messages
617
but i am not english in am really newbut still the save/load code how i do that you guys all explain me i know i have to know that
i know its much work but can you guys show the triggers i have to make?
i know it seems like i am just asking everything to you guys its just that i think and its 99.99% true that you guys know tons of more about the world editor
i am actually asking for a video that explains but as you can already see masterblaster and blancfaye7 are now stopping helping me so nestharus can you make a video or a tatorial that shows the triggers
from how to import CodeGen?I am just really noob in importing spells

sorry i am noob so dont be mad if i say something wrong
if you guys ahve already explaint then pls say it and dont be mad
 
Level 9
Joined
May 21, 2014
Messages
580
You gotta read the tutorials... Because basic is everything. You clearly need to understand the world editor.
I've already said what you need to do. Not only am I making a plan for you, but I am also enlightening you what you should do; then you kept saying you don't understand. It's me who's running out of options for you... lol.
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
i know its much work but can you guys show the triggers i have to make?
That's the thing - we can't. And not because we're mad at you :)
Save/load system is something that you should do once your map is nearly completed, because the code you are given is not a simple copy-paste thing and thus it might need some adjustments to your map. We have no way of knowing what exactly is inside your map and what values you wish to store, so we cannot tell you exactly what triggers to use to adjust the system to your needs. That is something you should do yourself.

Plus - you really should try to learn the basics. You will need this to complete your map anyway - and what I mean by that is adding cinematics, events, respawns, etc. I understand that getting your map out there is an exciting prospect, but unless you take your time to improve and learn, there's a strong chance you will release a map that is simply not that good.

as you can already see masterblaster and blancfaye7 are now stopping helping me
I don't have a lot of experience with save/load systems, so while I understand the code and I'm confident that I could make it work, I feel like more experienced users would be of better help to you. That said, I'm just trying to give you some general map making advice - i.e. not to skip learning things along the way, because it might not hurt you right now, but it definetely will in the future.

how to import CodeGen?I am just really noob in importing spells
It was already explained in the CodeGen resource page:
1. Remember to set "Create unknown variables when pasting triggers" option in the editor's preferences menu.
2. Copy-paste the folder and any custom script to your map.
3. Adjust the system where needed to make it work with your map.

I believe you're past step 1&2, so if it doesn't work - you're left with step 3 that we cannot really help you with unless you know the basics and your map is nearly completed (i.e. you have everything you'd want to store in place).
 
Level 9
Joined
May 21, 2014
Messages
580
Imagine it.
I've said this many, many. many times.

Why do you need the Save/Load code system?
Because you want to HAVE PLAYERS SAVE THEIR DATA FOR THE SAKE OF REPLAYABILITY.
If this is not the case, then Save/Load Code is not the system you will need.

WHEN SHOULD I CREATE THE SAVE/LOAD SYSTEM?
You are going to create it when your map is 99% COMPLETE.

Is your map currently at this state?
Answer this yourself.

Why 99%?
Because that is the state of your map where ALL the DATA you will NEED to store are ALREADY DONE.
 
Level 9
Joined
May 21, 2014
Messages
580
3. Adjust the system where needed to make it work with your map.
what do you mean with that?

and also sorry dude you still help me i am sorry...

Importing the system itself by CodeGen will not work. You need to tinker on it because the system needs you to do so (probably as stated by CodeGen too).
The system does not work at import, basically. You still need to configure the system so that it will work on your map.
And such configuration would require you to be at 99%.
 
Level 9
Joined
May 21, 2014
Messages
580
guys i did this all only the items i have to do but do you watch the video?
ITS DISABLED DUE ERRORS sorry i dont want you guys to be mad at me again

I watched it. But I wouldn't really bother yet. Because my goal is to straighten your development techniques properly. Then we'll move along to the save/load issues, whether it's an error due to import, variables, etc.
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
Sluk - NO ONE IS/WAS MAD AT YOU!
The reason we don't help much is... Well... Let me explain in simple words - imagine you want to cook something. Would you start cooking before you had all the ingridients or would you rather get the ingridients first and start cooking once you had everything you need?

What you are trying to do now is like cooking when you don't have all the ingridients you need - sure, you might do some progress, but sooner or later you will end up screwing yourself up.

Conclusion? Just get your map almost ready and come back then.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
no reason he can't set up the skeleton and add data to it as it becomes available. I've done that before -.-.

Imma just call you guys out as being wrong. You can even start with save/load if you want. It doesn't make much of a difference.


There is something else that's wrong. You don't tinker with code or do configuration. Save/Load systems are map specific. The most you'll get are general libs to help you make a system and maybe some templates to help you get started. You are expected to make the system yourself. This is the reason why just cnp isn't going to work. It's like going File -> New in Microsoft Word and handing the blank document in as a research paper. You gotta fill it in : P.


There is no reason why you can't have that blank doc in your map from the get-go and fill it in over time.


A lot of misinformation and bad advice in this thread.
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
no reason he can't set up the skeleton and add data to it as it becomes available. I've done that before -.-.
I didn't say that you can't do that - you absolutely can, but... Understand, you are someone who obviously has a lot of experience with save/load systems and the editor in general, so it'd be much, much easier for you to do it. Meanwhile, our friend over there doesn't have this luxury and I believe it will be easier for him to just do everything in one go rather than come back to it over time, because:

1. As he completes his map, he will learn some things that will give him a better understanding of how things work - sure, they might not completely relate to string storage or save/load systems, but even though - learning the most basic things should make it a bit easier to figure out the more advanced stuff or even understand what we are talking about here.

2. As you probably know, a loooot of things change during the development of a map. What he has now might end up being completely replaced/reworked, especially considering that he is still fairly new - i.e. might not necessarily have everything figured out from the start and has the potential to discover a lot of stuff he'd want to use. And if the save/load system utilizes the data that he would change, the system itself might need editing as well. Sure, this is not a problem for someone with experience, but having to go back to it every now and then could be really confusing for a person who is relatively new.

3. The thing about playing with things you don't understand/are new to is that you might forget how you did certain things. Let's say he pastes the code now and makes it so that it saves his hero, but in like 1-2 weeks he decides he wants to add storing items or gold, etc. He could just forget and be forced to figure stuff out again. If, however, he does everything in a relatively short time, once he gets a grip of what he is doing, it should be easier for him.

Imma just call you guys out as being wrong. You can even start with save/load if you want. It doesn't make much of a difference.
Except - I don't think we are wrong. As stated above, we don't say it cannot be done - we're saying that he shouldn't (=/= can't) do it right now. He's new to map making, there's a lot of stuff he doesn't know or understand - so yeah, while starting with save/load system wouldn't make much of a difference for someone like you, doing so most likely will make a difference for him.

You are expected to make the system yourself. This is the reason why just cnp isn't going to work.
So it comes down to the exact same thing, i.e. you have to copy what you are given and then work with it to make it compatible with your map :)

There is no reason why you can't have that blank doc in your map from the get-go and fill it in over time.
Well, I see no reason why he should either. It's a matter of personal preference, I guess. But, if he doesn't work on it now (and I believe he shouldn't), I see no point in pasting the code and just letting it sit there.

A lot of misinformation and bad advice in this thread.
I'd disagree.
I think the difference between what we are saying is that you assume he is capable of comprehending the save/load mechanics right now, whereas I see that he is still quite new to the editor and should just start with easier things, learn some basics and then go back to the more advances systems.

It's not a matter of "it's impossible to do it", but a matter of "it would be easier to do it a bit later" :) And that's all that I'm saying.
 
Last edited:
Level 9
Joined
May 21, 2014
Messages
580
MasterBlaster already pointed it out. In order for Nestharus's method to work (start with save/load code) you have to get a very clear picture of what the map is going to be.

We have a new mapmaker here; he will edit and edit and edit the code if he will add a feature that needs to be saved.
As a beginner, what we are suggesting is a good pace to start. The basics are the key to more advanced doors that Sluk must unlock. There is no shortcut for this.
 
Last edited:
Level 9
Joined
May 21, 2014
Messages
580
It's better to make a Map Development Thread for this.
From there you can gather help you can, because this is slightly off topic from your thread title.

Answering though:

Make a loop.
  • For every integer A do actions
    • var point_temp = Random Point from Any Region
    • Create a Barrel Doodad at point_temp
    • Custom Script: call RemoveLocation(udg_point_temp)
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
It might not be the best way to do it, but... I imagine what you want to do is have randomized destructible objects that drop loot in your map. Personally, I'd try something like this:

1) I'd create a special type of destructible in an object editor (you can just copy barrels or crates or whatever and add editor suffix to them so you can differentiate them from the others).

2) I'd manually place these destructibles on the map and set their loot.

3) Then I would use something like this:

  • For every integer A from 1 to X do actions:
    • Destructible - Remove (Random destructible in (Playable Map Area) matching (Destructible type of (Matching Destructible) Equal to (Your Destructible))
---

What it will do is remove random X destructibles of the specified type from your map.
So, if you place like 30 and you set X to 10, it will remove 10 random destructibles of that type from your map. That will leave you with 20 random destructibles you placed left, so every time someone plays your map, he will have a different set of locations for the destructibles available.

The reason why I would do it this way is primarily because by doing so you have some control as to where the destructibles will be and you avoid something like a destructible spawning in weird places (in the middle of the road or on top of one another) or somewhere where the player can't reach them (like on a hill or in the middle of the trees).
 
Last edited:
Status
Not open for further replies.
Top