Hatred
Hatred Modding Encampment
Welcome to Hatred's modding community. Here you can find nearly everything you need to fulfill your darkest fantasies. Be creative! It's the key to happiness. :)
Learn More
 This topic has been pinned, so it's probably important
Mod Creation FAQ
If you do not have editor working on your PC start with this topic.

Here you will find tips on how to actually get stuff done using our custom module, or some tips on how to get something done using UE4 that is not trivial or obvious. Feel free to ask questions either through PMing me or asking on steam / our forums. I'll keep adding questions as they come up so there's something to base on and point new modders to.

I don't see a point in repeating the documentation therefore I will link to it often.

The best way to see how something is done is to look it up in the actual working maps. It's not always a perfect solution, but at least it's an acceptable one. In most cases. I hope. I haven't seen everything ;)

Alternatively, you can always ask. I'd really enjoy not being spammed with the same, already answered questions over and over again, but I'm more than certain that it will happen. So I reserve myself the right to reply with links to answers in one of my topics.

We've also decided to make several guides for you to make it easier to start creating mods. Here you have the link to the first one, I'll keep them linked in the order.

For those more or less familiar with UE4 this is going to be a great help on actually doing stuff the way it's supposed to be done in our game. For those who just start with UE4 I suggest to take it slowly - you're not going to make the perfect map on the first try. Nonetheless, both those groups will need this FAQ, as it proved out after initial testing. So, let's start with list of contents ;)

Contents:
  1. General
  2. Map Pack related
  3. Total Conversion (TC) related
  4. Performance
  5. Debugging

And here the same useful links as in the other topic:
UE4 Documentation[docs.unrealengine.com]
UE4 Wiki[wiki.unrealengine.com]
UE4 Answer Hub[answers.unrealengine.com]
UE4 Forums[forums.unrealengine.com]
Destructive Creations Forum - Hatred Modding Board[forums.destructivecreations.pl]
Last edited by DC_vipeout; 8 Apr, 2016 @ 3:45am
< >
Showing 1-5 of 5 comments
DC_vipeout 3 8 Feb, 2016 @ 3:05am 
General

Q: Can I modify a single blueprint?
A: Yes. Either just do it and cook as TC, or copy the map files you want to include in your mod to the plugin content, copy the blueprint you want to modify to the plugin content, modify the blueprint and replace the blueprints existing on the map with the modified version.

Q: I can see my maps inside the plugin folder in windows explorer but not in the Content Browser. Why is that?
A: Things break. Happens. Reopen the editor and pretend it never happened. Or, alternatively, keep spamming Epic on AnswerHub to fix it ;)

Q: Why my map name does not update inside the DC Workshop window after renaming?
A: You have to hit 'Refresh'.

Q: How do I change/add a soundtrack to a stage?
A: Blueprint'/Game/Blueprints/Game/HatredMusicPlayer.HatredMusicPlayer'

Place this BP on a level. There are some basic properties for default behavior under F4 (details tab). If you want to change it in run-time, call 'Change Music Track' on that object in the level blueprint.

Q: Is there a way to put a UE4 basic geometry (a square, circle, cylinder, etc) in the map and make them destructible?
A: Yup. The basic geometry is a cube in engine content, so basically copy it to some folder in the Game Content and then right click it and go with 'Create Destructible Mesh'. You can create a DM off of any Static Mesh you desire. As for the options and all the tweaking - they are here[docs.unrealengine.com]

Q: How do I make a vehicle enterable?
A: Click it, F4, check 'Enabled' under 'Vehicle' tab. CopCar is by default opened, for example. You can change this at run-time as well.

Q: How to change AI's weapon?
A: Locate the blueprint of the character you wish to modify, open it. Browse the class defaults, find 'Inventory' tab. There's 'Default Inventory Classes' field. Change the weapon, add proper ammo type in the 'Inventory Ammo' array. If you don't they will have the gun but be unable to shoot and will drop it to find a weapon with ammo. You can add custom weapons here, just make sure that your custom weapon has the right parent class (check up the original weapons parents)

Q: Why are grenades exploding in my hands?
A: When placing a Trigger Volume or any trigger actor, change their collision preset to 'TriggerVolumeforPawns'.

Q: How to add a custom character to the game?
A: DC_SatanicBlood has made a tutorial for you covering this subject.

Q: How to make roofs disappear?
A: Guide describing the process.

Q: How to change the Game Mode on a map?
A: Make a new blueprint that is a child of our gamemode, save it, move it to plugin content if doing Map Pack, make a new blueprint that is a child of our MyCharacter, save it, move it to plugin content if doing Map Pack, change the default pawn class in GM class settings, set the Game Mode on map world settings, recook. Changing Game Mode allows you to change the default pawn class as well as several other general BP's that are capable of changing tons of things.

Back to top
Last edited by DC_vipeout; 24 Feb, 2016 @ 12:07am
DC_vipeout 3 8 Feb, 2016 @ 3:32am 
Map Pack related

