Jump to content

"You cannot use this at this moment" - what triggers that?


Hoamaii

Recommended Posts

Hi guys,

 

Does any of you know what triggers that message in game? Not sure of its phrasing, I play in French and the exact message is "Vous ne pouvez pas l'utiliser pour le moment", which translates somewhat as "you cannot use it at this moment" or "you cannot use it for now".

 

It's been driving me nuts and I think I need a set of fresh neurons to sort it out.

 

Here's how and when it happens:

 

- I created a MagicEffect and a spell (fires once, on self) which I use for the player to spawn a choice of non-persistent furniture references (with PlaceAtMe) and activate it once spawned ("SpawnedFurn.Activate(PlayerRef)"). The spell dispels after the first choice is activated, and when the player exits the furniture, the reference is disabled and deleted. If you want to spawn another type of furniture, you need to cast the spell again. At first it worked 100% fine. Then the more I test it, the less it works.

 

- I know I'm playing with fire here because "PlaceAtMe" has its limitation which will always return the last reference created, while "Activate" also has its draw-back: "when called on a stack of items dropped by the player, Activate will return only one item" says the Wiki (which makes sense because you don't want to activate several activators in the same click).

 

The thing is I can spawn as many objectReferences as I want as long as I don't activate them in the same MagicEffect Script.

 

As soon as I try to spawn one ObjectReference then Activate it in the same script - it will work alright like half a dozen times - then the message "You cannot use this at this moment" will appear and block my MagicEffect. So I've tried to use the MagicEffect to spawn the Object and then script the Object to Activate the player. Same result.

 

