Jump to content

[FO4 CK] General Help Thread


Recommended Posts

59 minutes ago, Carreau said:

 

But you extended Actor, which means ObjectReference events aren’t native to your script. OnEquipped and OnUnEquipped are both ORef events. 

Shit, so I did. You'd think that with non-native events, it wouldn't compile, but I guess not. Switching so that it extends ObjectReference got the events to fire now.

However, a new problem has come up: The script fires properly, but it is unable to attach the object mod:

 

"error: Cannot call AttachMod() on a None object, aborting function call"

"warning: Assigning None to a non-object variable named "::temp7""

 

Both of which point to line 27 of the script, "(Myself as ObjectReference).AttachMod((Enabler as ObjectMod), 1)":

Spoiler

ScriptName Evan555alpha:BraPantyHideUnhideScript Extends ObjectReference
{This script will change the armour looks of bras and panties depending on whether or not slot 33 is equipped.}

Group Required
{Required Properties.}
	Form Property Myself Auto
	{Self-referential.}
	Actor Property Player Auto
	{The actor we wish to check.}
	ObjectMod Property Enabler Auto
	{The object mod that enables/disables the mesh.}
EndGroup

Event OnEquipped(Actor akActor)
	If akActor == Player
		Actor:WornItem Slot33 = Player.GetWornItem(3)
		Armor Item33 = (Slot33.Item as Armor)
		If !Item33
			(Myself as ObjectReference).RemoveMod(Enabler)
			Debug.Notification("OMOD Removed.")
		Else
			(Myself as ObjectReference).AttachMod((Enabler as ObjectMod), 1)
			Debug.Notification("OMOD Added.")
		EndIf
	Else
		Debug.Trace("Evan: Not Armour")
	EndIf
EndEvent

 

I'm not sure how "Myself" is being made into a "none object" when I've set it as a property in the plugin.

Link to comment

Maybe instead of using a form property, use Self?  I’m guessing you filled the form property with the base form of the armor, but attachmod is called on a reference. In that case, grabbing self should apply the function to your spawned reference of the armor.

 

i’m admittedly bad at this part of papyrus scripting, so I could be off base. 

Link to comment
Quote

"error: Cannot call AttachMod() on a None object, aborting function call"

"warning: Assigning None to a non-object variable named "::temp7""

This error seems to be associated with deleting variables or properties from scripts, you have to save or clean save a game to get rid of it.

Also check the object exists with "If (ObjectMod)" or try
ObjectMod omEnabler = Enabler as ObjectMod
ObjectReference orMyself = Myself as ObjectReference
orMyself.AttachMod(omEnabler, 1)

Link to comment
3 hours ago, Carreau said:

Maybe instead of using a form property, use Self?  I’m guessing you filled the form property with the base form of the armor, but attachmod is called on a reference. In that case, grabbing self should apply the function to your spawned reference of the armor.

 

i’m admittedly bad at this part of papyrus scripting, so I could be off base. 

I'll give that a try, sure.

1 hour ago, Halstrom said:

This error seems to be associated with deleting variables or properties from scripts, you have to save or clean save a game to get rid of it.

Also check the object exists with "If (ObjectMod)" or try
ObjectMod omEnabler = Enabler as ObjectMod
ObjectReference orMyself = Myself as ObjectReference
orMyself.AttachMod(omEnabler, 1)

Gave this a try, loaded up a save from before I created this plugin, so it's likely clean, and the same errors happened. I'll do what Carreau suggested as well, and see what happens.

Link to comment
18 minutes ago, Evan555alpha said:

I'll give that a try, sure.

Gave this a try, loaded up a save from before I created this plugin, so it's likely clean, and the same errors happened. I'll do what Carreau suggested as well, and see what happens.

Oh its not the problem in your case but I also found I get a similar error when I try using:

Int iGlobal = gGlobal.GetValue() as Int
I had to use:

Int iGlobal = gGlobalGetValueInt()

Link to comment

Beginner with the CK so bear with me please.

 

I want to edit Vault 88, the cell itself. How'd I go about this? I can't find anything online (Probably not searching correctly) that would help me.

 

Specifically, what I want to do is add a button or something, that the player can press which then in turn would pre-place some objects in the game.

Link to comment
On 7/7/2018 at 9:35 PM, ElementalWatcher said:

Beginner with the CK so bear with me please.

 

I want to edit Vault 88, the cell itself. How'd I go about this? I can't find anything online (Probably not searching correctly) that would help me.

 

Specifically, what I want to do is add a button or something, that the player can press which then in turn would pre-place some objects in the game.

You would load up the DLC itself into the CK and then proceed to edit the cell "DLC06VaultWorkshop". I don't recall if you'd need to for editing a DLC itself, but I suggest going into the CK's "CreationKit.ini" file, and adding the following line under the [General] tab:

 

bAllowMultipleMasterLoads=1

 

Now, when you do go to load up that vanilla cell, it's highly likely that the CK will crash. There's not much you can do to prevent these crashes, they just happen. Personally however, I found something that said to also append/edit the following lines to the same ini file:

 

[Audio]
bEnableAudio=0

 

