Problem with accessing external lists in Developer Help
|
|
In my game got a several external .txt files which I'm using as lists, using Deadron's Text Handling library function "file2list". It all works fine when I compile the code and run it through Dream Maker, but when I uploaded the packaged files to the hub and tried to run it, none of the lists were apparently accessed. For instance the random names didn't appear. Here's the code for accessing the lists:
proc LoadNames(directory="data/") var/list/male_name = dd_file2list("[directory]male_names.txt") var/list/female_name = dd_file2list("[directory]female_names.txt") var/list/surname = dd_file2list("[directory]last_names.txt") var/list/weapons = dd_file2list("[directory]weapon_types.txt") var/list/materials = dd_file2list("[directory]material_types.txt") var/list/idle = dd_file2list("[directory]idle_messages.txt")
|
The files are contained in the games directory in the Byond folder in a folder named "data", and the LoadNames proc is called in World.New().
Can anyone shed some light on this, please?
|
When you use double quotes ("X"), it searches for the file in the given location - but it is not added to the RSC.
So when you uploaded the package file, the said directory was not included thus when it tried looking for the files in "[X]", it couldn't find it simply because that host did not have that specific directory+files.