I've searched all Message forms in the CK and couldn't, for the life of me, find that specific message anywhere (I was trying to find what it's used in and in which circumstances). I've read in many theads that it started to appear with the Far Harbor DLC - and will at times prevent you to use Workshop benches or Power Armor, but I've never had that before.

 

I'm confused about what it's telling me that I can't use here, is it the spell itself or the objectReference? Debug tells me that everything works fine and returns properly, yet half the time it obviously stalls. If I forcibly dispel the spell, it will work again a couple of times (or not) then starts giving me the same message again.

 

My trouble is I'm not sure which function (or combination of functions) is the culprit here:

- is it PlaceAtMe", which after a series of casting the same spell will start to always return the same form? (even though I disable and delete the last created form onEffectFinish)

- Is it "Activate" - and the message telling me that it can't activate the latest created ObjectReference because it's mistakingly targeting another one it created in a previous cast? (is that even possible?...)

- Or could it be the spell itself (casted with "AddSpell") which stops working after a while? I know there also another issue where at times spells can't stack. But then it's just these 2 functions which stop working, the rest of the scripted effect works 100% fine. Plus I'm not stacking spells, I'm only using one. Or can spells have some sort of persistency too, even after they've been dispelled?...

 

I hope this doesn't sound too confusing - and sorry for the bad English. But if anyone can help me sort this out a bit, I'd be really greateful!.. Thanks a lot in advance!

 

 

Link to comment
Share on other sites

That message as I remember appears when the furniture you activate is already in use. If you post the whole script, I will be able to help you more.

 

Hey, hi again! If I'm not mistaken, the message which appears when you're trying to use a furniture already in use is more like "someone else is already using this" (or something like that).

 

I thought of that, or that the furniture could already be reserved, but the custom furns I'm using are flagged as "Ignored By Sandbox" (not that it seems to be 100% reliable in Fallout4). But it happens in the complete wilderness too, with no other NPC around.

 

I would post my script if it was not nearly 1000 lines long (it's not a long script per se, just many options to choose from). It runs in a flash actually, much faster than some other shorter ones.

 

But I just thought of something last night after turning off the computer: being over careful, I call self.Delete() on the furniture itself in the OnExitFurniture() Event, but then I also call "SpawnedFurn.Disable()" and "Delete()" in the OnEffectFinish of the spell too (after checking first "If SpawnedFurn != none"). Maybe, just maybe, the ObjectReference self.delete() before the spell can reset its variable to none and when I cast the spell again, placeAtMe returns the stored variable from a previous cast, thus trying to activate a furniture which is already disabled but not deleted yet (as we know calling "delete()" does not always return immediately). I'll debug this some more to check about that, while not calling self.delete() on the placed reference this time, see if that changes anything.

 

But I do suspect, my issue comes from a conjunction of functions, not just from one. It's always a pain when several scripts work together, I have a few hours ahead of me and try a few more stuff. Thanks again!

 

 

It will also happen if the furniture item is using a animation that the player can not do.

 

Yeah, though of that too, that would have given me the culprit - but not the case here, the animations work perfectly when activation returns properly. Like I said, I think it's more a mix of functions that get in the way of one another... Sigh. Thanks anyway :).

Link to comment
Share on other sites

Not to overcomplicate this, but anyone got any idea what the "FurnitureScaleActorToOne" keyword does?

 

It's attached to over 200 base game furniture items (including workbenches) that would generate that message, does not appear anywhere in the base scripts, and seems to be defined somewhere in the default object manager. I'd bet that is probably your trigger.

Link to comment
Share on other sites

Not to overcomplicate this, but anyone got any idea what the "FurnitureScaleActorToOne" keyword does?

Â

It's attached to over 200 base game furniture items (including workbenches) that would generate that message, does not appear anywhere in the base scripts, and seems to be defined somewhere in the default object manager. I'd bet that is probably your trigger.

Game scales actors who use furnitures to one to fit with them normally. Probably that keyword indicates at which furnitures that should happen.

Link to comment
Share on other sites

OK, I think I figured it out. I'm not sure what make these functions behave a little bit differently in FO4 than they did in Skyrim but here goes.

 

The issue was in fact caused by the combination of 4 functions working together: "PlaceAtMe", "Activate", "Disable()" and Delete()".

 

Here's an abstract of my MagicEffect script (the part that was causing issues):

Scriptname MyMagicEffectScript extends activeMagicAffect

Furniture Property MyFurniture1 Auto
Furniture Property MyFurniture2 Auto
Furniture Property MyFurniture3 Auto
Actor Property PlayerRef Auto

ObjectReference myMarker

Event onEffectStart(Actor akTarget, Actor akCaster)
Int Random = Utility.Random(0,2)
	If Random == 0
		myMarker = PlayerRef.PlaceAtMe(MyFurniture1, 1, false, false, true)
		Utility.Wait(0.1)
		myMarker.Activate(PlayerRef)
	ElseIf Random == 1
		myMarker = PlayerRef.PlaceAtMe(MyFurniture2, 1, false, false, true)
		Utility.Wait(0.1)
		myMarker.Activate(PlayerRef)
	Else
		myMarker = PlayerRef.PlaceAtMe(MyFurniture3, 1, false, false, true)
		Utility.Wait(0.1)
		myMarker.Activate(PlayerRef)
	EndIf
EndEvent

Event onEffectFinish(Actor akTarget, Actor akCaster)
	If myMarker
		myMarker.Disable()
		Utility.Wait(0.1)
		myMarker.Delete()
	EndIf
EndEvent

And here's the script which was attached to each Furniture's form:

Scriptname FurnitureScript extends ObjectReference

Actor Property PlayerRef Auto
Spell Property SpawnSpell Auto

Event OnExitFurniture(ObjectReference akActionRef)
	PlayerRef.RemoveSpell(SpawnSpell)
EndEvent

After casting my spell a few times, it would refuse to work and give me that message "You cannot use this at this moment". I believe now it meant "you cannot activate your marker at this moment".

 

The troubling thing was that debugging every line in every possible way returned true every time. Debugging was telling me everytime that the marker was indeed properly activated even though it showed in game that it was not (at least its normal procedure was not triggered).

 

It also showed me that the variable "myMarker" from the MagicEffect remained stored in game even though "myMarker.Delete()" returned true too. (For some reason, adding the line "myMarker = None" after "Delete()" completely stopped the script to spawn any marker at all though). As a consequence, the Spell was spawning Furniture2 for instance but still trying to Activate Furniture1. Or at other times, yet returning Furniture 1 but as it was already disabled by the previous use of the spell, it could not activate a disabled ObjectReference. Thus the damn message... and the script not working reliably.

 

Even trying to PlaceAtMe only one furniture instead of a choice of 3 was giving me the same issue.

 

I think it was mostly due to "Delete()" not returning immediately (it never does, that's nothing new) - but the game storing a deleted variable for so long (several minutes at least) was something I had not experienced before. In essence, even though I was calling a new instance of my spell, it appeared to be running the same old instance of it even though "RemoveSpell(...)" returned true too.

 

This may be due to calling "Delete()" in conjunction with setting PlaceAtMe's new bool "abDeleteWhenAble" to True, I don't know - but that's some bool which to my knowledge was added to Fallout 4 and did not exist in of other games' versions of that function. Adding an OnCellDetach Event to my placed object showed several times that it indeed waited until the player had left the cell to self.Delete() - which may mean that this new bool when set to true might actually cause the script to ignore its "Delete()" call, again even though it returned true. Can't be 100% certain of that but in doubt I'd consider it safe to add this OnCellDetach check to any object you want to delete for sure.

 

Oh, incidentally, I discovered two other things:

 

First, that using "Disable()" on a non-persistent object instead of "DisableNoWait()" works a lot faster. From my experience with Skyrim, in order to be actually deleted, on a reference must be created at run-time, disabled, and not persistent. So calling "disable()" before calling "delete()" is a necessary step anyway.

 

Second, I added another script to my Furniture forms which was just intended for debug with something like "Debug.Notification("I am Furniture 1 and I just spawned")" onLoad(). That caused the other attached script with the onExitFurniture function to stop firing entirely. No idea why. So I changed the Event to OnInit() - same thing: the other script would never run. That's when I created 3 different versions of my FurnitureScript, just for the debug line, and discovered the game was spawning one instance and trying to activate another.

 

In the end, that led me to finding a work around and solving my issue. All this time, I had been trying to spawn markers (no 3D) and remembering the trouble I was having (on another thread) with properly positioning objects around actors in Fallout 4 (Actors X, Y and Z positions, and even worse with Angles - don't seem to be updated constantly as they did in Skyrim, but only "once in a while"), and remembering that positions are calculated on the center mass of an object which requires havok to return properly - I simply tried to add 3D and collision to these markers (using Cap001 as models). And sure enough: the object would not always get placed exactly on the actor, but at times a few units away.

 

Still, using PlaceAtMe on forms which have 3D works almost 100% reliably - activating them in the same script still remained problematic for all the above reasons. So I ended up making the furniture itself activate the player instead - tried onLoad() first but it turned out that quite a few times the "onExitFurniture" would fire before the onLoad() event - which sort of baffled me too: how can you exit a furniture you've never even activated yet?.. Anyway, once I moved up the Activate call to an onInit() event, it then started to work 100% as intented.

 

So to make a long story short: if you ever encounter the same kind of issues as I did here: give 3D to the markers you're trying to spawn, and if you want to activate them, have your placed object activate actors instead. Also if you want to keep your game clean and reliably delete these non-persistent objects, double your "onEffectFinish" Disable() and Delete() functions with similar calls onCellDetach() on your placed object.

 

Like I said earlier, this is only 5 lines out of a script which is nearly 1000 lines long and otherwise works 100% reliably. I'd have never though that "simple" functions that I've used so often in Skyrim like "PlaceAtMe", "Activate", "Disable()" and "Delete()" would have given me such a headache!..

 

Cheers to all, and thanks for your help!

Link to comment
Share on other sites

 

Not to overcomplicate this, but anyone got any idea what the "FurnitureScaleActorToOne" keyword does?

Â

It's attached to over 200 base game furniture items (including workbenches) that would generate that message, does not appear anywhere in the base scripts, and seems to be defined somewhere in the default object manager. I'd bet that is probably your trigger.

Game scales actors who use furnitures to one to fit with them normally. Probably that keyword indicates at which furnitures that should happen.

 

 

Yep, that keyword is most of the time attached to furnitures that use a direct interaction with some actors' nodes, like a Workshop station for instance where you want your actor's hands to be placed directly on the table, not above it nor beneath it. It scales actors so they all look properly positioned, feet on the ground, hands on the table. In fact some Vanilla furniture which would require that keyword don't have it - I think the DinerBooth doesn't have it for instance, and you'll see that some NPCs look like they're writing directly on the table while the notepad is positioned too low and hidden inside the table.

 

I'm not sure that "ScaleActorToOne" refer to the actual actor's height though, because Vanilla females who are shorter than males still have a scale of 1 in the actors' traits tabs but if you don't use that keyword on the furniture they'll use, they nonetheless get positioned akwardly. It may refer to scaling the related animations rather than the actor itself - just a guess, haven't fiddled with that yet.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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