Jump to content

Invisible when not in workshop mode


Sebo85

Recommended Posts

I took for granted that all workshop references were listening to OnWorkshopMode event, but it seems that only the workshop reference does it, so you need to register/unregister for the remote event, since all the other events mentioned get the workshop reference as argument it is pretty simple to do that, so I've done this script that does the object replacement and it seems to work fine:

Scriptname SwapRefOnExitWorkshopMode Extends ObjectReference

Form Property InvisibleObject Auto

Event OnWorkshopObjectPlaced(ObjectReference akReference)
	RegisterForRemoteEvent(akReference, "OnWorkshopMode")
	ObjectReference IvisibleObjectRef = PlaceAtMe(InvisibleObject, abInitiallyDisabled = True)
	SetLinkedRef(IvisibleObjectRef)
	IvisibleObjectRef.MoveTo(Self)
EndEvent

Event ObjectReference.OnWorkshopMode(ObjectReference WorkshopRef, bool aStart)
	If aStart
		GetLinkedRef().Disable()
		Enable()
	Else
		Disable()
		GetLinkedRef().Enable()
	EndIf
EndEvent

Event OnWorkshopObjectMoved(ObjectReference akReference)
	GetLinkedRef().MoveTo(Self)
EndEvent

Event OnWorkshopObjectDestroyed(ObjectReference akReference)
	GetLinkedRef().Delete()
	UnregisterForRemoteEvent(akReference, "OnWorkshopMode")
EndEvent
Link to comment
Share on other sites

 

I took for granted that all workshop references were listening to OnWorkshopMode event, but it seems that only the workshop reference does it, so you need to register/unregister for the remote event, since all the other events mentioned get the workshop reference as argument it is pretty simple to do that, so I've done this script that does the object replacement and it seems to work fine:

Scriptname SwapRefOnExitWorkshopMode Extends ObjectReference

Form Property InvisibleObject Auto

Event OnWorkshopObjectPlaced(ObjectReference akReference)
	RegisterForRemoteEvent(akReference, "OnWorkshopMode")
	ObjectReference IvisibleObjectRef = PlaceAtMe(InvisibleObject, abInitiallyDisabled = True)
	SetLinkedRef(IvisibleObjectRef)
	IvisibleObjectRef.MoveTo(Self)
EndEvent

Event ObjectReference.OnWorkshopMode(ObjectReference WorkshopRef, bool aStart)
	If aStart
		GetLinkedRef().Disable()
		Enable()
	Else
		Disable()
		GetLinkedRef().Enable()
	EndIf
EndEvent

Event OnWorkshopObjectMoved(ObjectReference akReference)
	GetLinkedRef().MoveTo(Self)
EndEvent

Event OnWorkshopObjectDestroyed(ObjectReference akReference)
	GetLinkedRef().Delete()
	UnregisterForRemoteEvent(akReference, "OnWorkshopMode")
EndEvent

Okay well it's simple if you are not a total noob in scripting like me :D

Thank you so much! I hope you know that almost everything you wrote above sounds like chinese to me? :D Do I have to put this script into each static then?

Link to comment
Share on other sites

That's something that goes against a modders "honor", at least here. But people like DieFem, SKK50 or Niston might help you out, they are very skilled.

I'm also trying to find a way when I have finished my current project but that will take some days

 

I'd suggest taking a look at other mods, like this: https://www.nexusmods.com/fallout4/mods/19090

 

 

Use Champollion to decode their scripts: https://www.nexusmods.com/fallout4/mods/3742

Thank you so much man! Yeah well I'm really lost in scripting, I don't know anything about it so if somebody else sacrifices their time, I defintely would appreciate it in any way

Link to comment
Share on other sites

You should put the script in the object that is placed by the constructible object, the visible one, then fill the property InvisibleObject by pointing it to the invisible one.

Static objects don't have script holder, so you would need to use another type of form, like movable static, furniture or activator.

The model in the constructible object needs to have collision otherwise you wouldn't be able to place it in workshop mode.

Link to comment
Share on other sites

I'm checking this forum daily, usually multiple times, so there's no need of sending private messages if that's what you mean by "hit you up", and any problem you come by could happen to any other person trying to figure out this same thing, so its better to keep posting here, not to mention that other people reading this post could contribute to it and improve the method or find an easier or better alternative to it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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