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

preload a txt file, why so advanced?

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
hey, I just found out that I can use the preload function to create txt files with 3 lines of code. how come people take it as such advanced stuff? most people will only use short texts like "code: asds-asda-asdf-asdas". so I don't think it causes lagg or something

I see no point makeing whole systems for that -.-
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
I got a load code from gaias and I tried to save the code and it work just fine with 3 rows of code.

my text doc showed me this.

function PreloadFiles takes nothing returns nothing
call Preload( "-load KEUg-YaNc-rDDq-wQ54-9Zyr-7Wm2-mp5W-YaS2-77HP-4Cg3-aZbP-PxZp-SQs2-h" )
call PreloadEnd( 0.0 )
endfunction

tho I haven't tested it multiplayer
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
i guess that the point, also example in my case , on what i working, each item get alot properties (70-80) each item what not depend on item type, after 20 inventory slot+6 normal inventory+ 10equipment slot +socket/refine on equipments is far longer than 4-5x your code :/
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
You're talking about File IO by Nestharus, right?
As far as I know, there were 2 problems with it:
1) All players must constantly be synchronized (don't want any desyncs to happen). This is where the Network-system comes in.
2) You had to have some registry key settings enabled to allow for these files to be read. This has been solved by using Preload to create an executable file that automatically sets that registry key.

There was also something having to do with settings player names to actually make it work I believe?
Don't know the specifics on that.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
I saw it in nest's system yes and after that I saw one another by radamantus I don't remember his new name -.-.

1. that would indeed cause troubles if you do desync but I have only single player in mind so far.
2. I belive it is "enable local files" which I have enabled

but lets say I use get local player to store variables wouldn't that be the same as network?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I think Almia/Rada's system is just a GUI-version of File IO by Nes (I actually have to look this up, but I'm a bit lazy).

Well, for single player desyncs won't cause any problems indeed :p.
You may have local files enabled, but people playing your game might not.

But if it's for single player, why not just use a game cache?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Nestharus' system is a much better way that segments the given data into multiple lines and files, and then reconstructs it the same way when loading.

Almia's (Magtheridon96's code AFAIK) just writes a log file, which is useful for debugging things like fatals.

I've done some experimentation myself, using GetLocalPlayer seems to desync it. Maybe I was just using it wrong; I'll probably give it another shot.
 
Status
Not open for further replies.
Top