How to Make A *.U file...

  • 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.

Call me Erdrik

Arch Mage
Nov 24, 1999
334
0
0
43
Spring Hill, FL, USA
www.geocities.com
well take out 'expands activated' the reason it doesn't spawn is probly somewhere else.

tho from the code I can't see the problem.. :p

maybe the new mesh wasn't imported properly??
maybe the life span isn't infinite?
maybe bCollideActors is False?

... im just takin' wild stabs here :p
 

Cieprus

Mapper...In Progress
Feb 17, 2002
113
0
0
39
~America~
www.geocities.com
Here is the RelicInventory and Relic code just to help..

=====================================

class RelicInventory expands TournamentPickup;

var Relic MyRelic;
var float IdleTime;
var RelicShell ShellEffect;
var texture ShellSkin;
var class<RelicShell> ShellType;

function Destroyed()
{
if ( ShellEffect != None )
ShellEffect.Destroy();
if ( (MyRelic != None) && (MyRelic.SpawnedRelic == self) )
MyRelic.SpawnRelic(0);

Super.Destroyed();
}

simulated function PostBeginPlay()
{
Super.PostBeginPlay();

if ( Level.NetMode == NM_DedicatedServer )
return;

CheckForHUDMutator();
}

simulated function CheckForHUDMutator()
{
local HUDMutator M;
local RelicHUDMutator RHM;
local PlayerPawn P;

ForEach AllActors(class'PlayerPawn', P)
if ( P.myHUD != None )
{
// check if it already has a RelicHUDMutator
M = HUDMutator(P.myHud.HUDMutator);
while ( M != None )
{
if ( M.IsA('RelicHUDMutator') )
return;
M = M.NextRHUDMutator;
}
RHM = Spawn(class'RelicHUDMutator');
RHM.RegisteraHUDMutator();
if ( RHM.bIsHUDMutator )
{
if ( Role == ROLE_SimulatedProxy )
SetTimer(0.0, false);
return;
}
else
RHM.Destroy();
}

if ( Role == ROLE_SimulatedProxy )
SetTimer(1.0, true);
}

simulated function Timer()
{
Super.Timer();
if ( Role == ROLE_SimulatedProxy )
CheckForHUDMutator();
}

function bool HandlePickupQuery( inventory Item )
{
if ( Item.IsA('RelicInventory') )
return True;
else
return Super.HandlePickupQuery( Item );
}

auto state Pickup
{
function BeginState()
{
Super.BeginState();
IdleTime = 0;
SetOwner(None);
}

function Touch( actor Other )
{
if ( ValidTouch(Other) )
{
bHeldItem = True;
Instigator = Pawn(Other);
CheckForHUDMutator();
BecomeItem();
Pawn(Other).AddInventory( Self );

if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogPickup(Self, Pawn(Other));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogPickup(Self, Pawn(Other));

if (bActivatable && Pawn(Other).SelectedItem==None)
Pawn(Other).SelectedItem=Self;

if (bActivatable && bAutoActivate && Pawn(Other).bAutoActivate)
Self.Activate();

if ( PickupMessageClass == None )
Pawn(Other).ClientMessage(PickupMessage, 'Pickup');
else
Pawn(Other).ReceiveLocalizedMessage( PickupMessageClass, 0, None, None,

Self.Class );
PlaySound (PickupSound,,2.0);
PickupFunction(Pawn(Other));
}
}

simulated function Landed(Vector HitNormal)
{
local rotator newRot;

newRot = Rotation;
newRot.pitch = 0;
SetRotation(newRot);
SetPhysics(PHYS_Rotating);
IdleTime = 0;
SetCollision( True, False, False );
}
}

state Activated
{
function EndState()
{
}

function Timer()
{
if ( Role == ROLE_SimulatedProxy )
CheckForHUDMutator();
}

function BeginState()
{
IdleTime = 0;
}
}

state DeActivated
{
Begin:
}

function DropInventory()
{
local RelicInventory Dropped;
local vector X,Y,Z;

Dropped = Spawn(Class);
Owner.GetAxes(Owner.Rotation,X,Y,Z);
Dropped.MyRelic = MyRelic;
MyRelic.SpawnedRelic = Dropped;
Dropped.SetLocation( Owner.Location + 0.8 * Owner.CollisionRadius * X + -0.5 * Owner.CollisionRadius *

Y );
Dropped.RemoteRole = ROLE_SimulatedProxy;
Dropped.Mesh = PickupViewMesh;
Dropped.DrawScale = PickupViewScale;
Dropped.bOnlyOwnerSee = false;
Dropped.bHidden = false;
Dropped.bCarriedItem = false;
Dropped.NetPriority = 1.4;
Dropped.SetCollision( False, False, False );
Dropped.SetPhysics(PHYS_Falling);
Dropped.bCollideWorld = True;
Dropped.Velocity = Vector(Pawn(Owner).ViewRotation) * 500 + vect(0,0,220);
Dropped.GotoState('PickUp', 'Dropped');
// Remove from player's inventory.
Destroy();
}

