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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

how to :score system in player state

Hi guys!

Would you help me? I followed the epic steam multiplayer tutorial where we made a "player info" structure. Could you suggest how (where?) should we add the player score when we killed a player?

The "original" player state doesn't have an own/editable blueprint. (only has "get score") But if I create own player state with added variables also cannot increase the score :/

Thanks a lot! alt text

alt text

Product Version: UE 4.17
111.png (438.3 kB)
222.png (114.8 kB)
more ▼

asked Jan 08 '18 at 09:19 PM in Blueprint Scripting

avatar image

10 1 6 6

avatar image Martole Jan 13 '18 at 07:41 PM

it seems its working this way, what do you think about it? it contains the team score !

alt text alt text

avatar image pmxg Jan 15 '18 at 02:59 AM

That's fine, and I have 2 suggestions: add a Switch Has Authority node to ensure the functions about score run on server(only the pawns run on server will execute the function, clients only receive the replicated result), add a replicate Enum variable as team, not a flag

avatar image Martole Jan 16 '18 at 07:09 AM

you mean like this? Its in player blueprint when killing somebody and his health is less than 0: and the team score collecting is in game state (see above)

alt text

nevtelen.png (507.2 kB)
avatar image pmxg Jan 17 '18 at 07:58 AM

yes, the clients just need to receive events and data send from server

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

1 answer: sort voted first

Hi You can create a playerstate BP base on the PlayerState Class, and then set your BP as the Player State Class in World Setting->Game Mode alt text

20180110153524.png (135.9 kB)
more ▼

answered Jan 10 '18 at 07:38 AM

avatar image

56 1 3 1

avatar image Martole Jan 10 '18 at 09:06 PM

Thanky I set up the increasing score but how should I add it into the game state to: who has the highest score will win the match?

alt text alt text

sc1.png (349.1 kB)
sc2.png (262.7 kB)
avatar image pmxg Jan 11 '18 at 10:26 AM

Create your own Game Mode BP, check who has the highest score there, game mode can access all the player state.

avatar image Martole Jan 11 '18 at 04:20 PM

and how can i collect/add the team players score together? means how many points has the red and blue team for example? for the winning it needs

avatar image pmxg Jan 12 '18 at 03:33 AM

see: https://docs.unrealengine.com/latest/INT/Gameplay/Framework/index.html Maybe you forgot an important thing, multi player game should do things like kills and score in server, and the game mode runs only on server, so you can do it like that, when player kills,check if it's run on server, if so ,call the game mode to add team score and then add player score player graph: alt text game mode graph: alt text

character.png (89.6 kB)
gamemode.png (410.2 kB)
avatar image Martole Jan 12 '18 at 04:49 PM

m ive done this so far but it works only on server,clients doesnt increase the team scorealt text

wasdawqda.png (370.5 kB)
avatar image Martole Jan 12 '18 at 04:51 AM

Hm as far as I know Player state contains the players score Game state contains the teams score Game mode contains and "decide " which team wins or loses I made a setup ill share the pictures about it soon but still not the best one

(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