compiling codes

Discussions about Coding and Scripting
Post Reply
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

compiling codes

Post by Rakiayn »

If I compile my code ,why cant I use files from other U files?
I get an error message like : error ,cant find class 'mod.class'
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: compiling codes

Post by Feralidragon »

Because they're not loaded. You can only compile your package with the packages which are in the EditPackages list in the UnrealTournament.ini file.

In resume: you have to add the mods containing those classes to the EditPackages list in that same ini.

NOTE: Only add the packages you REALLY REALLY NEED, otherwise the package will "require" more packages than the mod actually needs, so DO NOT play the "smart guy" role and place everything into editpackages lol :lol2:
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: compiling codes

Post by Rakiayn »

so If I add to much packages to the unrealtournament.ini file, my mod becomes dependent of these files?
User avatar
Sp0ngeb0b
Adept
Posts: 376
Joined: Wed Feb 13, 2008 9:16 pm
Location: Cologne
Contact:

Re: compiling codes

Post by Sp0ngeb0b »

Only if you actually refer to these files. I got a lot of EditedPackages, but I'm always sure that I doesn't refer to them accidently in one of my mods.
Website, Forum & UTStats

Image
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: compiling codes

Post by Feralidragon »

Sp0ngeb0b wrote:Only if you actually refer to these files. I got a lot of EditedPackages, but I'm always sure that I doesn't refer to them accidently in one of my mods.
That's odd. I am pretty sure that once you add something in EditPackages "above" your actual mod (packages that get called before your own mod compile) make your mod be dependent on them, either you refer them or not in your mods.

Proof of that is that once I forgot a certain package in EditPackages, sent the mod to an admin, and since the admin didn't have that package, his server crashed complaining about that missing package. The only thing I did to fix it was simply to comment the line of the extra package in question, and recompile the mod, thus the confirmation of this.

You can have a lot of EditPackages there, but unless you comment them out or place them "after" your mod compile order, the mod will be always dependent from them.
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: compiling codes

Post by iloveut99 »

Sp0ngeb0b wrote:Only if you actually refer to these files. I got a lot of EditedPackages, but I'm always sure that I doesn't refer to them accidently in one of my mods.
I think this is correct. I do have relics package in editpackages and the mods that I compile seems don't have it dependency.
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: compiling codes

Post by Feralidragon »

Well, to clear this doubt up, I made an experiment: created classes and packages A and B, and tested this.

It seems that Sponge and iloveut99 are right, and ucc is smart enough to not create useless dependencies, so I guess I was wrong.
I am wondering now what exactly happenned back then (it happenned as I described, and the difference was also an EditPackage, created a dependency only because it was there... I wonder :noidea ).
User avatar
The_Cowboy
Skilled
Posts: 165
Joined: Mon Jan 24, 2011 3:22 am
Personal rank: Codezilla

Re: compiling codes

Post by The_Cowboy »

Ok I know this is very old topic, but I think I know where the problem arises.

Suppose
1)Package ABC has classes A,B,C
2)Package CDE has classes C,D,E
(both packages have C class common)

now if Package ABC is above package CDE and you compile then unwanted dependency is created :loool: .
Package CDE will require package ABC to run.
Feralidragon wrote:Trial and error is sometimes better than any tutorial, because we learn how it works for ourselfs, which kills any doubts about anything :tu:
Patreon: https://www.patreon.com/FreeandOpen
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: compiling codes

Post by JackGriffin »

Another point to consider is that if you have EditPackages for some mod, it can also create unintended default settings in the compile if you are dependent on another mod. For example MonsterHunt2 builds a gametype up from Monsterhunt, so it requires an MH dependency. If I leave my MH.ini in the system folder it will save "my" ini settings as the default.

Example:
From MonsterHunt.ini

Code: Select all

[Engine.GameInfo]
AdminPassword=MySuperSecretPass
GamePassword=
Now if I leave that and compile from that installation my new mod will have

Code: Select all

AdminPassword=MySuperSecretPass
as the default and if you let the mod generate an ini itself, my password will be out there for all to see.

The moral of this story? Code from a dedicated installation you don't use to play with and REMOVE all unused editpackage lines you do not need. Keep it clean and keep yourself from making a bad mistake.
So long, and thanks for all the fish
Post Reply