Getting set up to write scripts

Discussions about Coding and Scripting
Marscaleb
Average
Posts: 48
Joined: Tue Jun 07, 2016 6:50 am

Getting set up to write scripts

Post by Marscaleb »

I feel like I have a hole in my head. I've done this before, but I can't recall how to do this...
I guess the UT99 scripts were ones I only worked on for a couple weeks, and that was a good three years ago, so maybe it shouldn't be too surprising, but even so, I need a refresher.

I can't get started with writing scripts because I can't recall where I write them; what I write them in, and how to compile them.
I'm looking through the various "getting started" tutorials on this forum but most of the links are dead.

I think when I last wrote scripts for UT99 I was just editing them in notepad, because I didn't have a lot that I was going to make so I didn't want to set up new programs. But I don't recall what program I ran to compile my scripts. I don't recall what folder I was supposed to have my scripts in, and as such I can't seem to find which were the files I was editing. I know this is basic stuff, but I can't seem to find the resources I used to get this information three years ago.
ShaiHulud
Adept
Posts: 446
Joined: Sat Dec 22, 2012 6:37 am

Re: Getting set up to write scripts

Post by ShaiHulud »

The bare bones approach (as opposed to installing a dedicated tool like WOTgreal) is Notepad and the command line. I use Notepad++ with a syntax highlighter for UnrealScript (I remember seeing two or three of these online, but not sure which I downloaded).

If you have Unreal Tournament installed in "c:\games\unrealtournament" then you would create a folder called "c:\games\unrealtournament\name_of_my_mod"

Below the "name_of_my_mod" folder you create a sub-folder called "classes". These path names don't seem to be case-sensitive on Windows (from what I recall).

Then you need to edit "c:\games\unrealtournament\system\UnrealTournament.ini". Search for "[Editor.EditorEngine]" and scroll down to the "EditPackages=" entries, then create a new entry at the end with your mod name:

EditPackages=name_of_my_mod

That's basically it. You place your mod files in the "classes" folder (*.uc files - you might create other sub-folders for sounds, textures, and so on if required, though from memory the names you pick for these other sub-folders is entirely up to you, as long as you use the correct paths in any *.uc files which reference them) and then open the command prompt and browse to:

c:\games\unrealtournament\system - and type "ucc make"

That'll dump a compiled file called "name_of_my_mod.u" in your "c:\games\unrealtournament\system" folder.

I usually use a little batch file for this (placed in the system folder), because sometimes there are several files to compile together - and also it's important to remember that if a compiled version of your mod already exists, the "ucc make" command won't overwrite it, something easily forgotten which leads to much confusion when changes you've made to the mod appears to be missing:

Code: Select all

@echo off

REM Delete existing compiled files...
del name_of_my_mod.u

REM Compile all files
ucc make
From there, depending on the nature of your mod - for example, whether it needs to be distributed to clients, or whether it only runs on the server - you'll need to update a couple of things. If it's distributable, you modify your server's UnrealTournament.ini file - the [Engine.GameEngine] section - and add an entry to the ServerPackages list:

ServerPackages=name_of_my_mod

If it's a mutator and you need to start it server-side, you'll want to change the server start-up command (most likely - or else you can go the ServerActor route, see IpToCountry for an example of this):

ucc server CTF-Coret?game=Botpack.CTFGame?mutator=name_of_my_mod.name_of_my_mod,<other_mods_here>


It's been a while since I've done any of this, so there might be some inaccuracies, apologies for that if so.
User avatar
UTPe
Masterful
Posts: 532
Joined: Sun Jul 12, 2009 7:10 pm
Personal rank: Dude
Location: Trieste, Italy

Re: Getting set up to write scripts

Post by UTPe »

hi,
I'm a bit off ut but maybe this may help you:
viewtopic.php?t=4482

well, there's another coding tool developed many years ago by Dr.SiN: VisualUC++

greets,
Pietro
You do not have the required permissions to view the files attached to this post.
Personal map database: http://www.ut99maps.net

"These are the days that we will return to one day in the future only in memories." (The Midnight)