Which has allowed me to see some vanilla cells without crashing.

 

As for your idea of a button that places some objects, I think that the best way to go about it would be to place all those items in the cell, but making sure that you set them all to be "initially disabled". You can probably add them all to their own layer if you want, but that isn't needed beyond making it easier for you to place your stuff whilst hiding a lot of the other vanilla stuff. After you place all your things, you can add their references (you may need to give them RefIDs for this) to one giant script that is attached to your button.

This button script would essentially have all those objects listed, and when the button is pressed, it would enable all the objects so that they can be seen.

Link to comment
53 minutes ago, Evan555alpha said:

Fuck off with the 76 drama. This is not the thread for it. I don't know if you can't tell or not, but the recent activity here is clearly because there's still active mod development.

 

You would load up the DLC itself into the CK and then proceed to edit the cell "DLC06VaultWorkshop". I don't recall if you'd need to for editing a DLC itself, but I suggest going into the CK's "CreationKit.ini" file, and adding the following line under the [General] tab:

 

bAllowMultipleMasterLoads=1

 

Now, when you do go to load up that vanilla cell, it's highly likely that the CK will crash. There's not much you can do to prevent these crashes, they just happen. Personally however, I found something that said to also append/edit the following lines to the same ini file:

 

[Audio]
bEnableAudio=0

 

Which has allowed me to see some vanilla cells without crashing.

 

As for your idea of a button that places some objects, I think that the best way to go about it would be to place all those items in the cell, but making sure that you set them all to be "initially disabled". You can probably add them all to their own layer if you want, but that isn't needed beyond making it easier for you to place your stuff whilst hiding a lot of the other vanilla stuff. After you place all your things, you can add their references (you may need to give them RefIDs for this) to one giant script that is attached to your button.

This button script would essentially have all those objects listed, and when the button is pressed, it would enable all the objects so that they can be seen.

 

I see, and what you're saying makes sense. But I have no real experience of the CK at all. The tiny experience I have is mainly looking inside of it, I managed to find the Cell, I managed to open it fine and all. But I don't know how to do anything inside of the CK. Since what I want to achieve first is to edit the cell and place these objects, I have no idea of how this is actually done and I haven't found anything that helps me with this either currently.

Link to comment
7 hours ago, ElementalWatcher said:

 

I see, and what you're saying makes sense. But I have no real experience of the CK at all. The tiny experience I have is mainly looking inside of it, I managed to find the Cell, I managed to open it fine and all. But I don't know how to do anything inside of the CK. Since what I want to achieve first is to edit the cell and place these objects, I have no idea of how this is actually done and I haven't found anything that helps me with this either currently.

There's dozens of videos on Youtube that explain and show how to enter and edit cells within the CK. I suggest giving them a watch, as they could explain infinitely better than text, how to use the cell editor in the CK.

 

 

@Carreau and @Halstrom I've managed to get my script to fire each time something is equipped now, but now I'm at a different hurdle. Using the following script, it is unable to tell the difference whether or not slot 33 is actually occupied. I tried adding in a "GetBaseObject()" line, to try and prevent the naked body from being allowed as an armour that occupies the slot for this context, but the script would just fail to compile, stating that "GetBaseObject is not a function or does not exist.".

Spoiler

ScriptName Evan555alpha:BraPantyHideUnhideScript Extends ObjectReference
{This script will change the armour looks of bras and panties depending on whether or not slot 33 is equipped.}

Group Required
{Required Properties.}
	Form Property Myself Auto
	{Self-referential.}
	Actor Property Player Auto
	{The actor we wish to check.}
	ObjectMod Property Enabler Auto
	{The object mod that enables/disables the mesh.}
	Bool Property HasMod = False Auto
	{Tells us whether or not the mod is equipped.}
	ObjectMod Property omNone Auto
	{The alternate object mod.}
EndGroup

Event OnEquipped(Actor akActor)
	Self.RegisterForRemoteEvent(Game.GetPlayer(), "OnItemEquipped")
	Debug.Notification("Event Registered.")
EndEvent

Event Actor.OnItemEquipped(Actor akSender, Form akBaseObject, ObjectReference akReference)
	Actor:WornItem Slot33 = Player.GetWornItem(3)
	Armor Item33 = (Slot33.Item as Armor)
	If (akBaseObject != Myself) && (HasMod == False)
		If (akBaseObject == Item33)
			ObjectMod omEnabler = Enabler as ObjectMod
			Self.RemoveMod(omNone)
			Self.AttachMod(omEnabler, 1)
			Debug.Notification("OMOD Added.")
		Else
			Self.RegisterForRemoteEvent(Game.GetPlayer(), "OnItemEquipped")
			ObjectMod omEnabler = Enabler as ObjectMod
			;Self.RemoveMod(omEnabler)
			;Self.AttachMod(omNone, 1)
			Self.RemoveMod(omNone)
			Self.AttachMod(omEnabler, 1)
			HasMod = True
			Debug.Notification("1" + Slot33.Item)
			Debug.Notification("2" + akBaseObject)
		EndIf
	EndIf
EndEvent

 

