View Full Version : Editing classes outside of unrealed
stacheldraht
20th Oct 2000, 01:26 PM
I exported my classes to .uc files and then I tried to created a modified weapon. Well it screwed up my entire install. When I export the classes is it just copying them to antother file in the .uc format or is it actually changing the original files so that I have to recompile all of them to play again?
irongull
22nd Oct 2000, 12:54 AM
It is just copying them. Exporting doesn't change the original file at all. If you edit the exported scripts, delete the original .u, and try to recompile, that would create a huge problem.
ucc only recompiles things that are in the EditPackages list in UnrealTournament.ini, and whose corresponding .u files are not in the System directory. So if you want to recompile the MyClass directory, you have to delete System/MyClass.u
More info would help - exporting the scripts alone couldn't have caused your problems.
stacheldraht
22nd Oct 2000, 04:24 AM
Thanks for the info. Now I have another question. I've written a class that expands teamgameplus. I want to have it where there are player classes that start off with certain weapons and have different stats. Would the best way to do this be to make each class a different "teamcolor" then ally the certain "teamcolors" to make up the actual teams. This way I could assign the default starting weapons to each easily.. Is this the correct way to go about this or is there a simpler way?
irongull
22nd Oct 2000, 02:14 PM
I wouldn't use the team number to set the classes. The hardcoded limit of 4 teams appears throughout Epic's code, and monkeying with it could have unexpected consequences. You would be better off making an array that keeps track of each player's class. Use the PlayerReplicationInfo array to make sure that your array accurately represents the players in the game. I have an example of a silly little mod that does this - I'll send it to you if you like.
Another trick I've used is to find a variable that isn't being used and create a dummy class that will store info there. For instance, my mod is CTF-like, and the Bot class has an AlternatePath variable that is only used in CTF. So I made a dummy subclass of AlternatePath that contained the info I wanted to attach to the bot. For the Pawn class, the HasFlag variable is only used in CTF, so you could make an invisible, dummy decoration subclass that stores your information. Be careful - that could have weird side-effects. Like drawing your decoration attached to the back of players.
You can look at the code for my mod, Dominate the Flag, for an example of this hack. (url in my .sig) Feel free to steal whatever you find useful. I'm not posessive about my code.
The UT Classes Project - http://www.planetunreal.com/utc - is doing something similar to this. There hasn't been much activity there recently, but if they do release, it would provide a good example of how to do this.
stacheldraht
23rd Oct 2000, 09:22 AM
Thanks again irongull. Please do send the bit of code with the PlayerReplicationInfo. Very nice mod as well.
irongull
23rd Oct 2000, 03:17 PM
Thanks for checking out the mod!
I remembered seeing a good solution for this problem somewhere before, and I finally remembered where. Forget my code - I looked at it, and there are some bugs that I'm not going to fix just for this. Besides, there is a much cleaner solution suggested by Brandon Reinhart - whose opinion you should trust more than my own ;) You can find it in the very excellent Unrealscript Q&A at http://www.chessmess.com Specifically, the answer to your question is at http://www.chessmess.com/musqa-0200.htm#12 This is a much cleaner solution than either of my suggestions.
Good luck with your mod!
stacheldraht
24th Oct 2000, 09:08 AM
whoa, thanks for telling me about the incredible site. I have so many questions but I guess I'd better solve this one first and maybe I will learn the answer to some of the others in the process.
vBulletin® v3.8.0 Release Candidate 2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.