Fallout 4

Fallout 4

View Stats:
Exvalcore Oct 31, 2024 @ 5:18pm
Help Adding Race Script Commands.
I changed kRace_ to Flag_ & that still didn't work I can't get any of these Skyrim functions to work in Fallout, I'm trying make work a script with the following...

Race Property HumanRace Auto Const

if Game.GetPlayer().IsInPowerArmor()
HumanRace.ClearNoCombatInWater()
else
HumanRace.SetNoCombatInWater() ;this & the above don't & are part of race script.
;Game.GetPlayer().SetRace(HumanRace);This Works it's part of the actor script.
endif
endEvent

;---------------------------------------------------------
Scriptname Race extends Form Native Hidden

; SKSE64 additions built 2024-01-17 20:01:40.731000 UTC
; returns the number of spells for the race
int Function GetSpellCount() native

; returns the specified spell from the race
Spell Function GetNthSpell(int n) native

; returns whether the specified race flag is set
bool Function IsRaceFlagSet(int n) native

; sets the specified race flag
Function SetRaceFlag(int n) native

; clears the specified race flag
Function ClearRaceFlag(int n) native

; Returns the races default voice type
VoiceType Function GetDefaultVoiceType(bool female) native

; Sets the races default voice type
Function SetDefaultVoiceType(bool female, VoiceType voice) native

; Gets/sets the skin of the race
Armor Function GetSkin() native
Function SetSkin(Armor skin) native

; Returns the number of playable races
int Function GetNumPlayableRaces() native global

; Returns the nth playable race
Race Function GetNthPlayableRace(int n) native global

; Returns a race by it's editorId name
Race Function GetRace(string editorId) native global
; race flags for previous functions
int property Flag_Playable = 0x00000001 AutoReadOnly
int property Flag_FaceGenHead = 0x00000002 AutoReadOnly
int property Flag_Child = 0x00000004 AutoReadOnly
int property Flag_TiltFrontBack = 0x00000008 AutoReadOnly
int property Flag_TiltLeftRight = 0x00000010 AutoReadOnly
int property Flag_NoShadow = 0x00000020 AutoReadOnly
int property Flag_Swims = 0x00000040 AutoReadOnly
int property Flag_Flies = 0x00000080 AutoReadOnly
int property Flag_Walks = 0x00000100 AutoReadOnly
int property Flag_Immobile = 0x00000200 AutoReadOnly
int property Flag_NotPushable = 0x00000400 AutoReadOnly
int property Flag_NoCombatInWater = 0x00000800 AutoReadOnly
int property Flag_NoRotatingToHeadTrack = 0x00001000 AutoReadOnly
int property Flag_UseHeadTrackAnim = 0x00008000 AutoReadOnly
int property Flag_SpellsAlignWithMagicNode = 0x00010000 AutoReadOnly
int property Flag_UseWorldRaycasts = 0x00020000 AutoReadOnly
int property Flag_AllowRagdollCollision = 0x00040000 AutoReadOnly
int property Flag_CantOpenDoors = 0x00100000 AutoReadOnly
int property Flag_AllowPCDialogue = 0x00200000 AutoReadOnly
int property Flag_NoKnockdowns = 0x00400000 AutoReadOnly
int property Flag_AllowPickpocket = 0x00800000 AutoReadOnly
int property Flag_AlwaysUseProxyController = 0x01000000 AutoReadOnly
int property Flag_AllowMultipleMembraneShaders = 0x20000000 AutoReadOnly
int property Flag_AvoidsRoads = 0x80000000 AutoReadOnly

bool Function IsPlayable()
return IsRaceFlagSet(self.Flag_Playable)
endFunction

Function MakePlayable()
SetRaceFlag(self.Flag_Playable)
endFunction

Function MakeUnplayable()
ClearRaceFlag(self.Flag_Playable)
endFunction

bool Function IsChildRace()
return IsRaceFlagSet(self.Flag_Child)
endFunction

Function MakeChildRace()
SetRaceFlag(self.Flag_Child)
endFunction

Function MakeNonChildRace()
ClearRaceFlag(self.Flag_Child)
endFunction

bool Function CanFly()
return IsRaceFlagSet(self.Flag_Flies)
endFunction

Function MakeCanFly()
SetRaceFlag(self.Flag_Flies)
endFunction

Function MakeNonFlying()
ClearRaceFlag(self.Flag_Flies)
endFunction

bool Function CanSwim()
return IsRaceFlagSet(self.Flag_Swims)
endFunction

Function MakeCanSwim()
SetRaceFlag(self.Flag_Swims)
endFunction

Function MakeNonSwimming()
ClearRaceFlag(self.Flag_Swims)
endFunction

bool Function CanWalk()
return IsRaceFlagSet(self.Flag_Walks)
endFunction

Function MakeCanWalk()
SetRaceFlag(self.Flag_Walks)
endFunction

Function MakeNonWalking()
ClearRaceFlag(self.Flag_Walks)
endFunction

bool Function IsImmobile()
return IsRaceFlagSet(self.Flag_Immobile)
endFunction

Function MakeImmobile()
SetRaceFlag(self.Flag_Immobile)
endFunction

Function MakeMobile()
ClearRaceFlag(self.Flag_Immobile)
endFunction

bool Function IsNotPushable()
return IsRaceFlagSet(self.Flag_NotPushable)
endFunction

Function MakeNotPushable()
SetRaceFlag(self.Flag_NotPushable)
endFunction

Function MakePushable()
ClearRaceFlag(self.Flag_NotPushable)
endFunction

bool Function NoKnockdowns()
return IsRaceFlagSet(self.Flag_AllowPickpocket)
endFunction

Function MakeNoKnockdowns()
SetRaceFlag(self.Flag_AllowPickpocket)
endFunction

Function ClearNoKNockdowns()
ClearRaceFlag(self.Flag_AllowPickpocket)
endFunction

bool Function NoCombatInWater()
return IsRaceFlagSet(self.Flag_NoCombatInWater)
endFunction

Function SetNoCombatInWater()
SetRaceFlag(self.Flag_NoCombatInWater)
endFunction

Function ClearNoCombatInWater()
ClearRaceFlag(self.Flag_NoCombatInWater)
endFunction

bool Function AvoidsRoads()
return IsRaceFlagSet(self.Flag_AvoidsRoads)
endFunction

Function SetAvoidsRoads()
SetRaceFlag(self.Flag_AvoidsRoads)
endFunction

Function ClearAvoidsRoads()
ClearRaceFlag(self.Flag_AvoidsRoads)
endFunction

bool Function AllowPickpocket()
return IsRaceFlagSet(self.Flag_AllowPickpocket)
endFunction

Function SetAllowPickpocket()
SetRaceFlag(self.Flag_AllowPickpocket)
endFunction

Function ClearAllowPickpocket()
ClearRaceFlag(self.Flag_AllowPickpocket)
endFunction

bool Function AllowPCDialogue()
return IsRaceFlagSet(self.Flag_AllowPCDialogue)
endFunction

Function SetAllowPCDialogue()
SetRaceFlag(self.Flag_AllowPCDialogue)
endFunction

Function ClearAllowPCDialogue()
ClearRaceFlag(self.Flag_AllowPCDialogue)
endFunction

bool Function CantOpenDoors()
return IsRaceFlagSet(self.Flag_CantOpenDoors)
endFunction

Function SetCantOpenDoors()
SetRaceFlag(self.Flag_CantOpenDoors)
endFunction

Function ClearCantOpenDoors()
ClearRaceFlag(self.Flag_CantOpenDoors)
endFunction

bool Function NoShadow()
return IsRaceFlagSet(self.Flag_NoShadow)
endFunction

Function SetNoShadow()
SetRaceFlag(self.Flag_NoShadow)
endFunction