I should probably also note that the last two debug notifications, Slot33.Item and akBaseObject, show in the notification as "Armor" and "Form", which is what led me to trying to use GetBaseObject.

Link to comment

Actor:WornItem Slot33 = Player.GetWornItem(3)
It wouldn't surprise me if Player and Game.GetPlayer were 2 different references.
I did try attaching and removing mods by F4SE commands to change collar colors in my Sinstitute mod and failed, for some reason I never had any success.

Link to comment
15 hours ago, Carreau said:

Pass it skin naked as a property and test for it. Slot 33 is ALWAYS occupied

Well that was almost the entire point of trying to use the GetBaseObject() function, which wouldn't compile. Because, as I said before, the debug notification for "Slot33.Item" just returns "Armor".

 

Also, for maximum compatibility, I'd also have to make the if statement checking whether or not it is the naked skin an OR operand, alongside some "IsPluginInstalled()" and "GetFormFromFile()" functions; Looksmenu's skins will direct the naked body to be a different ARMO record, and I've already made another mod that does exactly that.

 

16 hours ago, Halstrom said:

Actor:WornItem Slot33 = Player.GetWornItem(3)
It wouldn't surprise me if Player and Game.GetPlayer were 2 different references.
I did try attaching and removing mods by F4SE commands to change collar colors in my Sinstitute mod and failed, for some reason I never had any success.

I'll try Game.GetPlayer() instead of the property, and see if there's a difference.

Link to comment
  • 2 weeks later...

Anyone messed with the player hellos?  I'm trying to add some dialogue where the player addresses my companion.  I can get it to work when the companion isn't the active follower, but when it is the active follower, the player defaults to the general Hey and *whistles*  I have a feeling this has to do with the companion being ordered around by command mode, but I can't find where any of the command mode dialogue is.

 

edit: answered my question. I had forgotten that the player says the defaults to vanilla companions as well. The dialogue i added for my companion was working like vanilla. My memory is just bad at times.

Link to comment
  • 3 weeks later...

I asked this on Nexus the other day and haven't had any luck in responses.

 

So, I'm trying to fix a problem I've encountered with using EnableMovement(false).  If the player is frozen by either EnableMoevemy() or DisablePlayerControls(), the HUD vanishes.  I'm freezing the player, making them invisible, and centering the camera on an NPC target.  However, I want the HUD visible as the player takes damage over time while this is going on, and being able to see their own health bar would be preferable.

 

Is there a way to freeze the player and leave the HUD visible?  Right now, as a workaround I've taken out the player freeze since the player is invisible and the camera is pointed at something that is not the player.  When exiting this state, the player is transitioned to the NPC, so I'm not worried about when the camera re-attaches to the player.

Link to comment
3 hours ago, Clegane said:

I broke my CK and reinstalled it. Now I can't have my multiple masters. How can I add it back and where in CKini or CKpref.ini? Thanks in advance

bAllowMultipleMasterLoads=1

 

Add that to the [General] section of CreationKit.ini

Link to comment
  • 2 weeks later...

So, I want to add an enchantment (read:legendary effect) to a piece of armour that will make all insectoid NPCs have a % chance of not attacking the player/companions. My main question is: Is such a thing possible? I'll admit, I don't have all that much experience with magic effects, aside from getting them to run scripts.

 

I know to use an object template alongside an object modification to have the modification be default to the object, and to then attach the enchantment to the object mod, but I'm not sure how to go about making the enchantment itself.

Link to comment

@Evan555alpha Without direct ref.startCombat scripted commands, NPCs attack (or not) based on faction alignments between the two actors.  The NPC actor's Aggression comes in to play as well here.

 

https://www.creationkit.com/index.php?title=Faction

Quote

Enemy: Enemy actors are attacked on sight by Aggressive, Very Aggressive, and Frenzied actors, and are not assisted by anyone.
Neutral: This is how all factions relate to each other by default, even if you don't specify it. Neutrals will be attacked by Very Aggressive and Frenzied actors, and are not assisted by anyone.
Friend: Friends will only be attacked by Frenzied actors, and will be assisted by Helps Friends and Allies actors.
Ally: Allies will only be attacked by Frenzied actors, and will be assisted by Helps Friends and Allies and Helps Allies actors.

I don't know of a way to create a magic effect that would directly manipulate faction relations, without tying a script to the MGEF itself.  This might be an approach one could take to produce the intended result.

 

I would think it might be easier to set the "insect" faction to neutral (so they don't always attack) and use leveled character lists where some members and/or other methods to procedurally generate insect members which are aggressive (will only attack enemy factions) and 'very aggressive' (will attack neutral factions and enemies)

Link to comment
6 hours ago, AWP3RATOR said:

I don't know of a way to create a magic effect that would directly manipulate faction relations, without tying a script to the MGEF itself.  This might be an approach one could take to produce the intended result.

I would like to avoid unnecessarily editing vanilla records, so I think that a script would be the best way to go about it. Have a perk of mine add the player to the insect factions (Said perk ties in to the armour set anyways), then have the MGEF script run on all suitable subjects within a certain radius,, with a % chance of attacking.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use