Announcement

Collapse
No announcement yet.

player start: what's the point?

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

  • replied
    Originally posted by ClavosTech View Post

    Yes you can!

    The Livestream spends quality time covering this: How to create your own Player-Start or override the default etc. Just watch the YT clip from the timestamp... As you surmised, Player-Start is really just a placeholder. So you can use notes, meshes or any actor to randomly select a location / transform from an array etc.
    I've seen some of it, jump searched for something that could help me out, but it went through some multiplayer stuff and, quite frankly, things that right now it's out of my reach, since I'm an archviz artist trying to make sense of ue4 to behave like I want on my archviz scenes.

    however while watching it I saw some node that made me wonder about another node and so I looked for a restart player node and it exists, so I just added it after my set default pawn node and it worked! so it was really helpful after all. also saved this video for future reference, there's a lot of ideas there which can be useful for different situations

    so case closed, thanks a lot man

    oh btw, this is what I was using before:
    https://blueprintue.com/blueprint/c6l_994y/

    and this is what I'm using now:
    https://blueprintue.com/blueprint/442ww1wx/

    both are small codes and do the same, but the difference is that now the player start actor actually serves a purpose of spawning the default player rather than being just a reference for transform coordinates.

    cheers
    Last edited by fael097; 05-14-2019, 10:18 AM.

    Leave a comment:


  • replied
    since the player start actor always spawns the default pawn.... if I could make a script to set the default pawn appropriately before the player start runs
    Yes you can!

    The Livestream spends quality time covering this: How to create your own Player-Start or override the default etc. Just watch the YT clip from the timestamp... As you surmised, Player-Start is really just a placeholder. So you can use notes, meshes or any actor to randomly select a location / transform from an array etc.
    Last edited by EntrpriseCustomr; 05-13-2019, 12:10 PM.

    Leave a comment:


  • replied
    Originally posted by ClavosTech View Post
    You can prevent Pawns from spawning at game-start just by blanking the Default-Pawn-Class in Project-Settings -> Maps & Modes and setting it to 'None'... Make sure that the Level itself has no Pawn-BP-Actors too! Then just add logic in Gamemode -> Begin-Play that contains a Branch to detect if a HMD is connected or not, and then spawn and possess the appropriate Pawn after that. No menus are needed. You don't even need a Default-Pawn type or Player-Starts (Notes work fine as well).
    yes! but you see, that's my original question regarding the player start actor. if I have to use the spawn node for spawning the character/pawn that I want, then the player start actor isn't of much use, I could just use a dummy or any invisible actor to get the coordinates for spawning the character or even set the spawn transform in a variable inside the blueprint and no actors in game. in fact that's the first thing I did, and it works, but that's what made me wonder about the player start

    since the player start actor always spawns the default pawn, I was wondering if I could make a script to set the default pawn appropriately before the player start runs.

    If my game mode has no default pawn set, and I make a simple script inside the game mode blueprint like this: on begin play, set default pawn to mycharacter, it won't work, won't spawn any characters, so I assume the player start actor runs before the game mode is able to set the default pawn
    Last edited by fael097; 05-13-2019, 11:53 AM.

    Leave a comment:


  • replied
    You can prevent Pawns from spawning at game-start just by blanking the Default-Pawn-Class in Project-Settings -> Maps & Modes and setting it to 'None'... Make sure that the Level itself has no Pawn-BP-Actors too! Then just add logic in Gamemode -> Begin-Play that contains a Branch to detect if a HMD is connected or not, and then spawn and possess the appropriate Pawn after that. No menus are needed. You don't even need a Default-Pawn type or Player-Starts (Notes work fine as well).
    Last edited by EntrpriseCustomr; 05-13-2019, 01:20 AM.

    Leave a comment:


  • replied
    You can watch it from here...

    But in your case much of the Livestream (after the community intro) is about creating a custom player-start / spawn-point class, so you might find it interesting. Outside of that as regards generally solving your original point, you can just code it all in Gamemode anyway...
    Last edited by EntrpriseCustomr; 05-13-2019, 01:19 AM.

    Leave a comment:


  • replied
    Originally posted by ClavosTech View Post
    Epic just ran a Livestream last week with:
    Gamemode -> HandleStartingNewPlayer...
    Who knows it might be just what you want.
    that's quite a long stream, do you know the time code where they talk about this?

    Leave a comment:


  • replied
    I see. but the thing is that I won't have a menu as this should be an archviz scene.

    I just want it to spawn the VR pawn if my HMD is enabled, or spawn the first person character if HMD is disabled.

    I added a branch node on begin play to set the default pawn accordingly if HMD is enabled, but I coded it inside the game level blueprint, and when I started the game, the default pawn had already spawned, so I guess this code should go somewhere that loads before the game mode. I tried inside the level blueprint with cast to game mode, but no deal too, so I assume this only works if you have a menu before loading this level?

    Leave a comment:


  • replied
    Epic just ran a Livestream last week with:
    Gamemode -> HandleStartingNewPlayer...
    Who knows it might be just what you want.

    Leave a comment:


  • replied
    I have never done it but who says you can't change at runtime? Looks like you can. Of course you can't do this once a level has started as the default pawn will have already been created but. You should be able to do it in a menu level, store the new default pawn class in the game instance or something and then pass it along prior to opening up the first level.

    Attached Files

    Leave a comment:


  • replied
    Originally posted by Nebula Games Inc View Post
    Because you can change the "default" pawn and still have the new pawn spawn in exactly the same location without having to delete the character you dragged in and replace it with the new one. Imagine if you had a character selection menu....you can't have a character already in the level because you don't know what the player will choose. Having a "player start" allows you to determine where ANY player character will begin in your level without having to specify which character it is before hand.
    This makes sense, I thought that was the case, but how do I actually change the default pawn via blueprint?

    I currently have my game mode's default pawn set to none, and a dummy player start actor dragged into the game just as a reference for transforms. then in my game mode blueprint I have a "spawn actor of class" on begin play, and a branch for if head mounted display is enabled then spawn "VRpawn" and else spawn "gamepadpawn", and then I use the player start transform as a location for the pawns to start. this is not very intuitive, I should be able to just change the default pawn on that branch instead of spawning an actor, however I googled how to do this and didn't find anything, only found that you can't change the default pawn while in game, and I'm not sure if on begin play counts as already in game or not. so how do I do this properly?

    Leave a comment:


  • replied
    Because you can change the "default" pawn and still have the new pawn spawn in exactly the same location without having to delete the character you dragged in and replace it with the new one. Imagine if you had a character selection menu....you can't have a character already in the level because you don't know what the player will choose. Having a "player start" allows you to determine where ANY player character will begin in your level without having to specify which character it is before hand.

    Leave a comment:


  • replied
    An actually more relevant question: if the player start actor always spawn the default pawn in game mode, then what's the point anyway? why no just drag the default pawn into the level instead of a player start?

    Leave a comment:


  • replied
    Originally posted by DsyD View Post
    Haven't tried it myself but you should be able to get it using Get All Actors of Class and taking the first element from the output array (assuming you have only one PlayerStart actor in the level).
    ah yes, forgot about this node. well it works, so thank you!

    Leave a comment:


  • replied
    Haven't tried it myself but you should be able to get it using Get All Actors of Class and taking the first element from the output array (assuming you have only one PlayerStart actor in the level).

    Leave a comment:


  • replied
    Originally posted by DsyD View Post
    I'd put it in the GameMode. You can assign your default GameMode BP class for every level, but you cannot have a "generic" Level BP class that serves as a parent to every Level BP.

    So if you put the script in the Level BP, you need to copy it to every Level BP in your game. If you put it in a custom GameMode (or GameModeBase), you can just script it once and set the default GameMode to your custom GameMode.
    ok, now how do I spawn it? spawn actor node requires a transform, and I can't seem to get the transform of a player start actor from inside the game mode blueprint

    Leave a comment:

Working...
X