Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 31st Oct 2025 at 11:25 AM
Default Breaking/repairing an object in a custom interaction
Hi I have been trying to solve this problem for days now and I couldn't find a solution, so I hope to get some advice on here. I am making a custom interaction to break/repair an object (like a computer, TV...). To break the object, I use this code snippet in the Run() method:

"base.Target.Repairable.BreakObject(base.Actor, true);"

Alternatively I have also tried:

"base.Target.Repairable.BreakObject();"

But for some reasons, the object never breaks ingame. It doesn't have the unbreakable update either. I have the unprotected DLLs (so I can add interactions to objects, they also show up and work, except the actual breaking).

I looked at how EA interactions as well as other mods on here manage to break objects, and it's always the same code I'm using as well... so I cannot figure out the problem.

If anyone has an idea or a solution, it would help me a lot Thanks in advance!
Reaper
staff: moderator
#2 Old 31st Oct 2025 at 2:41 PM
Is it not an ImmediateInteraction with an ImmediateInteractionDefinition (or an ActorlessInteractionDefinition)?

Can you share the code, please?

This is a signature.
Test Subject
Original Poster
#3 Old 1st Nov 2025 at 9:27 AM
Quote: Originally posted by Eca
Is it not an ImmediateInteraction with an ImmediateInteractionDefinition (or an ActorlessInteractionDefinition)?

Can you share the code, please?


Thanks for responding! Also, I feel like an idiot now because I found the issue. I kept looking in the Run() method to find the mistake, but I literally just put the wrong interaction in the InteractionDefinition (I had two interactions, one for breaking and one for repairing, and for both I put the repairing interaction in the definition, so the code for actually breaking an object was never executed). I do feel a little bit stupid now but I'm just glad it wasn't a complicated thing to solve.

To answer your question though, it was a simple Interaction, not an ImmediateInteraction or something
Reaper
staff: moderator
#4 Old 1st Nov 2025 at 2:54 PM
Quote: Originally posted by amypilz
Thanks for responding! Also, I feel like an idiot now because I found the issue. I kept looking in the Run() method to find the mistake, but I literally just put the wrong interaction in the InteractionDefinition (I had two interactions, one for breaking and one for repairing, and for both I put the repairing interaction in the definition, so the code for actually breaking an object was never executed). I do feel a little bit stupid now but I'm just glad it wasn't a complicated thing to solve.

To answer your question though, it was a simple Interaction, not an ImmediateInteraction or something

Silly mistakes happen all the time. I once spent hours trying to figure out why my script wouldn't work, only to realize a stupid typo was the source. :D

Good that you have made it work!

This is a signature.
Back to top