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"

How to correctly use the GameState (for a single player game)?

For my singe player game I need to spawn a bunch of enemies at certain locations within the game world (map). So I thought I would simply create a local array in my GameMode actor, spawn the enemy at the map's target point and-- well, how would I access the target point actor in the current map from within the GameMode BP?

Then I asked myself: should the GameMode access the current map directly at all, is that the correct place to do something like this? But how else can the GameState keep track of what's going on in the game world, if it cannot access it and its actors?

I also played with the thought of adding this array of enemies and their spawning logic into the level BP. But then I thought I would need to copy this spawning logic from one level BP to the other, if only the map changes but not that logic. So it seems that logic should indeed end up in the GameMode -- or at least that is how I understand it.

Could you guys please help me to understand this interaction of GameMode - Current Map - Level BP? Thanks a lot in advance!

Product Version: UE 4.7
Tags:
more ▼

asked Jun 08 '15 at 12:52 PM in Blueprint Scripting

avatar image

haimat
236 21 36 45

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

1 answer: sort voted first

GameMode is ok. You can find all "Enemies Spawn Point" actors using "GetAllActorOfClass" https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/FindingActors/Blueprints/index.html

more ▼

answered Jun 08 '15 at 01:02 PM

avatar image

Detech
451 13 7 27

avatar image haimat Jun 08 '15 at 01:07 PM

That helps, thanks a lot.

(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