Announcement

Collapse
No announcement yet.

Interaction Class Replication? [SOLVED]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Interaction Class Replication? [SOLVED]

    i have this interaction:
    Code:
    class myinter extends interaction;
    
    function Tick(float DeltaTime)
    {
        local Actor A;
    
        local PlayerController C;
        local Pawn P;
        C = ViewportOwner.Actor;
        P = C.Pawn;
        if ( P == None || C == None || bOn == False )
            return;
    
        ForEach P.CollidingActors(Class'', A, 192)
            ... changes a;
    }
    now the actor changes like its suppose to in listen or instant action but idk how to get workin on dedicated
    does anyone know how to fix? (Object Sub-Class, i was clueless)

    #2
    So do you need it to work on a client computer then? (I am not sure it even makes sense to have an interaction on a dedicated server since iirc there is no local viewport on the dedicated server)

    I would think that your tick function would automatically return on a dedicated server, if the interaction was even spawned to begin with (where exactly are you creating this interaction?)

    Comment


      #3
      Interactions should be spawned on Clients only. Makes sense because they are made for 'Interacting' with a single client.

      This is one means of doing it by creating a GameRules subclass to spawn the Interaction on the Client computer only. I had it spawn itself when someone picked up a particular pickup type. You should be able to do it via a mutator or adding something similar to your custom Gameclass also...


      //================================================== ===========================
      // Crystal Chaos (Total Conversion Mod for UT2003/UT2004)
      // ----------------------------------------------------------------------------
      // Whodathunkit Core Development Team
      // ----------------------------------------------------------------------------
      // Shawn Downey aka. Unleaded
      // Gerald Lance Tindall aka. <NDP>BOZO
      // Wolfgang Schloyer aka. }TCP{Wolf aka. <]NDP[>Scorpion aka. Mia_The_Chaotic
      // Doug Zeager aka. Pitbull
      // John Barrett aka. [Sixpack]Shambler
      // Lisa Wiggins aka. LethalMomma
      // CODE NOT FOR REUSE WITHOUT PRIOR PERMISSION OF THE AUTHORS
      //================================================== ===========================
      // CCEngine.CC_SpecialItemGameRule:
      // Spawns a Special Interaction that Allows CC_SpecialItems to be Dropped.
      //================================================== ===========================
      class CC_SpecialItemGameRule extends GameRules;

      var bool bAffectSpectators; // If this is set to true, an interaction will be created for spectators.
      var bool bAffectPlayers; // If this is set to true, an interaction will be created for players.
      var bool bHasInteraction; // If true then the interaction was already created.
      var string SpecialItemInteractionName; // Interaction class.


      //================================================== ===========================
      // CC_SpecialItemGameRule.OverridePickupQuery
      //================================================== ===========================
      simulated function bool OverridePickupQuery(Pawn Other, Pickup item, out byte bAllowPickup)
      {
      local PlayerController PC;

      PC=Level.GetLocalPlayerController();

      if(Level.NetMode!=NM_DedicatedServer && PC!=None && !bHasInteraction)
      {
      PC.Player.InteractionMaster.AddInteraction(Special ItemInteractionName, PC.Player); // Create the interaction
      bHasInteraction = True; // Set the variable so another Interaction is not spawned
      }// endif


      if ( (NextGameRules != None) && NextGameRules.OverridePickupQuery(Other, item, bAllowPickup) )
      return true;
      return false;

      }// end simulated function CC_SpecialItemGameRule.OverridePickupQuery


      //================================================== ===========================
      // CC_SpecialItemGameRule:defaultproperties
      //================================================== ===========================
      defaultproperties
      {
      bAffectSpectators=False
      bAffectPlayers=True
      bHasInteraction=False
      SpecialItemInteractionName="CCEngine.CC_SpecialIte mInteraction"

      NextGameRules=None

      RemoteRole=ROLE_AutonomousProxy
      bAlwaysRelevant=True
      }// end CC_SpecialItemGameRule:defaultproperties

      Comment


        #4
        NVM Solved, Thx for you attemped help any way I mean well

        Comment

        Working...
        X