Q: What can you do with a Map Pack? If you have to add a map, then modding campaign is only possible through TC?
A: Not really. While cooking as TC will allow you to change everything, you can also copy all the campaign maps to the plugin content and then add all the modified blueprints, animations and models that you wish. Cook as Map Pack. Works the way you'd expect, thing is you have to launch it from 'User Content' menu. You can make an FPS map without destroying someone's main experience. You can do a tower defense or racing map, without breaking all the vehicle and AI for the campaign. It is doable as a TC without breaking stuff, but much harder.

Q: How to copy campaign map into plugin content so I can modify it?
A: Do not do it through the OS (explorer / total commander / etc ). It really will not work. Anything you do with the engine you do through the engine unless you really know what you're doing or there's a bug / need for a hack / etc. Since this is not as straightforward as one would think, I've made a guide for it, taking Army Base as an example.

Q: How to make a mini-campaign using Map Pack with several maps?
A: You have to use our End Level macro with proper level name. Syntax:
/ModName_ModUID/MapName
Where to find it? It's the folder name after you create the mod. Example below:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=620041633
Back to top
Last edited by DC_vipeout; 12 Feb, 2016 @ 5:06am
DC_vipeout 3 8 Feb, 2016 @ 3:33am 
Total Conversion (TC) related

Q: Why does TC block all other mods? Why can't I have 2 TC's running?
A: Generalizing, the engine upon start with TC enabled, loads all the content from the base game, and then overrides those with each asset found in the TC mod. You may modify a weapon blueprint, but it is relying on some functions in the character blueprint, which relies on materials for burning, particles, animations and so on. Things do reference one another.

Then if you launched another TC which modifies character blueprint it may work or it may break. We're unable to tell what kind of things you may want to change in the character blueprint. It may break both mods entirely in the worst case and the game would crash. Yes, you could go with 'the modders should know what they're doing' but the topic is much more complex than my simple explanation here. This is the way Epic implemented TC and this is how it's meant to be used.

Back to top
Last edited by DC_vipeout; 9 Feb, 2016 @ 12:19am
DC_vipeout 3 8 Feb, 2016 @ 3:33am 
Performance

This is about mod performance (map / blueprints / etc), not the editor performance. For that look here.

Q: How to make my map run with more FPS?
A:
  1. Keep the radius of your lights as small as possible. You rarely need a light that covers half the map.
  2. Use spot lights instead of point lights where possible
  3. Disable shadow casting on lights that do not have to do so and on objects that are so small that their shadow will never be seen either way
  4. Use Cull Distance Volumes to make sure than objects you cannot see are not rendered. Keep in mind that this does not work for blueprints and you have to manually set the Max Draw Distance for each component of the blueprint.
  5. Do not overuse physics. Generally you want objects to be asleep and wake them when needed instead of keeping them awake 24/7.
  6. When creating custom blueprints, remember to clean up after doing the job - stop the timelines, disable lights, deactivate particles and so on.
  7. Try to not overuse 'Tick' function in the level blueprint. 'Tick' is called every frame and if you put something heavy in there your PC will feel it.
  8. More here[docs.unrealengine.com]

Q: How to see what is causing my FPS to be so low?
A: The topic is quite deep, but some easy to use things that can help you:
  1. Open up the cmd (~) and type 'stat raw' and 'stat fps'. This will let you determine what bounds your FPS and is the first step. Draw is CPU render thread (prepare data for GPU), Game is the actual stuff that CPU does (AI, physics, updating the game state, input). From here you just dig deeper and deeper to find the actual cause of the issue. Obviously keep in mind that this heavily depends on your rig, therefore on other people's PC's something else may be problematic.
  2. Documentation on the subject[docs.unrealengine.com]
  3. Example on a blog[www.unrealengine.com]

Back to top
Last edited by DC_vipeout; 9 Feb, 2016 @ 12:03am
DC_vipeout 3 8 Feb, 2016 @ 3:33am 
Debugging

Q: How to see values of variables in run-time (when the game runs)?
A: There are several ways to achieve this:
  • Put a 'Print String' node in the blueprint and print the variable you want to know each tick - but this one will heavily spam the log and window
  • Have the blueprint opened when you launch the game and put a breakpoint on the node that uses the variable (default F9). The execution will stop once it arrives at the node, letting you see the current state.
  • Use displayall / getall command. Open up the cmd (~), syntax is as follows:
    displayall classname variablename
    • "Classname" for blueprints is the name of the blueprint with '_C' suffix.
    • "Variablename" is the name of your blueprint variable, or in case of a *.cpp variable - the way it is named in code. To get it's name modify that parameter in the actor, copy the actor (CTRL+C) and paste into notepad. There you can find it's real name. Keep in mind this displays only the modified values - the default ones are not stored for every actor.

Back to top
Last edited by DC_vipeout; 9 Feb, 2016 @ 12:10am
< >
Showing 1-5 of 5 comments
Per page: 1530 50