Post by tommah on Jun 28, 2015 17:42:23 GMT -5
This is the full mission to spawn Hank, could most likely be stripped so that you use ONLY what is needed to spawn him. Will work on this in the future.
*EDIT* This is the least amount of data needed to spawn an NPC so far. Just like in other games I recommend copying and pasting an NPC so you don't interfere with the game's mission for that character.
First copy and paste a survivor you want to spawn and give it a unique name i.e. 'HankTest' (doesn't exist in the game yet). If you aren't making any changes to the survivor then you're done, save and compile. If you want to alter the Survivor at all (example is Hank aka svr_48), find the Component Type you want to alter (example: '"-110529180" //CSurvivorComponentState'), find the ComponentState ('3513664055' by default) copy, paste, and rename ('HankTestState' in my example) and you can see I changed his 'Emotion' from 'AGGRESSIVE' to 'CALM'.
This creates a new Hank whose idle actions are calm. If you wanted to just change the original survivor's Emotion you would not need to copy and paste, this is ONLY for creating new survivors.
EXAMPLE
In coregameplay_bulk files or a new .bin
The new survivor is created but is not getting loaded into the world yet. Unpack and open \data\fs_scriptmission and paste the example at the top of your fs_scriptmissions file. This is the least amount of data needed to spawn an NPC that I know of at the moment. All pieces need to have a unique name as to not interfere with the game's existing missions.
-cFSMission is the actual mission to spawn the NPC, includes duration, what to do when mission starts, what happens when mission ends, and everything inbetween. The only thing you really NEED is the 'OnEnter'.
-cFSSetOfActions is the list of actions that take place 'OnEnter' of the mission. This is where the Action of actually spawning the NPC goes.
-cFSSpawnNPC is the details on spawning the NPC. Of course the Titles must be unique, 'spawnnpc' but in my experiences the 'Name =' must also be unique. I tried spawning 4 survivors using the same 'Name' and the last one listed was the only one to spawn. I changed the 'Names' to be unique, then they all spawned.
-'NPCName' is the name you gave your new survivor or existing survivor
-'Position' is where to spawn the NPC, very tough at the moment since we don't have a player locator yet. Use item placementsin the different 'levels' to help you out.
-'Rotation' is where they face
-'ItemToAttach' is an item they are spawned with.
-'Attachment' how they hold the item. If this is incorrect they will not spawn with the item.
That's it, save and compile and you're done. Don't forget to change 'ActionNames' and 'ParentFSClass'.
EXAMPLE
In fs_scriptmission.txt
*EDIT* This is the least amount of data needed to spawn an NPC so far. Just like in other games I recommend copying and pasting an NPC so you don't interfere with the game's mission for that character.
First copy and paste a survivor you want to spawn and give it a unique name i.e. 'HankTest' (doesn't exist in the game yet). If you aren't making any changes to the survivor then you're done, save and compile. If you want to alter the Survivor at all (example is Hank aka svr_48), find the Component Type you want to alter (example: '"-110529180" //CSurvivorComponentState'), find the ComponentState ('3513664055' by default) copy, paste, and rename ('HankTestState' in my example) and you can see I changed his 'Emotion' from 'AGGRESSIVE' to 'CALM'.
This creates a new Hank whose idle actions are calm. If you wanted to just change the original survivor's Emotion you would not need to copy and paste, this is ONLY for creating new survivors.
EXAMPLE
In coregameplay_bulk files or a new .bin
cGameObjectState HankTest {
Super = "@0"
ConstData = "@4245099731"
Pos = "-0.00109863,-0.000762939,-0.00109863"
Rot = "0.00195693,0.00195693,0.00195693,0.999994"
Key = "HankTest"
ComponentTypes = [ //The types of Component States that correlates with ComponentStates below
"1020651797" //cPerceptionComponentState
"1607805989" //cNPCVisualSensorComponentState
"712729568" //cNPCTargetSelectionComponentState
"712729568" //cNPCTargetSelectionComponentState
"712729568" //cNPCTargetSelectionComponentState
"712729568" //cNPCTargetSelectionComponentState
"-1169885905" //cCommonHitReactionComponentState
"2023205185" //cStaticTaskResolverComponentState
"1420726110" //cDR3BaseIntentionResolverComponentState
"1614679116" //cUpperBodyIntentionResolverComponentState
"-1721520222" //cActorClimbingControllerComponentState
"-756033260" //cWarpInfoCacheComponentState
"1270828853" //cLocomotionComponentState
"-1698152753" //cPathfinderComponentState
"1395005015" //cEdgeDetectorComponentState
"-1825142307" //cStateGraphComponentState
"1885514760" //cActorPhysicsComponentState
"1386327933" //cDamagerComponentState
"-90806063" //cDamageableComponentState
"-1229971842" //cHealthComponentState
"-2095680330" //cBeaconComponentState
"-739678378" //cSimpleInventoryComponentState
"1074324412" //cSickComponentState
"-1453990163" //cObjectInteractionComponentState
"1523992625" //cMiniGameComponentState
"1831004791" //cTicketDispenserComponentState
"-110529180" //CSurvivorComponentState
"662677988" //cAnimParamComponentState
"725021907" //cPartitionedCombatLogComponentState
"1876710185" //cHUDComponentState
"1357123616" //CActorComponentState
"1206908930" //cDialogueComponentState
"1837946451" //cRangedComponentState
"-1017691240" //IKComponentState
"2077883786" //cAutoAimComponentState
"1641192294" //cCombatComponentState
]
ComponentsState = [ //The actual references of the ComponentTypes listed above
"@549615302" //cPerceptionComponentState
"@2290702882" //cNPCVisualSensorComponentState
"@470192376" //etc...
"@889160309"
"@2346164120"
"@1064272871"
"@1019749113"
"@925272410"
"@1240238714"
"@705508219"
"@1778706161"
"@2872294803"
"@2305079462"
"@3386444172"
"@3895750372"
"@1221017630"
"@3930066611"
"@1926449418"
"@3755483658"
"@1779797661"
"@529530469"
"@3165349009"
"@73788383"
"@3238189067"
"@895637386"
"@2620271280"
"@HankTestState" //@3513664055
"@4202558595"
"@3799121864"
"@2850232926"
"@HankTestActor" //@3337939388
"@590234905"
"@4071260424"
"@2507490339"
"@1550642013"
"@12989365"
]
}
cSurvivorComponentState HankTestState {
ConstData = "@1822016983"
Emotion = "CALM" //AGGRESIVE
PreciousItemArchetype = "0"
OnDeathMessage = "'IDS_HUD_NPC_DIED'" //%1 is dead!
FoodHealthGainedModifier = "2"
GrappleRating = "3"
RunSpeedRating = "1"
ToughnessRating = "3"
FireArmsRating = "3"
StrengthRating = "3"
DefaultLockerStatus = "INVALID"
CachedStateKey = "'svr_48'"
PreJoinTetherRadius = "5"
ShouldDisplayInContactList = "false"
StartInPrejoinState = "false"
DefectionMinDamage = "40"
DefectionMinHits = "3"
DefectionMaxTimeBetweenHits = "5"
DefectionMinTimeFromFirstHit = "2"
}
cActorComponentState HankTestActor {
ConstData = "@HankTestActor_def"
}
cActorComponentDef /* 3792283450 */ HankTestActor_def {
Key = "HankTestActor_def"
Skeleton = "@182087331"
ActorAssetType = "SKINNED"
AssetFilename = "data/models/npcs/svr_48"
AudioName = "0"
Scale = "1,1,1"
InVehicleScale = "1"
Height = "1.8288"
Radius = "0.3"
ModelForwardOffset = "0"
ModelHeightOffset = "0.055"
LowerRingHeightOverride = "0.397"
HandlingStyleOffsetList = [
]
StringName = "svr_48_def"
IsNPC = "true"
SupportsFaceAnims = "true"
SupportsHandAnims = "true"
CommonAssetFilename = "m0"
IsFemale = "false"
IsFat = "false"
RigidBodyCollisionFilter = "WORLDCOLLISIONFILTER_ZOMBIE_ONLY"
}
The new survivor is created but is not getting loaded into the world yet. Unpack and open \data\fs_scriptmission and paste the example at the top of your fs_scriptmissions file. This is the least amount of data needed to spawn an NPC that I know of at the moment. All pieces need to have a unique name as to not interfere with the game's existing missions.
-cFSMission is the actual mission to spawn the NPC, includes duration, what to do when mission starts, what happens when mission ends, and everything inbetween. The only thing you really NEED is the 'OnEnter'.
-cFSSetOfActions is the list of actions that take place 'OnEnter' of the mission. This is where the Action of actually spawning the NPC goes.
-cFSSpawnNPC is the details on spawning the NPC. Of course the Titles must be unique, 'spawnnpc' but in my experiences the 'Name =' must also be unique. I tried spawning 4 survivors using the same 'Name' and the last one listed was the only one to spawn. I changed the 'Names' to be unique, then they all spawned.
-'NPCName' is the name you gave your new survivor or existing survivor
-'Position' is where to spawn the NPC, very tough at the moment since we don't have a player locator yet. Use item placementsin the different 'levels' to help you out.
-'Rotation' is where they face
-'ItemToAttach' is an item they are spawned with.
-'Attachment' how they hold the item. If this is incorrect they will not spawn with the item.
That's it, save and compile and you're done. Don't forget to change 'ActionNames' and 'ParentFSClass'.
EXAMPLE
In fs_scriptmission.txt
cFSMission spawnnpcMission {
Name = "spawnnewNpc" //must be unique?
ParentFSClass = "@0"
ActionName = "spawnnpcMission"
IgnoreAction = "false"
RemoveBeforeShip = "false"
SkipInCoop = "false"
StartTime = "0"
ChildActions = [ //additional mission actions go here i.e. Autosave
]
Duration = "864000"
UseRealTime = "false"
GameMode = "@1662361359"
SupportedGameModes = "@1451085382"
OnEnter = "@spawnnpcAction" //spawn hank
OnExit = "@0"
MissionType = "MISSION_TYPE_BACKGROUND"
DontAutoCompleteOnDebugJump = "true"
Chapter = "15"
FailureConditionGroup = "@0"
Success = "@0"
Failure = "@0"
Complete = "@0"
Prereq = "@0"
LevelToGoToIfDebugMission = "2059905507"
DebugSpawnPointName = ""
DevSpawnPointName = ""
MissionAnimBankName = ""
DebugMenuTitleString = "0"
TitleString = "0"
Description = "0"
ES_Broadcast_String = "0"
ScannerDelay = "90"
AudioMissionName = ""
IdealTime = "0"
MinRandomizedDelay = "0"
MaxRandomizedDelay = "0"
MissionActivationLocation = "-99999,-99999,-99999"
MissionActivationDistance = "50"
DoNotTimeOutNearThisLocation = "-99999,-99999,-99999"
DoNotTimeOutNearThisObject = "0"
DoNotTimeOutDistance = "25"
ShowInDebugMenu = "false"
ExplicitStart = "false"
WaitUntilTimeExpires = "false"
ShowInHUD = "false"
IsBoss = "false"
IsStrongholdMode = "false"
IsStrandedSurvivor = "false"
IsSoulmate = "false"
IsCountedGameSummary = "false"
IsEntreActe = "false"
IsEscortMission = "false"
ActiveDialogues = [
]
PlayerLevelOnDebugJump = "0"
PossibleReward_PP = "false"
PossibleReward_Weapon = "false"
PossibleReward_Blueprint = "false"
PossibleReward_JoinedSurvivor = "false"
PossibleReward_AttributePoint = "false"
PossibleReward_SoulmateCode = "false"
PossibleReward_MegaManItem = "false"
}
cFSSetOfActions spawnnpcAction {
Name = ""
ParentFSClass = "@1003840762"
ActionName = "spawnnpcAction" //retype the title
IgnoreAction = "false"
RemoveBeforeShip = "false"
SkipInCoop = "false"
StartTime = "0"
ChildActions = [
"@spawnnpc" //spawn hank
//can also list item placements here
]
}
cFSSpawnNPC spawnnpc { //hank
Name = "spawnHanknpc" //must be unique
ParentFSClass = "@spawnnpcAction"
ActionName = "spawnnpc"
IgnoreAction = "false"
RemoveBeforeShip = "false"
SkipInCoop = "false"
StartTime = "0"
ChildActions = [
]
NPCName = "HankTest" //name of survivor from bin file
Position = "-422.4,24.7,-95.9" // location on map
Rotation = "-0.025529,0.942742,-0.0742474,-0.324151" //rotation of npc
ItemToAttach = "0" // "'assault_rifle'" (along with 'Attachment' below will spawn with rifle)
Attachment = "@0" //"@4090985211" (must be correct in order to spawn with item)
}
//////////////////////