Do not use Resurrect like you do in Skyrim. Fallout 4 NPC will not act correctly after using Resurrect.
Use RecycleActor instead.
There is a substantial caveat with this command though. Your NPC will be reset with default inventory, so you have to take all items from the NPC before using the command (You may use UnequipAll to force NPC to take off clothes.) And if your NPC was selected from a set of pre-set appearances (like a settler/raider/gunner), one's appearance will be randomly changed. (You can exploit this command when you add a new settler into your settlement, or recruit raider/gunner as your follower, so you can choose the appearance as you like.)
RecycleActor will not remedy some effects. For instance, after an NPC injured and resulted in limping. (NPC will stay limping after you recycle him, so avoiding killing NPC with legendary weapons if you tend to keep him as your follower afterwards.) However, RecycleActor will remedy some of it, for instance, if the NPC loses its body parts, or head blown off, all body parts will be restored with default ones.
//NOTE//
Console commands are case insensitive. You can use either lowercase or uppercase characters as you like.
Sometime it is difficult to click on an object and get the correct ref ID, especially, getting from a dead NPC. You might have to search for ref ID for a named NPC from Fallout wiki or somewhere else.
Click on the workshop to get the ID. Open console and type in:
callfunction "setOwnedByPlayer" false
If you would like to regain control of the settlement, just go to the workshop then use [search] (Press [E] in PC).
//IMPORTANT// The values that govern the amount of objects to be placed in a settlement are set for a reason: to prevent the game more prone to crashes, and to reduce time to load game assets when you approach a settlement. (You will experience a noticeable stuttering when approaching a settlement with larger amount of objects) So use it conservatively.
getav 348 Get the current number of draw calls used by player.
getav 349 Get the maximum draw calls budget.
getav 34a Get the current number of triangles used by player.
getav 34b Get the maximum triangles budget.
setav <variable ID> <value> to set the number or
modav <variable ID> <value> add or subtract the number with the current value.
Do not change the current number values. (Do not use setav or modav with variable ID 348 or 34A)
You may increase the number provided by variable ID 349 or 34b by 1.5time or 2 times without serious consequence.
Use the console command: player.placeAtMe 20593 1 (Place one new settler at your location)
Click at the settler, open console and use recycleActor to cycle a set of pre-set appearance and sex of the settler.
Do not use this command after you assign NPC at a settlement, as it will break the game script and you might not be able to buy or sell to them. (If this happened, correct the glitch by assigning them to other settlement, then reassign back to the current settlement.)
Game may run into a small glitch, in which you can walk through them as the new mesh for the settler is not loaded. Saving game and restart game will correct this.
Long-press the key [V] to open workshop mode. Then select the settler and assign him/her to the targeted settlement of your choice.
Add new settler to your settlement beyond the maximum number of settlers.
Install the mod [Settlement management software] to get the Settlement management holotape.
In case the mod does not generate a new holotape, use console command to find the id.
help "settlement management" 4 and look for the ID of the holotape
then player.additem <holotape ID> 1
Use the console to place a new settler at your location.
Assign the settler to another settlement that can be assigned naturally.
Use the <settlement management holotape> with a working terminal you added to the settlement to browse the list of settler at the location that you first assign him/her to.
Use menu [move settler] to a new location. This location will be the target location of your choice. The game will move the settler to the new location regardless of the limit. However, if you lose a settler by any means, e.g., you shoot a settler to death or a gun fight broke out. (Synth replacement side quest or a situation in which you find settlers hunt each other at a settlement you approach.) No new settler will replace the lost one until the total number is below the limit. So if you need to replenish settlers, you will have to go through the same process.
Pick a weapon/armor (hold [E] botton on the item), then open the console and type:
getPlayerGrabbedRef
And use the given ref ID to add the desired effect.
<refID>.amod <effect>
Interesting effect list
001ef481 Furious Damage increased by 15% after each consecutive hit on the same target.
001cc469 Irradiated Does 50 points additional radiation damage.
001f4426 Penetrating Ignores 30% of the target's damage and energy resistance.
001e81ab Staggering Chance to stagger on hit. //BEWARE// This effect will also cripple you if your follower shoots the weapon in your path.
001cc2ad Two shot Fires an additional projectile, but has +25% more recoil.
001e7c20 Wounding Targets bleed for 25 points of additional damage, spread over 5 seconds.
somehow, I found my computer unstable if I enable grass in game. And sometime it won't play nicely with mod I use, so I disable it.
tg toggle grass
Another way to permanently remove grass is to change setting in fallout4.ini in your Document folder
bAllowCreateGrass=0
tgc Move camera around.
openactorcontainer 1 (click NPC first) show NPC container (trade with NPC)
tai (click NPC first) stop NPC movement
callFunction "Actor.SwitchToPowerArmor" none (click NPC first) force NPC to get out of power armor.
addtofaction 1c21c 1 (click NPC first) make NPC as a part of player's faction. (This prevents NPC to start firing back at you if you accidently shoot him)
getav ca_affinity (click companion first) show companion's affinity. Most companion will speak to you with new dialogue once the affinity pass 250,500,750, and 1000 (maximum affinity) . You can flirt a companion once the affinity is 500 or more and romance when 1000 or more.
===========================================
The following commands help me a lot when building a settlement. (click object first)
modPos x|y|z <value> move an object in x|y|z axis for <value> from the current position.
setPos x|y|z <value> set an object in x|y|z axis to <value>.
modAngle x|y|z <value> rotate an object in x|y|z axis for <value> from current degree.
setAngle x|y|z <value> rotate an object in x|y|z axis to <value> degree.
For instance, I would like to place a wood wall at the target height and location, but game won't allow. I might place a wood floor at the location with a different height and snap a wood wall to it, then place another wood wall at the target height, then I use getPos z with the object at the desire height, and then select the target object and setPos z <value> using the value I got form another object.
============================================
The following commands are for settlers (e.g. child settlers) so we can force them to do work!!! (click NPC first)
addKeyWord workshopAllowCommand Allow you to assign as worker (child settler may not work on a certain task, e.g., guarding, at lease you can force child settlers to work on farm.)
addKeyWord workshopAllowMove Allow you to send settler to other settlements (Beware of named NPC that involves in a quest, as you may break the quest.)
addKeyWord workshopAllowCaravan Allow you to assign settler as caravan. (Beware of named NPC that involves in a quest, as you may break the quest.)
if a settler does not follow your commands, you may repeat the command again, or use mod [Settlement Management Software] to force the command.
I found that if you leave the [Workshop Framework] or [Sim Settlements] as default (Auto assigned is turned on), you may find a bit difficult to assign a settlement to do work, as the mod's script is also trying to assign settlers at the same time. (If you force a settler to do work and the game do not respond to your command in time, I suggest you disable auto assigned in the mod's menu.)