function PickupFunction(Pawn Other)
{
Super.PickupFunction(Other);

LightType = LT_None;
}


function FlashShell(float Duration)
{
if (ShellEffect == None)
{
ShellEffect = Spawn(ShellType, Owner,,Owner.Location, Owner.Rotation);
}
if ( ShellEffect != None )
{
ShellEffect.Mesh = Owner.Mesh;
ShellEffect.DrawScale = Owner.Drawscale;
ShellEffect.Texture = ShellSkin;
ShellEffect.SetTimer(Duration, false);
}
}

event float BotDesireability( pawn Bot )
{
local Inventory Inv;

// If we already have a Relic, we don't want another one.

for( Inv=Bot.Inventory; Inv!=None; Inv=Inv.Inventory )
if ( Inv.IsA('RelicInventory') )
return -1;

return MaxDesireability;
}



=============================================

class Relic expands Mutator
abstract;

var class<RelicInventory> RelicClass;
var int NumPoints;
var bool Initialized;
var RelicInventory SpawnedRelic;
var int NavPoint;

function PostBeginPlay()
{
local NavigationPoint NP;

if (Initialized)
return;
Initialized = True;

// Calculate number of navigation points.
for (NP = Level.NavigationPointList; NP != None; NP = NP.NextNavigationPoint)
{
if (NP.IsA('PathNode'))
NumPoints++;
}

SpawnRelic(0);
SetTimer(5.0, True);
}

function SpawnRelic(int RecurseCount)
{
local int PointCount;
local NavigationPoint NP;
local RelicInventory Touching;

NavPoint = Rand(NumPoints);
for (NP = Level.NavigationPointList; NP != None; NP = NP.NextNavigationPoint)
{
if ( NP.IsA('PathNode') )
{
if (PointCount == NavPoint)
{
// check that there are no other relics here
if ( RecurseCount < 3 )
ForEach VisibleCollidingActors(class'RelicInventory', Touching, 40, NP.Location)
{
SpawnRelic(RecurseCount + 1);
return;
}

// Spawn it here.
SpawnedRelic = Spawn(RelicClass, , , NP.Location);
SpawnedRelic.MyRelic = Self;
return;
}
PointCount++;
}
}
}

function Mutate(string MutateString, PlayerPawn Sender)
{
local Inventory S;

if (MutateString ~= "TossRelic")
{
S = Sender.FindInventoryType(RelicClass);
if (S != None)
{
RelicInventory(S).DropInventory();
Sender.DeleteInventory(S);
}
}

if ( NextMutator != None )
NextMutator.Mutate(MutateString, Sender);
}

function Timer()
{

if ( (SpawnedRelic != None) && (SpawnedRelic.Owner == None) )
{
SpawnedRelic.IdleTime += 5;
if ( SpawnedRelic.IdleTime >= 30 )
{
SpawnedRelic.IdleTime = 0;
Spawn(class'RelicSpawnEffect', SpawnedRelic,, SpawnedRelic.Location, SpawnedRelic.Rotation);
SpawnedRelic.Destroy();
}
}
}
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Originally posted by Cieprus
Code:
//================================================================================
// RelicGoldInventory.
//================================================================================
class RelicGoldInventory expands relicinventory;

(...)

defaultproperties
{
    InstFog=(X=475.00,Y=325.00,Z=145.00)
    InstFlash=-0.40
    ShellSkin=Texture'Skins.RelicBlue'
    PickupMessage="You picked up the Relic of Gold!"
    [b][i]PickupViewMesh=Mesh'RelicGold'[/i][/b]
    PickupViewScale=0.50
    [b][i]Icon=Texture'Icons.RelicIconGold'[/i][/b]
    [b][i]Physics=PHYS_Walking[/i][/b]
    Texture=Texture'Skins.JRelicGold_01'
    Skin=Texture'Skins.JRelicGold_01'
    CollisionHeight=40.00
    LightSaturation=0
}

First thing: Relics use Physics=PHYS_Rotating.
Second thing: Where do you import the model and the icon for your relic? These things have to be imported before you can use them. Look at the RelicInventory code to see how the icon is imported (#exec texture import...) and look in RelicRegenInventory or one of the other RelicInventory subclasses to see how models are imported (everything beginning with "#" except "#exec audio...").
 

Sonja

New Member
Nov 25, 2001
24
0
0
Visit site
RelicGoldInventory

Code For RelicGold

-------------------------------------------------------------
//================================================================================
// RelicGold.
//================================================================================
class RelicGold expands Relic;

defaultproperties
{
RelicClass=Class'RelicGoldInventory


Your missing a "}"


Tried compiling
You need to add to your unrealtournament.ini under the Editpackages another that says:
EditPackages=relics
 
Last edited: