Halstrom Posted March 8, 2018 Posted March 8, 2018 I just want to know when the player kills something what it was, human/robot/creature etc. It seems OnKill does not compile unless I make my quest script native which screws up 90% of the script Any ideas without adding it to the player Actor?
ag12 Posted March 20, 2018 Author Posted March 20, 2018 On 8.3.2018 at 4:45 AM, Halstrom said: I just want to know when the player kills something what it was, human/robot/creature etc. It seems OnKill does not compile unless I make my quest script native which screws up 90% of the script Any ideas without adding it to the player Actor? As with most things in the new CK environment, quest aliases are your friend. I'm assuming you have some sort of quest running in the background anyway (since you're trying to monitor something), just add a new ReferenceAlias to that quest and force fill it to the Player Actor. Then add a script that uses OnKill() to that alias. This way you don't actually mess with the player actor and are 100% compatible with all other mods that do similar things (RefAliases sort of 'stack', they don't mind each other - just make sure you don't tick "Reserve Reference" in the RefAlias window). Hope this helps. 1
Halstrom Posted March 21, 2018 Posted March 21, 2018 15 hours ago, ag12 said: As with most things in the new CK environment, quest aliases are your friend. I'm assuming you have some sort of quest running in the background anyway (since you're trying to monitor something), just add a new ReferenceAlias to that quest and force fill it to the Player Actor. Then add a script that uses OnKill() to that alias. This way you don't actually mess with the player actor and are 100% compatible with all other mods that do similar things (RefAliases sort of 'stack', they don't mind each other - just make sure you don't tick "Reserve Reference" in the RefAlias window). Hope this helps. Yes it got me on the right track, basically it seems Reference Aliases are the way to go for 90% of scripts, pity it doesn't tell newbies that somewhere, only taken me 3 years of dabbling to work that out 1
Halstrom Posted March 24, 2018 Posted March 24, 2018 Quick Script question, if I'm doing this in an AliasPlayer script do I need to do it on Init and GamePlayerLoad? Event OnInit() Init() EndEvent Event OnPlayerLoadGame() Init() EndEvent Function Init() rActor = Game.GetPlayer() RegisterForRemoteEvent(rActor, "OnDeath") RegisterForRemoteEvent(rActor, "OnPlayerSwimming") fPrevTime = Utility.GetCurrentGameTime() fPrevPosX = rActor.GetPositionX() fPrevPosY = rActor.GetPositionY() fPrevPosY = rActor.GetPositionZ() StartTimer(fFrequencyTimer, iTimerID) EndFunction
ag12 Posted March 25, 2018 Author Posted March 25, 2018 I think there's nothing wrong with having it set up that way. Just don't forget to actually register for the OnPlayerLoadGame event: RegisterForRemoteEvent(Player, "OnPlayerLoadGame"). As far as I know, scripts aren't registered for that event by default.
Halstrom Posted March 25, 2018 Posted March 25, 2018 30 minutes ago, ag12 said: I think there's nothing wrong with having it set up that way. Just don't forget to actually register for the OnPlayerLoadGame event: RegisterForRemoteEvent(Player, "OnPlayerLoadGame"). As far as I know, scripts aren't registered for that event by default. Yeah I noticed the function fires twice, but also I can't register OnPlayerLoadGame unless I use OnInit
Halstrom Posted March 31, 2018 Posted March 31, 2018 I'm trying to find the Armor Rating of the players Slot33 item, having trouble trying to work out what to pull it into, I cant seem to get it as an Armor or ObjectRefernce. Armor arSlot33 = rActor.GetWornItem(33) ObjectReference orSlot33 = rActor.GetWornItem(33) Also found akActor.GetArmorRating(arSlot33) doesn't compile
ag12 Posted March 31, 2018 Author Posted March 31, 2018 1. As far as I understand, the GetArmorRating() function only accepts an actor and returns the grand total of armor rating on that actor. 2. GetWornItem is a F4SE struct function. It does not return an armor, it returns a WornItem struct. The function is native to the 'actor' script, thus the WornItem struct is also defined there. The correct syntax to retrieve which item is equipped in slot 33 would be: armor function GetActualWornItem(Actor akActor) // <- just an example function actor:WornItem _itemstruct = akActor.GetWornItem(33) Armor _item = _itemstruct.Item return _item endFunction https://www.creationkit.com/fallout4/index.php?title=GetWornItem_-_Actor
Halstrom Posted March 31, 2018 Posted March 31, 2018 1 hour ago, ag12 said: 1. As far as I understand, the GetArmorRating() function only accepts an actor and returns the grand total of armor rating on that actor. 2. GetWornItem is a F4SE struct function. It does not return an armor, it returns a WornItem struct. The function is native to the 'actor' script, thus the WornItem struct is also defined there. The correct syntax to retrieve which item is equipped in slot 33 would be: armor function GetActualWornItem(Actor akActor) // <- just an example function actor:WornItem _itemstruct = akActor.GetWornItem(33) Armor _item = _itemstruct.Item return _item endFunction https://www.creationkit.com/fallout4/index.php?title=GetWornItem_-_Actor Thanks, thought I'd be doing something silly, I never used that structrure stuff before, I'll have to add it to my bucket list. I can't see a function to get the AR of an Armor anyway, so its no help to me anyway. I'm trying to workout roughly how hot an actor would be by the amount of armor they are wearing so will make do with this which seems to work ok (I only cared about slot33 really but we work with what we have :)): Float fArmor = (rActor.GetValue(ArmorPenetrationAV) + rActor.GetValue(DamageResistAV)) / 2
ag12 Posted March 31, 2018 Author Posted March 31, 2018 You could easily use GetWornItem on all the necessary slots to find out if the actor is wearing stuff like left leg/right leg/left arm/right arm/chest armor and helmet. If you want to get a decent approximation, I'd go with a system where you check for whether the actor has said pieces equipped, for each piece add a number so that if all pieces are equipped the number reads 100. Then check for the total damage resistance on that actor, get how much percent of the maximum achievable damage resistance (I'm guessing it'd be whatever damage resistance a full set of Assault Marine armor from Far Harbor gives you) and multiply the initial number from equipped items with the percent of maximum achievable damage resistance. That'll yield a number between 0-100. Just a suggestion, if you want to get some fairly accurate approximation of how much armor a character wears and how thick that armor is.
anon0000q Posted April 2, 2018 Posted April 2, 2018 I just installed a bunch of four play mods and every requirement mod but whenever I start the game it says something like " FP_framework not installed correctly, FP attribute will not work"? Whats going on? edit: NVM
Halstrom Posted April 2, 2018 Posted April 2, 2018 Having problem getting this input layer stuff to work, it all compiles fine and I'm seeing debug notifications saying things are disabled, but they aren't disabling. Do I need to create a separate inputlayer for each one or something? Scriptname SynthPlayer:Synth6Control extends ReferenceAlias {Deals with output systems based on system health and lubricant levels} Group Misc Quest Property qMQ101 Auto Const GlobalVariable Property gBootup Auto GlobalVariable Property gDebugSetting Auto GlobalVariable Property gSynthAbilityLevel Auto Const GlobalVariable Property gLubriCoolPerc Auto Const GlobalVariable Property gPowerPerc Auto Const GlobalVariable Property gCoreTempPerc Auto Const GlobalVariable Property gFPE_SexPregMonths Auto EndGroup Group SystemConditions ActorValue Property BrainConditionAV Auto ActorValue Property PerceptionConditionAV Auto ActorValue Property EnduranceConditionAV Auto ActorValue Property LeftAttackConditionAV Auto ActorValue Property LeftMobilityConditionAV Auto ActorValue Property RightAttackConditionAV Auto ActorValue Property RightMobilityConditionAV Auto GlobalVariable Property gSystemsServosLower Auto GlobalVariable Property gSystemsServosUpper Auto GlobalVariable Property gSystemsTorso Auto GlobalVariable Property gSystemsSensors Auto GlobalVariable Property gSystemsCPU Auto EndGroup ;----------------------------------------------------------------------------------------------------------------------------- Actor rActor Int iBootup Int iDebugSetting InputEnableLayer ielInputLayer Float fCurrAbilityLevel Float fConditionHead Float fConditionPerception Float fConditionTorso Float fConditionLeftArm Float fConditionRightArm Float fConditionLeftLeg Float fConditionRightLeg Float fSystemsServosLower Float fSystemsServosUpper Float fSystemsTorso Float fSystemsSensors Float fSystemsCPU Float fSystemsServosLowerMax = 50.0 Float fSystemsServosUpperMax = 50.0 Float fSystemsTorsoMax = 50.0 Float fSystemsSensorsMax = 50.0 Float fSystemsCPUMax = 50.0 Int iSystemsMovementDisable = 5 Int iSystemsRunningDisable = 10 Int iSystemsJumpingDisable = 20 Int iSystemsSprintingDisable = 30 Int iSystemsFastTravelDisable = 40 Int iSystemsActivateDisable = 5 Int iSystemsJournalDisable = 10 Int iSystemsFightingDisable = 20 Int iSystemsLookingDisable = 10 Int iSystemsCamSwitchDisable = 5 Int iSystemsSneakingDisable = 25 Int iSystemsVATSDisable = 20 Float fFrequencyTimer = 1.5 Int iTimerID = 32 Int iIsSwimming ;----------------------------------------------------------------------------------------------------------------------------- Event OnInit() Init() EndEvent Event OnPlayerLoadGame() Init() EndEvent Function Init() rActor = Game.GetPlayer() RegisterForRemoteEvent(rActor, "OnDeath") StartTimer(fFrequencyTimer, iTimerID) ielInputLayer = InputEnableLayer.Create() EndFunction ;Game.SetPlayerAIDriven() ;Game.SetPlayerRadioFrequency(50.45) ;Game.TurnPlayerRadioOn(false) ;Game.ShakeCamera(afStrength = 0.1) ;Actor randomActor = Game.FindRandomActor(0.0, 0.0, 0.0, 5.0) ;Actor closest = Game.FindClosestActor(0.0, 0.0, 0.0, 5.0) ;Game.FastTravel(HomeMarker) ;Game.FadeOutGame(false, true, 2.0, 1.0) ;----------------------------------------------------------------------------------------------------------------------------- Event OnTimer(int aiTimerID) iDebugSetting = (gDebugSetting.GetValue()) as Int iBootup = (gBootup.GetValue()) as Int If (aiTimerID >= iTimerID) && (iBootup > 10) && (qMQ101.IsCompleted() == True) Int iTempSysValue Float fLubriCoolPerc = gLubriCoolPerc.GetValue() Float fCoreTempPerc = gCoreTempPerc.GetValue() Float fPowerPerc = gPowerPerc.GetValue() Float fSexPregPerc = ((gFPE_SexPregMonths.GetValue()) / 9) * 100 fConditionHead = rActor.GetValue(BrainConditionAV) as Float fConditionPerception = rActor.GetValue(PerceptionConditionAV) as Float fConditionTorso = rActor.GetValue(EnduranceConditionAV) as Float fConditionLeftArm = rActor.GetValue(LeftAttackConditionAV) as Float fConditionRightArm = rActor.GetValue(RightAttackConditionAV) as Float fConditionLeftLeg = rActor.GetValue(LeftMobilityConditionAV) as Float fConditionRightLeg = rActor.GetValue(RightMobilityConditionAV) as Float fSystemsServosLower = (fConditionLeftLeg + fConditionRightLeg) / 2 fSystemsServosUpper = (fConditionLeftArm + fConditionRightArm) / 2 fSystemsTorso = fConditionTorso fSystemsSensors = fConditionPerception fSystemsCPU = fConditionHead if (fSystemsServosLower < 1) fSystemsServosLower = 1 endif if (fSystemsServosUpper < 1) fSystemsServosUpper = 1 endif if (fSystemsTorso < 1) fSystemsTorso = 1 endif if (fSystemsSensors < 1) fSystemsSensors = 1 endif if (fSystemsCPU < 1) fSystemsCPU = 1 endif if (fSystemsServosLower > fSystemsServosLowerMax) fSystemsServosLower = fSystemsServosLowerMax endif if (fSystemsServosLower > fLubriCoolPerc) fSystemsServosLower = fLubriCoolPerc endif if (fSystemsServosUpper > fSystemsServosUpperMax) fSystemsServosUpper = fSystemsServosUpperMax endif if (fSystemsServosUpper > fLubriCoolPerc) fSystemsServosUpper = fLubriCoolPerc endif if (fSystemsTorso > fSystemsTorsoMax) fSystemsTorso = fSystemsTorsoMax endif if (fSystemsSensors > fSystemsSensorsMax) fSystemsSensors = fSystemsSensorsMax endif if (fSystemsCPU > fSystemsCPUMax) fSystemsCPU = fSystemsCPUMax endif ; *** Disabling Systems iTempSysValue = fSystemsServosLower as Int if (iTempSysValue < iSystemsMovementDisable) && (ielInputLayer.IsMovementEnabled()) ielInputLayer.EnableMovement(false) fnMessage("Lower Servos at " + iTempSysValue + "%, Basic Movement Disabled") endif if (iTempSysValue < iSystemsRunningDisable) && (ielInputLayer.IsRunningEnabled()) ielInputLayer.EnableRunning(false) fnMessage("Lower Servos at " + iTempSysValue + "%, High Speed Movement Disabled") endif if (iTempSysValue < iSystemsJumpingDisable) && (ielInputLayer.IsJumpingEnabled()) ielInputLayer.EnableJumping(false) fnMessage("Lower Servos at " + iTempSysValue + "%, Jumping Movement Disabled") endif if (iTempSysValue < iSystemsSprintingDisable) && (ielInputLayer.IsSprintingEnabled()) ielInputLayer.EnableSprinting(false) fnMessage("Lower Servos at " + iTempSysValue + "%, Overboost Movement Disabled") endif if (iTempSysValue < iSystemsFastTravelDisable) && (ielInputLayer.IsFastTravelEnabled()) ielInputLayer.EnableFastTravel(false) fnMessage("Lower Servos at " + iTempSysValue + "%, Long Distance Movement Disabled") endif iTempSysValue = fSystemsServosUpper as Int if (iTempSysValue < iSystemsJournalDisable) && (ielInputLayer.IsJournalEnabled()) ielInputLayer.EnableJournal(false) ielInputLayer.EnableJournalTabs(false) fnMessage("Upper Servos at " + iTempSysValue + "%, PIPBoy Operation Disabled") endif if (iTempSysValue < iSystemsActivateDisable) && (ielInputLayer.IsActivateEnabled()) ielInputLayer.EnableActivate(false) fnMessage("Upper Servos at " + iTempSysValue + "%, Arm Operation Reduced") endif if (iTempSysValue < iSystemsFightingDisable) && (ielInputLayer.IsFightingEnabled()) ielInputLayer.EnableFighting(false) fnMessage("Upper Servos at " + iTempSysValue + "%, Combat Systems Disabled") endif iTempSysValue = fSystemsSensors as Int if (iTempSysValue < iSystemsLookingDisable) && (ielInputLayer.IsLookingEnabled()) ielInputLayer.EnableLooking(false) fnMessage("Sensors at " + iTempSysValue + "%, Visual Systems Restricted") endif if (iTempSysValue < iSystemsCamSwitchDisable) && (ielInputLayer.IsCamSwitchEnabled()) ielInputLayer.EnableCamSwitch(false) fnMessage("Sensors at " + iTempSysValue + "%, Visual Systems Restricted") endif iTempSysValue = fSystemsCPU as Int if (iTempSysValue < iSystemsVATSDisable) && (ielInputLayer.IsVATSEnabled()) ielInputLayer.EnableVATS(false) fnMessage("CPU at " + iTempSysValue + "%, Targeting Systems Offline") endif if (iTempSysValue < iSystemsSneakingDisable) && (ielInputLayer.IsSneakingEnabled()) ielInputLayer.EnableSneaking(false) fnMessage("CPU at " + iTempSysValue + "%, Stealth Functions Offline") endif ; *** Enabling Systems iTempSysValue = fSystemsServosLower as Int if (iTempSysValue >= (iSystemsMovementDisable * 2)) && (!ielInputLayer.IsMovementEnabled()) ielInputLayer.EnableMovement(true) fnMessage("Lower Servos at " + iTempSysValue + "%, Basic Movement Restored") endif if (iTempSysValue >= (iSystemsRunningDisable * 2)) && (!ielInputLayer.IsRunningEnabled()) ielInputLayer.EnableRunning(true) fnMessage("Lower Servos at " + iTempSysValue + "%, High Speed Movement Restored") endif if (iTempSysValue >= (iSystemsJumpingDisable * 2)) && (!ielInputLayer.IsJumpingEnabled()) ielInputLayer.EnableJumping(true) fnMessage("Lower Servos at " + iTempSysValue + "%, Jumping Movement Restored") endif if (iTempSysValue >= (iSystemsSprintingDisable * 2)) && (!ielInputLayer.IsSprintingEnabled()) ielInputLayer.EnableSprinting(true) fnMessage("Lower Servos at " + iTempSysValue + "%, Overboost Movement Restored") endif if (iTempSysValue >= (iSystemsFastTravelDisable * 2)) && (!ielInputLayer.IsFastTravelEnabled()) ielInputLayer.EnableFastTravel(true) fnMessage("Lower Servos at " + iTempSysValue + "%, Long Distance Movement Restored") endif iTempSysValue = fSystemsServosUpper as Int if (iTempSysValue >= (iSystemsActivateDisable * 2)) && (!ielInputLayer.IsActivateEnabled()) ielInputLayer.EnableActivate(true) fnMessage("Upper Servos at " + iTempSysValue + "%, Arm Operation Restored") endif if (iTempSysValue >= (iSystemsJournalDisable * 2)) && (!ielInputLayer.IsJournalEnabled()) ielInputLayer.EnableJournal(true) fnMessage("Upper Servos at " + iTempSysValue + "%, PIPBoy Operation Restored") endif if (iTempSysValue >= (iSystemsFightingDisable * 2)) && (!ielInputLayer.IsFightingEnabled()) ielInputLayer.EnableFighting(true) fnMessage("Upper Servos at " + iTempSysValue + "%, Combat Systems Restored") endif iTempSysValue = fSystemsSensors as Int if (iTempSysValue >= (iSystemsLookingDisable * 2)) && (!ielInputLayer.IsLookingEnabled()) ielInputLayer.EnableLooking(true) fnMessage("Sensors at " + iTempSysValue + "%, Visual Systems Restored") endif if (iTempSysValue>= (iSystemsCamSwitchDisable * 2)) && (!ielInputLayer.IsCamSwitchEnabled()) Game.ForceFirstPerson() ielInputLayer.EnableCamSwitch(true) fnMessage("Sensors at " + iTempSysValue + "%, Visual Systems Restored") endif iTempSysValue = fSystemsCPU as Int if (iTempSysValue >= (iSystemsVATSDisable * 2)) && (!ielInputLayer.IsVATSEnabled()) ielInputLayer.EnableVATS(true) fnMessage("CPU at " + iTempSysValue + "%, Targeting Systems Restored") endif if (iTempSysValue >= (iSystemsSneakingDisable * 2)) && (!ielInputLayer.IsSneakingEnabled()) ielInputLayer.EnableSneaking(true) fnMessage("CPU at " + iTempSysValue + "%, Stealth Functions Restored") endif gSystemsServosLower.SetValue(fSystemsServosLower) gSystemsServosUpper.SetValue(fSystemsServosUpper) gSystemsTorso.SetValue(fSystemsTorso) gSystemsSensors.SetValue(fSystemsSensors) gSystemsCPU.SetValue(fSystemsCPU) iIsSwimming = 0 Endif ; (aiTimerID >= iTimerID) StartTimer(fFrequencyTimer, iTimerID) EndEvent ;----------------------------------------------------------------------------------------------------------------------------- Function fnMessage(String sMessage) Debug.Notification(sMessage) Debug.Trace(sMessage) EndFunction ;----------------------------------------------------------------------------------------------------------------------------- Event Actor.OnDeath(Actor akSender, Actor akKiller) CancelTimer(iTimerID) UnregisterForAllEvents() EndEvent EDIT: Yep sorted it out, I needed a separate InputLayer for each Enable/Disable type.
Halstrom Posted May 6, 2018 Posted May 6, 2018 On 3/05/2018 at 5:51 PM, morisgame said: Hey, for some reason I cant create any dialogue inside the scene view. When I rightclick nothing happens (there should be the popup window with "add phase","add actor", etc). I already tried reinstalling Fo4 and the Ck, still the same problem. Has anyone else experienced that? Any suggestions? I also cant open any existing dialogue with double click. Seems to be a Ck issue, since I watched several tuts. to be sure I didnt do anything wrong. I used the Ck before (a few months back). Windows 10,64Bit. I start the ck as admin, no mods whatsoever installed Thanks Whenever you create a new quest you need to close it and reopen it before you can add a lot of stuff like scripts and dialogue.
Halstrom Posted May 6, 2018 Posted May 6, 2018 Anyone know why quest scripts in a quest run regardless that "Start Game Enabled" is unchecked even on clean saves? This driving me nuts, my Init and Player Game Loaded are running on all my scripts even though I haven't called the quest script to start even on clean saves, I'm going to have to manually hack a way around this insanity to get my mod not to run till MQ101 is complete.
Halstrom Posted May 9, 2018 Posted May 9, 2018 Ok have these errors in other peoples logs for my mod but not mine, any ideas? On a wild hunch could it be AAF related, I don't have it installed? Quote [05/08/2018 - 02:40:32PM] Error: Unable to link type of variable "four_play_event" on object "SynthPlayer:Synth9FourPlay" [05/08/2018 - 02:40:32PM] Error: Unable to link types associated with function "::remote_four_play:Main_animation_over" in state "" on object "SynthPlayer:Synth9FourPlay". [05/08/2018 - 02:40:32PM] Error: Unable to link types associated with function "fnInit" in state "" on object "SynthPlayer:Synth9FourPlay". [05/08/2018 - 02:40:32PM] Error: Unable to link types associated with function "::remote_four_play:Main_animation_start" in state "" on object "SynthPlayer:Synth9FourPlay". [05/08/2018 - 02:40:43PM] error: Unable to bind script SynthPlayer:Synth9FourPlay to alias SynthAlias_PlayerRef on quest SynthPlayer (A815A938) because their base types do not match
Halstrom Posted May 9, 2018 Posted May 9, 2018 Any ideas what this means? Quote [05/09/2018 - 06:46:27AM] warning: Loaded timer offset for [SynthPlayer:Synth4LubriCool <alias SynthAlias_PlayerRef on quest SynthPlayer (3015A938)>] is too negative for the current time - forcing to 1 second. (Offset: -16, Current: 0) [05/09/2018 - 06:46:27AM] warning: Loaded timer offset for [SynthPlayer:Synth4Repair <alias SynthAlias_PlayerRef on quest SynthPlayer (3015A938)>] is too negative for the current time - forcing to 1 second. (Offset: -16, Current: 0)
Halstrom Posted June 5, 2018 Posted June 5, 2018 Ok trying to get a book set up to show Player stats I copied from JoeFlashy's RSE mod but its not working, all I get is "UnitStatus:" I must be missing a way to reference these globals to the book somehow? <font color="#000000" face="$MAIN_Font"><p align='center'><b>SynthPlayer Stats</b></font><p align='left'><font color="#000000" face="$ConsoleFont" size="16"> UnitStatus Percent: <Global=SynthPlayer_4TotalUnitStatus> Power Percent: <Global=SynthPlayer_4PowerPerc> CoreTemp Percent: <Global=SynthPlayer_4CoreTempPerc> LubriCool Percent: <Global=SynthPlayer_4TotalLubriCoolPerc> Firewall Percent: <Global=SynthPlayer_4FirewallPerc> SexProcessor Percent: <Global=SynthPlayer_4SexProcessorPerc> Arousal Percent: <Global=SynthPlayer_4SexArousalPerc> Total Chassis Percent: <Global=SynthPlayer_4TotalChassisPerc> Torso Chassis Percent: <Global=SynthPlayer_6SysTorsoChassisPerc> Upper Servos Percent: <Global=SynthPlayer_6SysUpperServosPerc> Mobility Servos Percent: <Global=SynthPlayer_6SysMobilityServosPerc> Cranial Status Percent: <Global=SynthPlayer_6SysCranialStatusPerc> Visual sensors Percent: <Global=SynthPlayer_6SysVisualSensorsPerc> [pagebreak] <font color="#000000" face="$MAIN_Font"><p align='center'><b>RSE STATISTICS Pg.2</b></font><p align='left'> <font size="14" color="#000000">Placeholder Text The word Global is supposed to be in front of them all but thres no way to make it appear I know of: "UnitStatus Percent: Global=SynthPlayer_4TotalUnitStatus>"
Harlekin Posted June 10, 2018 Posted June 10, 2018 i have a short question too. is it possible to assign an Actor-Script to an actor without touching the NPC/Actor-Form? if yes - how?^^
Carreau Posted June 10, 2018 Posted June 10, 2018 5 hours ago, Harlekin said: i have a short question too. is it possible to assign an Actor-Script to an actor without touching the NPC/Actor-Form? if yes - how?^^ I ran into an issue with template NPCs that may help you here. With template NPCs, you can't add scripts to them. My work around was to make my script an active magic effect and apply it via perks. Perk->Ability->MagicEffect. Since I was building the NPCs, it was easy to add the perk to them. Since you're wanting to avoid editing the NPC, you can always make a quest to add a perk to your selected actor. But I'm not aware of any way to add a script to an actor other than directly editing.
Harlekin Posted June 10, 2018 Posted June 10, 2018 6 hours ago, Carreau said: I ran into an issue with template NPCs that may help you here. With template NPCs, you can't add scripts to them. My work around was to make my script an active magic effect and apply it via perks. Perk->Ability->MagicEffect. Since I was building the NPCs, it was easy to add the perk to them. Since you're wanting to avoid editing the NPC, you can always make a quest to add a perk to your selected actor. But I'm not aware of any way to add a script to an actor other than directly editing. yeah i know that magic-effects works but this script uses actor forms and i think those forms are only usable in Actor scripts otherwise the compiler shout out errors. Thats why my script is set as actor script - but direkt editing the player-form (or some npc's) causes massiv incopatibillities with other mods -_- for my personal taste its totally okay, because i dont use mods who are in conflict with my mod xD but thats only my loadorder xD
Carreau Posted June 11, 2018 Posted June 11, 2018 You can call out actor functions in any other script. Since you’re mre than likely applying stuff to the actor that would receive the perk, any script called against it would inherit functions native to actor. Any function you want to use that isn’t inherited, you can either preceed it with Actor.FunctionName() or import actor script in your header.
Harlekin Posted June 11, 2018 Posted June 11, 2018 the problem is not a function the problem is more a event - does that work too?^^
Carreau Posted June 12, 2018 Posted June 12, 2018 i’ve had issues with getting the compiler to accept certain events. It’s primarily due to the first passed variable not being cast the same as the script the function comes from.
ag12 Posted June 13, 2018 Author Posted June 13, 2018 On 6/11/2018 at 9:27 AM, Harlekin said: the problem is not a function the problem is more a event - does that work too?^^ Forget all that stuff Carreau just told you about using perks/magic effects and importing the actor script (??)... your problem is so common that Bethesda themselves had it when they worked on Skyrim, so they put an entire system in place to deal with it. It's called Quest Aliases, you can find all the necessary information on the wiki. Just make a new ReferenceAlias, force it to fill the player in the CK, then attach a script to the RefAlias. Scripts of type ReferenceAlias receive all events that the filled object reference receives, including, but not limited to, actor events. Most of Fallout 4's quests are actually built around using Quest Aliases, it's the only acceptable way of doing this sort of thing in the current iteration of the engine. Any other method is either way more expensive, harder to do maintenance on or has a high chance of producing script ghosts in your savegame (such as the magic effect variant). If you don't know what you're doing, use the systems that Bethesda uses - they are usually the cheapest. Check our the wiki, check out how the vanilla quests handle things and if it still doesn't click, let me know - if I get the time, I'll help.
Carreau Posted June 13, 2018 Posted June 13, 2018 I didnmt think you could add actor scripts through aliases. According to the wiki, you can only extend ReferenceAlias, so he’d still be back to square one with Actor Script events.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now