Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

[Solved] Spawning and accessing actors for client-side

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

  • [Solved] Spawning and accessing actors for client-side

    I am testing some squad based implementations at the moment.
    So every player that connects to the Listen server gets three bots that follow the player around.

    So in PostLogin() I call the function which spawns these bots
    Code:
    ZoR_PlayerController(NewPlayer).PlayerSpawned();
    This works fine for the server, since it is the server that calls the PlayerSpawned() function for all PlayerControllers in the game.

    This obviously gives problems for all other players. The bots are spawned when they connect, but the client's PlayerController can't find the bots.

    The method I was going about this in was to spawn the Bots inside the player controller and put them in an array. This array will obviously be empty on the client side.
    I have tried using:
    Code:
    foreach WorldInfo.AllActors(class'ZoR_FollowerPawn', C)
    But that yet again only finds the bots on the server side (mind you that the bots are replicated and visible for all clients)

    There really must be some simple way of spawning Actors from a client and have the client being able to find and control the actors.

    Any help or ideas would be appreciated.

  • #2
    I am having the same situation when it comes to forcing a Scaleform window to display on all the clients.

    Whatever function i call on NewPlayer (in PostLogin()) is executed only on the server (in this case a listen server). So when I tell NewPlayer to display my Lobby movieclip it shows up on the listen server.

    I could of course force it by declaring the function in my PlayerController as reliable client. However that gives an issue later in the Lobby window. The Lobby has a Ready button so all players have to click ready before the game starts. And when I use reliable client to launch the movieclip the movieclip cant get a hold of Game. Which makes it hard to tell the GameInfo that a player has pressed the ready button.
    I am quite clueless here. There has to be a way to do this.

    Save me from my despair :S

    Comment


    • #3
      Originally posted by DragonSpawn View Post
      I have tried using:
      Code:
      foreach WorldInfo.AllActors(class'ZoR_FollowerPawn', C)
      But that yet again only finds the bots on the server side (mind you that the bots are replicated and visible for all clients)
      That should work. Are you sure you're looking for the Pawn class and not the Controller class? The Controller won't exist on the client, but the Pawn will (assuming it's relevant)

      Originally posted by DragonSpawn View Post
      I could of course force it by declaring the function in my PlayerController as reliable client. However that gives an issue later in the Lobby window. The Lobby has a Ready button so all players have to click ready before the game starts. And when I use reliable client to launch the movieclip the movieclip cant get a hold of Game. Which makes it hard to tell the GameInfo that a player has pressed the ready button.
      I am quite clueless here. There has to be a way to do this.

      Save me from my despair :S
      You should have a server function on your PlayerController that you use to notify the server of the player's state.

      Comment


      • #4
        Thanks a bunch, Mysterial.
        This solved both my issues. I was pretty close all along, but since I didn't quite understand the PlayerController replication I kept missing the mark.

        Thanks again. You definitely made my week.

        Comment

        Working...
        X