Feche1320 Posted January 21, 2013 Share Posted January 21, 2013 I was on some race servers that map download is instant, objects are loaded as soon the resource is loaded avoiding map downloads.. how is this done? thanks : Link to comment
Castillo Posted January 21, 2013 Share Posted January 21, 2013 Not sure, maybe they made their maps to be created with createObject server side. Link to comment
Feche1320 Posted January 21, 2013 Author Share Posted January 21, 2013 Mhhh, maybe I know how, thanks for the clue. Link to comment
Feche1320 Posted January 21, 2013 Author Share Posted January 21, 2013 Okay I have a problem.. my idea was to read the .map file serverside and then create the objects, but in order to load the map scripts, resource has to be started, but if I start the resource, map download appears again.. any idea on how to fix this? Link to comment
Castillo Posted January 21, 2013 Share Posted January 21, 2013 Remove the map file from meta.xml, read it as a XML file. Link to comment
Feche1320 Posted January 21, 2013 Author Share Posted January 21, 2013 But I have more than 800 maps lol Edit: better question, is there any function to load a specific .lua file? for example: loadLuaScript("scriptname.lua") Link to comment
Anderl Posted January 21, 2013 Share Posted January 21, 2013 You could create a download manager which would load any resource instantly ( you could do something different for known types of files and simply read unknown type files and create new ones with same name and content in client ). Use: loadstring --for loading Lua files dxCreateTexture -- for loading image files And you could read a XML file ( map files ) in the server and create objects and other things there. Link to comment
Feche1320 Posted January 21, 2013 Author Share Posted January 21, 2013 Thank you! I will see what I can do Link to comment
Feche1320 Posted January 22, 2013 Author Share Posted January 22, 2013 Okay, I managed to create the objects serverside, no more download but I have issues to load the clienside scripts.. any help please? thanks Link to comment
Anderl Posted January 22, 2013 Share Posted January 22, 2013 Read Lua files in server, send it to client and use loadstring. Link to comment
Feche1320 Posted January 22, 2013 Author Share Posted January 22, 2013 Ah, that is smart. And what about music mp3 and images files? Link to comment
Anderl Posted January 22, 2013 Share Posted January 22, 2013 For music files, get the file's content in the server side and send it to the client, there you should create a new file with same name and with the content you passed to the client. As for image files, get the file's content, send it to the client and use dxCreateTexture. Just note you will not be able to load the pictures in GUI elements neither DDS, BMP and TGA files. For that, you'll need to do the same as I already said above ( music files procedure ). Link to comment
Feche1320 Posted January 22, 2013 Author Share Posted January 22, 2013 So I should use downloadFile? Link to comment
Anderl Posted January 22, 2013 Share Posted January 22, 2013 I didn't say that. I explained what should you do and what functions you needed for that, just re-read the topic. Link to comment
Feche1320 Posted January 24, 2013 Author Share Posted January 24, 2013 How do I get the file content and send it to client? Link to comment
Anderl Posted January 24, 2013 Share Posted January 24, 2013 Using file functions and triggerClientEvent. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now