New script gives critical error

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Swotavator

New Member
Dec 29, 1999
10
0
0
Ocean Grove, NJ US
Visit site
I am making a sweet level with script to cause players to spawn without the enforcer. I write the script which i found at unrealized. I compliled it, saved it, and put it into levelinfo as gametype. Now, when i run it i get the following:

Critical Error

Failed to enter Autoplay.unr: Can't find file for package 'NoEnforcer'

History: UGameEngine::Init <- InitEngine


the script looks like this:

class NoWeapon expands TournamentGameInfo(or whatever this header is - i can't remember but it is right in the script);

function AddDefaultInventory(pawn PlayerPawn)
{
return;
}

function bool PickupQuery(Pawn Other, Inventory item)
{
if ( item.IsA('enforcer') )
DefaultWeapon = class'enforcer';
return Super.PickupQuery(Other, item);
}

I can't for the life of me figure out what is wrong. Please help. The level will be good, and then I can also put this script up somewhere for other people's use. Thanks.
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
two things:
1: have you told UT to load the .u file? I think you may need to add a line to the U..T... .ini file -- have a look for the other .u packages listed there and try adding it at the bottom.

2: this is a long shot, off the top of my head, but if it works let me know!
Go back to your level in UEd, and add the new class again. when the actor browser's dialog asks you class name and package, put 'MyLevel' for the package. Now type in or paste in your class's code, compile from UEd and use it in your level.
Now if I'm right, not only will it work but if/when you distribute your level you won't need to include a seperate .u file, and people wanting to play your level won't have to fiddle with their .ini file.

This has worked with a mover script, so I'm reasonably confident it'll work here. good luck, and make a backup copy of your level first!
tarquin
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
AFAIK:

.int files tell UT how to show stuff in menus.
eg. the pack that fixes the warboss's voice has an int file that gives new options in the warboss's voice list. a .int file for a mutator will give the name to appear in the mutator dialog box, what that should actually mean to UT in terms of classes, and the help text that appears on the status bar when the mouse hovers.
.int files are just text files.

unrealtournament.ini has lists of the .u files that UT should load on startup, and for UEd too.
.u files are compiled with ucc

tarquin