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

[General] Automatically loading stats, hero, whatsoever with no code

Status
Not open for further replies.

Ardenian

A

Ardenian

Hello,

before presenting my question, I would like to say that I have no knowledge about coding, Jass or whatsoever is required for the following.

I am working on a map containing very many models, so I will have to use a custom MPQ once it is finished one day.
But, the more important point, my map contains about five different loading codes and it is very annoying to have to CnP them and load them into the map.
Note: It is not my question how I can improve this.

Now, the question: Is it possible to load stuff from a certain file without having to do anything ? ( like in StarCraft II custom games)
So, the player starts the game ( in multi player !), after he finishes loading he enters the map and he gets his hero from the previous game, having all items, having a backpack and so on.

I remember reading that Nestharus was developing such a system, but I recall I read he dropped it or never continued.

Is there any way to load ( in multi player !) from files ? Like simulating the player typed in a code whereas he didn't do anything.
 

Ardenian

A

Ardenian

Uhm, if you can answer the first one ( your 1.), then I am fine with it.

No, it is not about loading heroes, I know there exists CodeGen for.

I basically want to know whether it is possible to create a CodeGen that runs without the player having done anything, like not typing in anything.
It is possible in single player, but I would like to know whether it is possible for multi player, too.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Yes Nestharus wrote a system for it which still can be found on his github account.

However most likely I would advise you against using it, as it uses vJass and contains a lot of stuff you probably won't need.

Look at this thread to see the smallest required code. Note though that in order to load, a player has to have 'local files' enabled.
 
Here are the answers for your questions and one you didn't ask, but I'd still like to answer, because you definitely should know about this before going on with your project:

1) Nestharus Codegen is able to save and load "codeless". You can make it automaticly load on the beginning of a game by simply only having one text file to write/read.
This, however, won't prevent players from making a copy of the text file and storing it in a different folder, effectively having as many savegames as they want. So if you want to prevent players from having multiple savegames, then unfortunately, this is not possible.

2) Codegen requires to enable local file support in the windows registry, which is off by default. It can write (save) without this option enabled, but you can not read (load) until you enabled this option and restarted the game. So, in order to load a multiplayer game with codegen, you need to instruct all players on how to edit the registry.

3) Using a custom MPQ, as you have mentioned, is also not possible without enabling local file support. Also, all players would need to have this custom MPQ, or the game will simply not display any models that aren't replacements for existing models.

There is another thing that I'd like to mention:
Even with all players enabling local file support, Codegen needs to synchronize all data every game, which can take up to several minutes depending on the amount of data saved.
You better prepare a good intro cinematic or minigame for your map...


There is, however, another option, which is using hostbot services directly to store and read data online.
This would require having your own hostbot, though.
You can set it up so players transmit all savegame data to the hostbot, the bot stores it on it's server and reads it from the database based on player names on map initialization. This, however, requires player names to be unique, which is not neccesarily a given. Also, it obviously requires your own server.

Why do you have 5 loading codes btw? Are the codes too long so that they need to be split up? In this case, I seriously question the effectivity of compression you are applying to your codes. I managed to fit a huge amount of data in a rather short code by applying maximum compression via a dictionary implementation.

Yes Nestharus wrote a system for it which still can be found on his github account.

However most likely I would advise you against using it, as it uses vJass and contains a lot of stuff you probably won't need.

Look at this thread to see the smallest required code. Note though that in order to load, a player has to have 'local files' enabled.
This is terrible advice, not using a system just because it uses vJass. Why do you encourage people to stay away from Jass, ffs?

Also, this snippet is only half the truth. Getting the data from a file is easy. Synchronizing it is the problem!
 

Ardenian

A

Ardenian

First of all, thank you very much for your detailed answer.

For 1.) and 2.) I think I confused something.
I thought CodeGen would create a txt file in a directory where the player can copy the loading code, having to paste it in-game, as in Gaia's (?) or TKOK.
I think it is alright that players can have multiple saves, yes, it is a feature that should show up.
For 2.) and 3.), enabling local files for the MPQ allows me at the same time using the codeless CodeGen ?

I think a hostbot is a difficult option, they cost money to be owned/ used, don't they ?

About the amount of codes, the numbers are only placeholders. But, considering that there is going to be saved data like hero, items of hero, hero abilities, items of several backpacks, like materials, equipment, bank slots, achievements, tech trees, ... I think five is a realistic number.

The problem with Jass and vJass is that it forces me to use the JNGP, doesn't it ? I use the default WE and I don't feel comfortable using JNGP.

As I said in the first post, I am not experienced with codes or coding/ triggers, therefore I have a very limited view on this subject.
I am glad that you take the time, Ezekiel12 and Zwiebelchen.
 
Level 11
Joined
Jun 2, 2013
Messages
613
First of all, thank you very much for your detailed answer.

The problem with Jass and vJass is that it forces me to use the JNGP, doesn't it ? I use the default WE and I don't feel comfortable using JNGP.

Actually I think Jass can be used with the standard editor; vJass does require JNPG. Don't quote me on this though as I'm not 100% sure. I've used the JNPG since it was a baby.
 

Ardenian

A

Ardenian

Well, then there should be no problem using the method with local files and CodeGen.
 
First of all, thank you very much for your detailed answer.

For 1.) and 2.) I think I confused something.
I thought CodeGen would create a txt file in a directory where the player can copy the loading code, having to paste it in-game, as in Gaia's (?) or TKOK.
Writing a savecode into a textfile does not require Codegen. Actually, writing a savecode (or anything) into a textfile only requires 4 lines of code and works for everyone, not just those with local file support enabled, hence why so many people do that nowadays.
Loading from a textfile without players copy & pasting the string manually is a different story. This requires local file support enabled and a complicated system to synchronize data in multiplayer.

I think it is alright that players can have multiple saves, yes, it is a feature that should show up.
If you can't prevent it, embrace it, that's a sound advice.

For 2.) and 3.), enabling local files for the MPQ allows me at the same time using the codeless CodeGen ?
Yes.

I think a hostbot is a difficult option, they cost money to be owned/ used, don't they ?
Correct. Unless Makemehost allows storing data online on their bots, no way to do this without investing money. You could, however, run your own server at home if you're tech savvy... Then you basicly have all freedom in the world.

About the amount of codes, the numbers are only placeholders. But, considering that there is going to be saved data like hero, items of hero, hero abilities, items of several backpacks, like materials, equipment, bank slots, achievements, tech trees, ... I think five is a realistic number.
All this can easily fit into a single save-code if you do it right. I recommend using Save/Load /w snippets from Nestharus instead of codegen. It provides extension modules and a compression dictionary.

The problem with Jass and vJass is that it forces me to use the JNGP, doesn't it ? I use the default WE and I don't feel comfortable using JNGP.
JNGP is the default in this community for a reason. Use it! You can thank me later.

As I said in the first post, I am not experienced with codes or coding/ triggers, therefore I have a very limited view on this subject.
I am glad that you take the time, Ezekiel12 and Zwiebelchen.
You're welcome.
 
Status
Not open for further replies.
Top