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"

RESTARTGAME() - Keeps resetting GameState Values

Hi guys,

So I'm trying to implement the concept of rounds, and I have a maximumNumRounds under GameMode, and I keep track of the total number of rounds under my GameState.

So if GameState->TotalNumRounds < maximumNumRounds then we can restart the game when the time runs out using: RestartGame(). But no matter how I tried to implement this, the values keep getting reset to default (I tried seamless and non-seamless).

Any thoughts on the matter would be appreciated. (I would like to refrain from having to create a custom class just to keep track of said values).

ty

Product Version: UE 4.8
Tags:
more ▼

asked Jun 26 '15 at 11:54 PM in C++ Programming

avatar image

Venros
129 10 11 15

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

1 answer: sort voted first

Hi Venros,

Gamestates are destroyed and recreated on restarts. The Game Instance class is persistent between levels. You can quickly use that to keep game to game stats.

More Info on GI: https://wiki.unrealengine.com/Game_Instance,_Custom_Game_Instance_For_Inter-Level_Persistent_Data_Storage

Hope that helps =)

more ▼

answered Jun 27 '15 at 12:05 AM

avatar image

Devero
2.3k 114 62 235

avatar image Venros Jun 27 '15 at 12:25 AM

Man wish I found this a week ago lol, thnx for the quick reply this will fix my problem.

(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