Monday, January 30, 2012

Ambiguous Package Name error in UDK and how to fix it

So I've been playing with UDK

and I came across a shit. After compiling my scripts UDK would pop up with an ambiguous package name error on startup. After some googling I found that this is because I had been making my scripts in a folder with the same name as the package I was working on. Seems like a pretty standard idea to me, name all your stuff the same, but UDK doesn't like that. So here's how to fix it.

Firstly rename either your package or your scripting folder. It's probably easier to rename your package directly in explorer, but I decided to rename my scripts. So in development/src I had my YEY folder. I renamed it to YEYGAME. Then I had to go into the defaultEngine.ini (found in your UDKgame/config folder) and changed the line +EditPackages=YEY to +EditPackages=YEYGAME. This meant that UDK could go about compiling the new scripts folder and forget about the old one.

If you start UDK at this stage, you'll still get the error. That's because when UDK compiles the files from your newly renamed folder, it won't delete the old conflicting compiled scripts file. So go into UDKGame/script and delete your old file.

Startup UDK and voila! Error gone. Don't mention it.