About Store Forum Documentation Contact



Post Reply 
Adding custom files to the project
Author Message
MrPi Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
Rofar Offline
Member

Post: #2
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
Find all posts by this user Quote this message in a reply
Scarlet Thread Offline
Member

Post: #3
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);
(This post was last modified: 12-20-2013 12:52 AM by Scarlet Thread.)
12-20-2013 12:51 AM
Find all posts by this user Quote this message in a reply
MrPi Offline
Member

Post: #4
RE: Adding custom files to the project
Alright, via Reload it worked ok. Clever Rofar. wink

I got the filename like this:

Str(EE_PROJECT_PATH).tailSlash(true) + EncodeFileName(fileuid)
12-20-2013 01:05 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
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
Find all posts by this user Quote this message in a reply
MrPi Offline
Member

Post: #6
RE: Adding custom files to the project
Thanks, guys.
12-20-2013 10:48 AM
Find all posts by this user Quote this message in a reply
Post Reply