Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) My adventure into unreal script (Read 7428 times)
Jason
Ex Member


My adventure into unreal script
Dec 12th, 2011 at 6:25pm
Print Post  
Hello Everyone-  I am starting to begin my adventure into scripting with Unreal, My main goal is to edit the MyJumpBoots so that they can be configured with different modes (with the CMM server in mind). I have set up my Scripting Environment using
WOTgreal
Exported Unreal Classes with Unreal Editor
UMake (just in case WOTgreal wouldn't Compile)

I have created my first Newbie Mutator called XLowGrav (following tutorials on legacy unreal wiki)
Code
Select All
//=============================================================================
// XLowGrav.
// makes all zones xtra low gravity
//=============================================================================

class XLowGrav expands Mutator;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if ( Other.IsA('UT_JumpBoots') )
return false;

if ( Other.IsA('ZoneInfo') )
{
    ZoneInfo(Other).ZoneGravity = vect(0,0,-100);
}

bSuperRelevant = 0;
return true;
}

defaultproperties
{
} 


Code isn't turning out right in the way I formatted for this thread but it does work and allows you to float higher than the original lowgrav mutator.

  
Back to top
 
IP Logged
 
Jason
Ex Member


Re: My adventure into unreal script
Reply #1 - Dec 12th, 2011 at 6:38pm
Print Post  
Okay in order for me to look at the MyJumpBoots, going to need to install UTPT, I forgot to do that. Doing it now.
  
Back to top
 
IP Logged
 
Jason
Ex Member


Re: My adventure into unreal script
Reply #2 - Dec 12th, 2011 at 6:45pm
Print Post  
Okay so here is the code for MyJumpBoots
Code
Select All
//================================================================================
// MyJumpBoots.
//================================================================================

class MyJumpBoots extends UT_Jumpboots;

function OwnerJumped ()
{
  TimeCharge = 0;
  if ( Charge <= 0 )
  {
    if ( Owner != None )
    {
      Pawn(Owner).JumpZ = Pawn(Owner).Default.JumpZ * Level.Game.PlayerJumpZScaling();
    }
    UsedUp();
  } else {
    Owner.PlaySound(Sound'MyJumpJmp');
  }
  Charge -= 1;
}

defaultproperties
{
    ExpireMessage="My JumpBoots have drained."

    PickupMessage="You picked up My JumpBoots."

    PickupSound=None

    ActivateSound=Sound'MyJumpSnd'

    MultiSkins(1)=Texture'MyJump'

} 



I want to give these boots the ability to be modified from an ini so it can have multiple modes.
I also want to change the sound when used.

  
Back to top
 
IP Logged
 
Helen
YaBB Administrator
*****
Offline


hello

Posts: 1595
Location: earth
Joined: Nov 8th, 2005
Gender: Male
Re: My adventure into unreal script
Reply #3 - Dec 12th, 2011 at 6:54pm
Print Post  
I'm not sure what UTPT is, but it sounds like they have a class called myJumpboots? It would have inherited from ut_jumpboots. In greal, in the View menu you can select Classes. Then in the classes tree you can find the ut jumpboots following this heirarchy.

Object | Actor | Inventory | Pickup | TournamentPickup | UT_JumpBoots
  

One of the Scriveners.
Back to top
WWW  
IP Logged
 
Jason
Ex Member


Re: My adventure into unreal script
Reply #4 - Dec 12th, 2011 at 6:56pm
Print Post  
Helen wrote on Dec 12th, 2011 at 6:54pm:
I'm not sure what UTPT is, but it sounds like they have a class called myJumpboots? It would have inherited from ut_jumpboots. In greal, in the View menu you can select Classes. Then in the classes tree you can find the ut jumpboots following this heirarchy.

Object | Actor | Inventory | Pickup | TournamentPickup | UT_JumpBoots

