View Full Version : Interaction not showing online.
Angel_Mapper
08-09-2003, 12:03 AM
I'm using an Interaction to show some information on the player's HUD, and it works perfectly offline, but doesn't show at all online. I looked at the log and testing it online I'm getting an Accessed None in the ModifyPlayer function, but the error doesn't appear offline. Here's the function, from my mutator class:
function ModifyPlayer(Pawn Other)
{
local Player P;
local int i;
local bool bHUDIsSetup;
if (PlayerController(Other.Owner) == None)
return;
if (PlayerController(Other.Owner).Player == None)
return;
P = PlayerController(Other.Owner).Player;
for (i = 0; i < P.LocalInteractions.Length; i++)
{
if (P.LocalInteractions[i].IsA('SwitcherInteraction'))
bHUDIsSetup = True;
}
if (!bHUDIsSetup)
P.InteractionMaster.AddInteraction("AngelWeaponSwitcher.SwitcherInteraction", P);
Super.ModifyPlayer(Other);
return;
}
Any help? :bulb:
legacy-Haral
08-09-2003, 01:12 AM
... err, ignore that post if you saw it, I bothered to go look.
However, in any case, with errors like this I strongly suggest you do some logging to find out the specific cause of the accessed none. Just go through logging all of the var values until you see what's coming up as none.
Err... could you look specifically at what errors you get? Some simple counting can sometimes show you what's giving you errors (keep in mind you'll get two for one line if it gives you an 'attempted to assign a variable through none' error.)
I'm guessing Other.Owner or (Other.Owner).Player
legacy-Haral
08-09-2003, 01:22 AM
I'm still kind of half-awake but it looks to me like you want that code to be executing on the client-side. I think Player is client-side only.
Angel_Mapper
08-09-2003, 01:45 AM
Yeah, I only need the interaction to be added client side, nothing to do with the server.
Angel_Mapper
08-09-2003, 02:41 AM
Narrowed it down to this line, I'm guessing there are no LocalInteractions server-side.
for (i = 0; i < P.LocalInteractions.Length; i++)
Any idea how to get all this to take place client-side only?
legacy-Mychaeel
08-09-2003, 05:07 AM
Class Interaction isn't derived from Actor, hence it won't replicate by itself anywhere. Your Interaction must be created on each client separately.
See Unreal Wiki: Creating an Interaction from a Mutator (http://www.unrealwiki.com/wiki/Creating_An Interaction_From_A_Mutator) for details.
Angel_Mapper
08-09-2003, 06:05 AM
Aargh, it's still not working. I set it up exactly how the Wiki has it and still no dice.
simulated function Tick(float DeltaTime)
{
local PlayerController PC;
if(Role==ROLE_Authority && Level.Game!=None && Level.Game.bGameEnded)
{
SetTimer(1.0, False);
}
if(bHudIsSetup)
return;
PC = Level.GetLocalPlayerController();
if (PC != None)
{
log("Bueller? Bueller? Bueller? Bueller?");
PC.Player.InteractionMaster.AddInteraction("AngelWeaponSwitcher.SwitcherInteraction", PC.Player);
bHUDIsSetup = true;
}
}
defaultproperties
{
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
}
I'm not even getting the "Bueller" line logged on the server or the client.
legacy-Mychaeel
08-09-2003, 06:47 AM
That's in a Mutator subclass, right?
If so, did you add your code package to the server's ServerPackages? (See Unreal Wiki: Debugging Techniques (http://www.unrealwiki.com/wiki/Debugging_Techniques#0.2)).
Angel_Mapper
08-09-2003, 07:30 AM
omfg, I feel so incredibly stupid. lol
Just need to replicate some variables and it's good to go, thanks a bunch! :haha:
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.