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"

Where is the HUD defined in the strategy example game?

I'm just getting started and I'm having some basic problems with understanding how to find things in the editor.

I'm trying to look at the strategy game (tower defense) example to see how it works. I can't find the HUD. In the Content Examples project, there's an actual blueprint that has the HUD functionality in it. But I can't find any HUD-related blueprint or class anywhere in tower defense. The level blueprint calls a function named "Show Wave Title" that I assume does something to the HUD, but I can't figure out where that function is defined or what it does.

I feel like I'm missing something obvious. Can someone point me in the right direction? I've read through much of the documentation and tutorials, but I guess I missed something important.

Product Version: Not Selected
Tags:
more ▼

asked Apr 10 '14 at 07:50 AM in Using UE4

avatar image

joshm
3 1 2 3

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Checking out the official description of the sample will hint at where to find the code. And it is in the code, which may not be totally obvious. I like to think it's not obvious because i dug around in the editor for quite a while trying to figure out where all the logic is. The truth is that the strategy sample is a hybrid blueprint/c++ project and a lot of the heavy lifting is in c++.

So the answer is in the code. You can find it on Windows in something like /my documents/unreal projects/strategygame. On mac its /Documents/Unreal Projects/StragetyGame. Right click on the StrategyGame.uproject file and choose the generate files for xcode or visual studio option ( look here ).

Now you can open up the code in your IDE. Look into StrategyGame/Source/StrategyGame/Classes/UI for the headers and <...>/Private/UI for the implementation.

If you want to see the build HUD code, find AStrategyBuilding::OnInputTap_Implementation() and you'll see that it will flow into AStrategyBuilding::ShowActionMenu() to show the building menus.

For the rest of the stuff, you have to figure out the code in the UI folder I believe. That's one of my remaining parts to figure out re: this example.

Hope this helps!

more ▼

answered Apr 10 '14 at 08:43 PM

avatar image

AnimalMachine
71 1 4 8

avatar image joshm Apr 12 '14 at 04:20 AM

The "Generate Visual Studio Files" context command doesn't do anything, but at least I know now where to look. Thanks

avatar image AnimalMachine Apr 12 '14 at 11:56 PM

If you have VS2013 for Windows Desktop installed it should generate a .sln to open. I was writing the answer from my Nexus7 so I couldn't remember the exact context menu option.

But if I remember right, you don't actually need to do it, since you should be able to check out the \StrategyGame\Source\StrategyGame folder and see the source code anyways. You just wont have the .sln file to have it all in visual studio nicely.

(comments are locked)
10|2000 characters needed characters left

Try going to Blueprints icon and from the roll-down for the loaded strategy project, supposing the right map is open, choose GameMode and look at its defaults, where there should be HUD info you can check out.

[Edit - oops, that's normally how but it looks like in this project the HUD's done in Slate. In the content browser if you search 'strategy' you'll see DefaultStrategyHUDStyle and DefaultStrategyMenuStyle; these point to assets like textures used in the game. I don't know how to set up slate though ... but it's possible to view the defaults. Also look up MiniMapCapture.]

more ▼

answered Apr 10 '14 at 09:59 AM

avatar image

tomofnz
1.1k 46 47 87

(comments are locked)
10|2000 characters needed characters left
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