Unreal Package tool decompiles .u and .int files so you can look at any code that was compiled and in those formats.  I will need to figure out how to create .int files which I assume hold the sound files correct?
  
Back to top
 
IP Logged
 
Helen
YaBB Administrator
*****
Offline


hello

Posts: 1595
Location: earth
Joined: Nov 8th, 2005
Gender: Male
Re: My adventure into unreal script
Reply #5 - Dec 12th, 2011 at 7:11pm
Print Post  
BTW, if you decompiling something to study it for ideas, that's ok. But if you are going to reuse some code, or reuse someone's custom textures, you should ask for permission from the original author. Just FYI.

The .int files do not hold the sound files.

I'm not sure that the unreal tool decompiles sounds, textures, and meshes properly or not. For custom packages, I use the WOTGreal Package Exporter, I know that works at least. Mostly!
  

One of the Scriveners.
Back to top
WWW  
IP Logged
 
Jason
Ex Member


Re: My adventure into unreal script
Reply #6 - Dec 12th, 2011 at 7:29pm
Print Post  
Yes I don't want to use the old texture or sound that is why I am asking- I want to create my own, but to do that is the tricky part how do I compile it into the .u file? Does it auto compile it as long as it is in the code and the files are in the Sound/Texture folders after importing them into Unreal editor?  This is something I need to know so I can get it working.
  
Back to top
 
IP Logged
 
Helen
YaBB Administrator
*****
Offline


hello

Posts: 1595
Location: earth
Joined: Nov 8th, 2005
Gender: Male
Re: My adventure into unreal script
Reply #7 - Dec 12th, 2011 at 8:05pm
Print Post  
Yes, within your package you have Sound/Texture folders, where you put your files.

Then look at the ut_jumpboots class for an example of use. For example, near the top is this line:

#exec AUDIO IMPORT FILE="..\UnrealShare\Sounds\Pickups\BOOTSA1.WAV" NAME="BootSnd" GROUP="Pickups"

Notice the NAME value? This means you can use this sound in your code, and you would reference it with "BootSnd". Same deal with the texture examples in there.
  

One of the Scriveners.
Back to top
WWW  
IP Logged
 
Jason
Ex Member


Re: My adventure into unreal script
Reply #8 - Dec 12th, 2011 at 8:17pm
Print Post  
I do not see Sound/Texture folders where is this again?
  
Back to top
 
IP Logged
 
Helen
YaBB Administrator
*****
Offline


hello

Posts: 1595
Location: earth
Joined: Nov 8th, 2005
Gender: Male
Re: My adventure into unreal script
Reply #9 - Dec 12th, 2011 at 8:46pm
Print Post  
You create them yourself within your package folder, just like the Classes folder you would have created.
  

One of the Scriveners.
Back to top
WWW  
IP Logged
 
Jason
Ex Member


Re: My adventure into unreal script
Reply #10 - Dec 12th, 2011 at 9:00pm
Print Post  
Oh duh lol thanks
  
Back to top
 
IP Logged
 
Jason
Ex Member


Re: My adventure into unreal script
Reply #11 - Dec 12th, 2011 at 9:34pm
Print Post  
Code
Select All
//================================================================================
// MyCMMJumpBoots.
//================================================================================

class MyCMMJumpBoots extends UT_Jumpboots;

function OwnerJumped ()
{
  TimeCharge = 0;
  if ( Charge <= 0 )
  {
    if ( Owner != None )
    {
      Pawn(Owner).JumpZ = Pawn(Owner).Default.JumpZ * Level.Game.PlayerJumpZScaling();
    }
    UsedUp();
  } else {
    Owner.PlaySound(Sound'BootJmp');
  }
  Charge -= 1;
}

defaultproperties
{
    ExpireMessage="CMM JumpBoots have depleted."

    PickupMessage="You picked up CMMJumpBoots."

    PickupSound=None

    ActivateSound=Sound'Botpack.Pickups.BootSnd'

    MultiSkins(1)=Texture'MyCMMJumpBoots'

} 


