Add code to project with perforce

I’m working on project with perforce and trying to use Files->Add code to project then on final stage I’ve got error: Failed to add class MyClass. Failed to generate project files.
That’s becuase p4 sets READ-ONLY flag on every file.

I think UE should remove this flag on project files while it adds class.

Have solved it by myself. When you will add new files to perforce depot, just set property (in file type submenu in perforce), for project files +w to let them be always writetable.

I know you can change the file type to +w after you create the file, but that doesn’t really help when initially creating the c++ file in unreal.

Is there possibly a way to set a whole directory as writable so that UE can create the files normally?

Ultimately I’m saying I can’t get it to work and need more help.

You should first create some empty class to generate all projects/solution files and only after that add all files to perfoce.

I already had some c++ files made before I added perforce to it. But you’re basically saying I’m better of creating them outside of the project and then adding them in after?

How do you add new files to source code exactly?

I do it from inside UE by going to File → Add Code to Project.

What exact problem do you have? Certain steps please, possible with screenshots of errors.

So let’s see… I open UE either from the launcher or through visual studio → debug. I then start to create a new class:

Then I choose the the parent class and choose a name.

15159-chooseparent.jpg

Then when I hit create class I get the error.

So it’s exactly what you’re initial question was but you’re answer didn’t really help me. The files still gets generated and I have to manually add them to my visual studio project, but isn’t there some bad effect of having that error?

Lately I’ve just been creating the files manually from scratch, but that’s kind of annoying, but it works…

Go to the [project folder]/Intermideate/ProjectFiles click with right mouse button on three project files and show the screenshot with properties of files.

Ah I didn’t realize I was supposed to mess with those. I just gave them +w but it didn’t help. And here is the pic:

Last two questions:

  1. Have you seted this +w properties to all files in ProjectFile folder ?
  2. Have you submited this changes ?