Function ClearNoShadow()
ClearRaceFlag(self.Flag_NoShadow)
endFunction
< >
Showing 1-7 of 7 comments
Zekiran Oct 31, 2024 @ 5:35pm 
"in skyrim and it's not working in fallout" that's because fallout can't change race without radically ruining your game. They specifically warn of this in every single online command list.
Exvalcore Oct 31, 2024 @ 6:52pm 
Originally posted by Zekiran:
"in skyrim and it's not working in fallout" that's because fallout can't change race without radically ruining your game. They specifically warn of this in every single online command list.

I was dabbling with changing my Race to SnythGenI even went as far as copying all the human data to it with Fo4edit but when I changed race it messed up my face data so it wasn't a good option to switch to another race while in water to have the nocombatinwater flag off with the swapped race, swapping back out of water.

That's why I want to target the flag itself instead of going around about way of turning it off & on.

This is mainly because, PAUC - Power Armor Underwater Combat_1.0.esp causes to many issues with the player being able to draw their weapon thus floating in the air when not in power armor while in water.
Last edited by Exvalcore; Oct 31, 2024 @ 6:57pm
Zekiran Oct 31, 2024 @ 10:01pm 
It is literally that the game does not account for the player being anything other than human.

There are maybe 2 mods that I've ever seen that have *successfully* had a non-human main character. The warnings are there because the game doesn't deal with it. Too many calls for things that do not exist if race = anything else.
Exvalcore Nov 1, 2024 @ 4:54am 
Originally posted by Zekiran:
It is literally that the game does not account for the player being anything other than human.

I think your misunderstanding, This isn't about swapping races which have predefined references that the player needs for quests tied to the humanrace.

This is about toggling flags in the humanrace data, aka can swim can't swim can do xyz or can't, nearly the whole race script is just flag related only 1 aspect of race changing is there it's like a side note I am not talking about that, I already said I went that route & it proved to much of an issue.

The swap race is the only part that actual exists ingame still due to being in the actor script, I want all the other stuff that doesn't bork the game.
Last edited by Exvalcore; Nov 1, 2024 @ 4:57am
Originally posted by Exvalcore:
Originally posted by Zekiran:
It is literally that the game does not account for the player being anything other than human.

I think your misunderstanding, This isn't about swapping races which have predefined references that the player needs for quests tied to the humanrace.

This is about toggling flags in the humanrace data, aka can swim can't swim can do xyz or can't, nearly the whole race script is just flag related only 1 aspect of race changing is there it's like a side note I am not talking about that, I already said I went that route & it proved to much of an issue.

The swap race is the only part that actual exists ingame still due to being in the actor script, I want all the other stuff that doesn't bork the game.
GetEquippedShield and GetEquippedSpell are also in the actor script for Fallout 4, even though neither are never actually used. Both were carried over from Skyrim, where there are shields and spells you can equip and use.
Last edited by Material Defender; Nov 1, 2024 @ 1:43pm
Zekiran Nov 1, 2024 @ 3:45pm 
One questions WHY you'd want to 'stop swimming' or any of those other commands, then, because that means you're not going anywhere. Nor are your settlers, NPCs flagged as human, or companions.
Exvalcore Nov 1, 2024 @ 5:13pm 
Originally posted by Zekiran:
One questions WHY you'd want to 'stop swimming' or any of those other commands, then, because that means you're not going anywhere. Nor are your settlers, NPCs flagged as human, or companions.

You can flag yourself as a "child" to do xyz with a perk.

I why not have more options for modders to do weird stuff, you can disable all humans, with a special weapon in a cut-scene where a ghoul has created a special weapon that doesn't effect ghouls or non humans, the player might need to take a ghoul/super mutant serum as part of that kind of quest.
Last edited by Exvalcore; Nov 1, 2024 @ 5:14pm
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Oct 31, 2024 @ 5:18pm
Posts: 7