For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Pickup classes

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Pickup classes

Post by GreatEmerald »

This is not quite the correct UT version, but I want to do such a basic step that it works the same in UT1 and UT2004. Somehow UScripters at BeyondUnreal don't like answering.. So, I'm trying to create Pickup classes for weapons and ammo of UTXMP. It already has Inventory Weapons and Ammo classes, so I should only need Pickup classes for the items to show on the map. So far I've tried making the XMP Energy Rifle pickup classes. This is my first UnrealScript actually :) And pretty simple. Here are the two files:

Code: Select all

//=============================================================================
// XMPEnergyAmmoPickup.uc
// For XMP Weapons Pack
//=============================================================================
// Created by GreatEmerald
// © 2008
//=============================================================================

class XMPEnergyAmmoPickup extends UTAmmoPickup;

#EXEC OBJ LOAD FILE=../Sounds/U2WeaponsA.uax
#EXEC OBJ LOAD FILE=../StaticMeshes/343M.usx
#EXEC OBJ LOAD FILE=../UTXMP/System/XMPWeapons.u

defaultproperties{
InventoryType=class'XMPWeapons.XMPEnergyRifleAmmo'
PickupMessage="You picked up a Shock Lance plasma pack."
PickupSound=Sound'U2WeaponsA.EnergyRifle.ER_PickupAmmo'
PickupForce="XMPEnergyAmmoPickup"
AmmoAmount=34
CollisionRadius=22.000000
CollisionHeight=10.000000
StaticMesh=StaticMesh'343M.Pickups.Ammo_ER'
DrawType=DT_StaticMesh
TransientSoundVolume=0.4
}

Code: Select all

//=============================================================================
// XMPEnergyRiflePickup.uc
// For XMP Weapons Pack
//=============================================================================
// Created by GreatEmerald
// © 2008
//=============================================================================

class XMPEnergyRiflePickup extends UTWeaponPickup;

#EXEC OBJ LOAD FILE=../StaticMeshes/MalekythM.usx
#EXEC OBJ LOAD FILE=../Sounds/U2WeaponsA.uax
#EXEC OBJ LOAD FILE=../Textures/GLMWeaponsT.utx
#EXEC OBJ LOAD FILE=../UTXMP/System/XMPWeapons.u

defaultproperties
{
    InventoryType=class'XMPWeapons.XMPEnergyRifle'

    PickupMessage="You got a Shock Lance."
    PickupSound=Sound'U2WeaponsA.EnergyRifle.ER_Pickup'
    PickupForce="EnergyRiflePickup"  

    MaxDesireability=+0.63

    Skins[0]=GLMWeaponsT.ER_Skin1
    Skins[1]=GLMWeaponsT.ER_Skin2
    StaticMesh=staticmesh'MalekythM.Pickups.ER_TP_W'
    DrawType=DT_StaticMesh
    DrawScale=0.55
    Standup=(Y=0.25,Z=0.0)
}
As you might guessed, it doesn't work... If you wish to see the log:

Now I suspect that the static mesh of both don't appear because of either:
a) the #EXEC directive is not working - the files are not found
b) the main XMPWeapons.XMPEnergyRifle class doesn't allow a pickup to be assigned or needs to be assigned to one
c) there are some other mistakes in the code.

So if it's A, how do you actually load the file? Where should it be located for the #EXEC to find it?
If it's B, then is there a way you can disallow pickup classes or do the inventory classes need assigning to the Pickup classes?
If it's C, anyone see any mistakes in this very simple piece of coding?
User avatar
Age
OldUnreal Member
Posts: 848
Joined: Sat Dec 29, 2007 5:25 pm

Re: Pickup classes

Post by Age »

I make EXEC always like this:

Code: Select all

#exec OBJ LOAD FILE=AmbAncient.uax
Last edited by Age on Fri May 09, 2008 6:13 pm, edited 1 time in total.
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Re: Pickup classes

Post by GreatEmerald »

Tried it in the first place. No luck. But maybe the packages should be located somewhere specifically? Like in the same folder with classes? Also tried two ups (../../) but no luck as well (the compile folder is TestPak/Classes).
User avatar
スマイル・ドラゴン
OldUnreal Member
Posts: 1263
Joined: Sun Feb 10, 2008 9:07 pm

Re: Pickup classes

Post by スマイル・ドラゴン »

try this

Code: Select all

#EXEC OBJ LOAD FILE=..\Sounds\U2WeaponsA.uax
#EXEC OBJ LOAD FILE=..\StaticMeshes\343M.usx
#EXEC OBJ LOAD FILE=..\UTXMP\System\XMPWeapons.u
change all occurrences of / to \ THEN try to compile.
“I am the dragon without a name.”
Ðàrk-_¦_-Ñïght.: / κυνικός Δράκων / スマイル・ドラゴン / Draco Nihil
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Re: Pickup classes

Post by GreatEmerald »

OK, I'll try that. But where do the paths start actually? From the .uc or the .u file?
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Re: Pickup classes

Post by GreatEmerald »

The pickups work, but the point is that enemies never drop the weapons nor they appear in the weapon spawn points. What controls what thing you drop after you die or press the drop button? Do you need to assign the inventory actor to the pickup actor somehow?
Yes! Found it! Simply the Inventory class has a DefaultProperties function of that. Now everything works!
Last edited by GreatEmerald on Sat May 10, 2008 4:03 pm, edited 1 time in total.
User avatar
スマイル・ドラゴン
OldUnreal Member
Posts: 1263
Joined: Sun Feb 10, 2008 9:07 pm

Re: Pickup classes

Post by スマイル・ドラゴン »

OK, I'll try that. But where do the paths start actually? From the .uc or the .u file?
paths like that ..\ i think means the directory of unreal or ut2004 or w\e that UCC is being run in.
“I am the dragon without a name.”
Ðàrk-_¦_-Ñïght.: / κυνικός Δράκων / スマイル・ドラゴン / Draco Nihil
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Re: Pickup classes

Post by GreatEmerald »

Hmm... Yes, that seems so, that is, from the .u file directory, /system.
Last edited by GreatEmerald on Sun May 11, 2008 6:39 am, edited 1 time in total.

Return to “UScript Board”