x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

GameMode vs GameModeBase

i made a simple game that allows players to host or join a match inside the match the host decides when to start the game, after that zombies and loot start spawning on the floor

i want to allow players to join a match only before it starts,so i was reading the documentation and found that "AGameMode is more suited to standard game types like multiplayer shooters due to its implementation of the concept of match state"

is AGameMode a most suitable option for my type of game? and if so how do stop players from joining once the game begins?

GameModeBase haves a function called "PreLogin", does GameMode also inherit this function?

Product Version: UE 4.20
Tags:
more ▼

asked Aug 29 '18 at 09:14 PM in Blueprint Scripting

avatar image

Nico_Pucho_27
73 4 8 16

avatar image Nico_Pucho_27 Aug 29 '18 at 09:17 PM

i could only find OnPostLogin and not OnPreLogin

avatar image Shadowriver Aug 29 '18 at 09:21 PM

PreLogin is in GameModeBase but is not binded to blueprint

avatar image Nico_Pucho_27 Aug 29 '18 at 09:37 PM

so i need to write c++ to execute code inside this function?

avatar image Shadowriver Sep 01 '18 at 11:05 PM

Yes, or just call blueprint implementable event in that function in C++ to forward it to blueprints

avatar image Nico_Pucho_27 Aug 30 '18 at 04:50 AM

to expand this: i want to have a boolean variable in my gamemode and only allow players to connect if this boolean is true.

I found in the documentation that PreLogin is executed while the client is trying to connect to the server but i cant acces this function from the GameMode BP, i can only see the OnPostLogin function.

i guess i can check the value of the boolean on the OnPostLogin function but i would like to do it before they even connect, can i do this with BP or do i need a c++ class?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Yes GameMode inherits GameModeBase, recently some higher code been separated from GameMode just in case you don't need those extra features creating GameModeBase. Looking on API refrence should give you idea what GameMode contains and what it overrides

https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/AGameMode/index.html

more ▼

answered Aug 29 '18 at 09:19 PM

avatar image

Shadowriver
37.3k 936 172 1116

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question