MrPi
Member
|
Adding custom files to the project
I'm trying to add a custom file to the project (type "Raw File"), but it somehow doesn't work. I wonder whether I'm doing something wrong.
Here is what I tried:
1) Drag&drop the file into the project tree
2) Manually adding a file "Raw File" in the project and dragging my file onto that
The file is a definition file in text format. I would like to add all those to the project.
However, would it even be possible to read those project files as TextData? I didn't see it accepting a UID parameter.
(This post was last modified: 12-19-2013 08:12 PM by MrPi.)
|
|
12-19-2013 07:35 PM |
|
Rofar
Member
|
RE: Adding custom files to the project
I find it best to create a new element (Raw File) and then right click it and select "Reload" and navigate to the source file.
You can convert a UID to file name so you shouldn't have a problem reading those as TextData. I can't remember the function name to convert the UID to file name but it is starts with "Encode".
|
|
12-20-2013 12:38 AM |
|
Scarlet Thread
Member
|
RE: Adding custom files to the project
(12-20-2013 12:38 AM)Rofar Wrote: I find it best to create a new element (Raw File) and then right click it and select "Reload" and navigate to the source file.
You can convert a UID to file name so you shouldn't have a problem reading those as TextData. I can't remember the function name to convert the UID to file name but it is starts with "Encode".
That is the only way to do it.
The function is EncodeFileName(UID);
|
|
12-20-2013 12:51 AM |
|
MrPi
Member
|
RE: Adding custom files to the project
Alright, via Reload it worked ok. Clever Rofar.
I got the filename like this:
Str(EE_PROJECT_PATH).tailSlash(true) + EncodeFileName(fileuid)
|
|
12-20-2013 01:05 AM |
|
Esenthel
Administrator
|
RE: Adding custom files to the project
Please skip the Str(EE_PROJECT_PATH).tailSlash(true) and do just EncodeFileName
as all EE IO based functions will use the DataPath (used in development) or Paks (used when publishing) automatically.
|
|
12-20-2013 01:46 AM |
|
MrPi
Member
|
RE: Adding custom files to the project
Thanks, guys.
|
|
12-20-2013 10:48 AM |
|