I have compiled with zero errors and have placed my redone texture "MyCMMJumpBoots" into a texture folder in the MyCMMJumpBoots package however when choosing the mutator in game the default jump boots texture is shown and not mine?? Any suggestions?
  
Back to top
 
IP Logged
 
Helen
YaBB Administrator
*****
Offline


hello

Posts: 1595
Location: earth
Joined: Nov 8th, 2005
Gender: Male
Re: My adventure into unreal script
Reply #12 - Dec 12th, 2011 at 9:54pm
Print Post  
You haven't imported them into the code with the #exec statement.

BTW there is already a cmmJumpBoots class in the pirate deemer mod...
  

One of the Scriveners.
Back to top
WWW  
IP Logged
 
Jason
Ex Member


Re: My adventure into unreal script
Reply #13 - Dec 12th, 2011 at 10:06pm
Print Post  
okay, this is just a test, I try and piece stuff together one by one.
  
Back to top
 
IP Logged
 
Jason
Ex Member


Re: My adventure into unreal script
Reply #14 - Dec 12th, 2011 at 10:26pm
Print Post  
I get this error now
--------------------Core--------------------
--------------------Engine--------------------
--------------------Editor--------------------
--------------------UWindow--------------------
--------------------Fire--------------------
--------------------IpDrv--------------------
--------------------UWeb--------------------
--------------------UBrowser--------------------
--------------------UnrealShare--------------------
--------------------UnrealI--------------------
--------------------UMenu--------------------
--------------------IpServer--------------------
--------------------Botpack--------------------
--------------------UTServerAdmin--------------------
--------------------UTMenu--------------------
--------------------UTBrowser--------------------
--------------------XLowGrav--------------------
--------------------MyCMMJumpBoots--------------------
Analyzing...
Parsing MyCMMJumpBoots
Can't find file 'C:\Unreal' for import
C:\Unreal Tournament\MyCMMJumpBoots\Classes\MyCMMJumpBoots.uc(7) : ExecWarning, Import texture MyCMMJump from C:\Unreal failed
Compiling MyCMMJumpBoots
Success - 0 error(s), 1 warnings
Shutting down ucc.exe

Code
Select All
//================================================================================
// MyCMMJumpBoots.
//================================================================================

class MyCMMJumpBoots extends UT_Jumpboots;

#exec texture IMPORT NAME=MyCMMJump FILE=C:\Unreal Tournament\MyCMMJumpBoots\Textures\MyCMMJump.pcx LODSET=2
function OwnerJumped ()
{
  TimeCharge = 0;
  if ( Charge <= 0 )
  {
    if ( Owner != None )
    {
      Pawn(Owner).JumpZ = Pawn(Owner).Default.JumpZ * Level.Game.PlayerJumpZScaling();
    }
    UsedUp();
  } else {
    Owner.PlaySound(Sound'BootJmp');
  }
  Charge -= 1;
}

defaultproperties
{
    ExpireMessage="CMM JumpBoots have depleted."

    PickupMessage="You picked up CMMJumpBoots."

    PickupSound=None

    ActivateSound=Sound'Botpack.Pickups.BootSnd'

    MultiSkins(1)=Texture'MyCMMJump'

} 

  
Back to top
 
IP Logged
 
Helen
YaBB Administrator
*****
Offline


hello

Posts: 1595
Location: earth
Joined: Nov 8th, 2005
Gender: Male
Re: My adventure into unreal script
Reply #15 - Dec 12th, 2011 at 10:43pm
Print Post  
I have guesses.

A. Don't have that full path to file, change the file path to just FILE=Textures\MyCMMJump.pcx

B. Make sure your pcx is square with edges that are a square root of 2, so 32x32, 64x64, 128x128, etc.

C. Make sure your pcx has 256 colors or LESS.
  

One of the Scriveners.
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint