PDA

View Full Version : Working in the command prompt



Noctifer
11-02-2006, 09:54 PM
Hello everyone - I just discovered these threads and had to say hi. That and to ask about something that I am sure has become native to all of you but which is giving me a bit of trouble sorting out. I would like to play with the ucc compiler in order to just make some simple Commandlet programs - just little 'hello world' stuff to let me play to my hearts content with the editor's subtleties. I have grabbed an existing Hello World program off the net that extends Commandlet:

//================================================== ===========================
/// UnrealScript "hello world" sample Commandlet.
///
/// Usage:
/// ucc.exe HelloWorld
//================================================== ===========================
class HelloWorldCommandlet
extends Commandlet;

var int intparm;
var string strparm;

function int Main( string Parms )
{
log( "Hello, world!" );
if( Parms!="" )
log( "Command line parameters=" $ Parms );
if( intparm!=0 )
log( "You specified intparm=" $ intparm );
if( strparm!="" )
log( "You specified strparm=" $ strparm );
}

defaultproperties
{
HelpCmd="HelloWorld"
HelpOneLiner="Sample"
HelpUsage="HelloWorld"
HelpParm(0)="IntParm"
HelpParm(1)="StrParm"
HelpDesc(0)="An integer parameter"
HelpDesc(1)="A string parameter"
}
"

I have saved tried saving this file as "HelloWorld" as well as "HelloWorldCommandlet", with extensions ".uc", ".HelloWorldCommandlet", ".Commandlet", and no extensions what so ever. I have tried all of these file varieties directly in the System folder, in "UT2004\MyPackage\", and in "UT2004\MyPackage\Classes". I have tried executing "ucc HelloWorld", "ucc MyPackage.HelloWorld", "ucc MyPackage.HelloWorldCommandlet", any virtually every other combination I can think of that I will not list here. (I have always done my executions from inside the System folder since it would not allow me to use the command from anywhere else) About the only consistent thing I have is the error message:


====================================
ucc.exe: UnrealOS execution environment
Copyright 2001 Epic Games Inc
====================================

Commandlet [Whatever I typed in] not found


Incidentally, I am running UT2004. I know that it is something little, and something silly that I am missing, but it is so little and silly that I have been scouring the internet with no success in finding out what it is. Please help me, as I would love to get deeper into this engine (I am already quite comfortable with C++, MEL, etc.) Thank you!

Hsoolien
11-02-2006, 10:11 PM
You need to use ucc to compile them first, like any other Uscript

porkmanii
11-02-2006, 11:11 PM
See: Compiling With UCC (http://wiki.beyondunreal.com/wiki/Compiling_With_UCC).

Noctifer
11-08-2006, 09:19 AM
Hi, thank you both for the feedback. I tried adding the script into its own package folder ("MyScripts/Classes") and ran 'ucc make' on everything without getting any errors, but I am afraid the Commandlet extension still doesn't work -

(retyped result of running 'ucc make' to compile everything)
------------MyScripts - Release ----------------------
Analyzing...
Parsing TestCommandlet
Compiling TestCommandlet
Importing Defaults for TestCommandlet
Success - 0 error(s), 0 warning(s)


(retyped results of 'ucc TestCommandLet' in the System folder)
========================================
ucc.exe: UnrealOS execution environment
Copyright 2001 Epic Games Inc
========================================
Commandlet TestCommandlet not found


Am I missing something completely obvious?

-----------------------------------------------------------------------------
[EDIT]: Got it! Thank you so much - I went back through all the steps I had tried the first time around but with the compiled version and it worked:

ucc MyScripts.TestCommandlet

- I was forgetting to tell it where to look for the compiled script. Thank you all very much for the help, I look forward to putting up some fun scripts as soon as I get get my hands a bit dirtier with this code!