• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Error with switch

Zarti

New member
Hello,

I've been interested in Prefabs for about 2 days. I created two different Prefabs to test and understand how everything works. I'm currently interested in switches to open doors or bridges remotely in a POI.

I managed to understand that you have to use “normal” doors and bridges and lock them. However, I have a bug that only occurs on one of my two Prefabs. I can't figure out why and how to solve it.

To put it simply, I have a problem with the switches that prevent me from using them.

On my first Prefab, I can:

Install a switch

Set trigger to 1

Destroy it

On my second Prefab, I can:

Install the same switch

Set trigger to 1

But when I want to destroy it, it gives me an error in the console: “EXC ArgumentNullException: Value cannot be null. Parameter name: key”.

If I disable the trigger, I can destroy the switch without error.

If I connect the switch to a door, it gives me the error when it is activated.

I would like to understand why I have this error in one Prefab but not in the other. For the moment I'm just doing tests but if this happens to me on a Prefab after 80 hours, it would be annoying.

Thank you for your help and apologize for my English.

 
Hello,

I've been interested in Prefabs for about 2 days. I created two different Prefabs to test and understand how everything works. I'm currently interested in switches to open doors or bridges remotely in a POI.

I managed to understand that you have to use “normal” doors and bridges and lock them. However, I have a bug that only occurs on one of my two Prefabs. I can't figure out why and how to solve it.

To put it simply, I have a problem with the switches that prevent me from using them.

On my first Prefab, I can:

Install a switch

Set trigger to 1

Destroy it

On my second Prefab, I can:

Install the same switch

Set trigger to 1

But when I want to destroy it, it gives me an error in the console: “EXC ArgumentNullException: Value cannot be null. Parameter name: key”.

If I disable the trigger, I can destroy the switch without error.

If I connect the switch to a door, it gives me the error when it is activated.

I would like to understand why I have this error in one Prefab but not in the other. For the moment I'm just doing tests but if this happens to me on a Prefab after 80 hours, it would be annoying.

Thank you for your help and apologize for my English.
Absolutely nothing wrong with your english.

 I haven't run across the issue myself but I have heard something similar from another prefabber . Could very well be a vanilla issue that occurs randomly 

 
Absolutely nothing wrong with your english.
Thanks to google translate ^^

I haven't run across the issue myself but I have heard something similar from another prefabber . Could very well be a vanilla issue that occurs randomly 
I told myself that I would copy part of my structure to a third Prefab to see if that could resolve the error. But I realize that now all my new Prefabs suffer from this problem.

I create a new empty Prefab

I put a single block

I put a switch on it

I set the trigger to 1

I get the same error when I want to destroy it.

Whether it's a switch, a bridge, a door or something else, when I set the trigger to 1, I can’t destroy it.

On my first Prefab, everything still works. I can install new switches, adjust the trigger and destroy them without error.

If I copy my structure from my first Prefab and copy it into a new empty Prefab, the error is present.

 
Thanks to google translate ^^

I told myself that I would copy part of my structure to a third Prefab to see if that could resolve the error. But I realize that now all my new Prefabs suffer from this problem.

I create a new empty Prefab

I put a single block

I put a switch on it

I set the trigger to 1

I get the same error when I want to destroy it.

Whether it's a switch, a bridge, a door or something else, when I set the trigger to 1, I can’t destroy it.

On my first Prefab, everything still works. I can install new switches, adjust the trigger and destroy them without error.

If I copy my structure from my first Prefab and copy it into a new empty Prefab, the error is present.
Yeu def sounds like the issue another prefabber had.

Can't seem to find his bug report tho on the bug forum but it there somewhere.

Try removing the number from the block before destroying the block 

 
If I uncheck the trigger on 1 ? 

If I do that, yes I can destroy it without error. My problem is that the error that occurs when I leave it checked prevents me from operating the switch.

If I check the trigger of my switch to 1 and I check the “trigger by” of a door to 1, it does not work. When I use my switch, nothing happens.

On my first Prefab, I do the same thing and the door opens. I therefore suppose that the error obtained by wanting to destroy my switch with the trigger on 1 is the cause.

I deleted all my Prefabs (after putting them aside) and reinstalled the game. I still have the same problem. Ultimately, I don't think I understand everything about the switch system. I'm going to try to rewatch some tutorials, I probably forgot to do something important.

 
I took screenshots but I'm not sure how to add them ^^ I have to go through an external site, right?

I understood why I have this problem but I don't know how to solve it on my second Prefab.

I noticed that on my first working Prefab, at the top right, just below “Alpha 21.1 (b16)”, it says the name of the Prefab.

On my other two Prefabs, this is not indicated. After several tests, I understood that the name of the Prefab must be written for me to be considered on it. If I move away a little, on my first Prefab which works, I get the error.

So I managed to destroy my switch by landing on the block of my third Prefab.

However, on my second Prefab, even when deactivating the flight, the name of my Prefab is never written at the top right of the screen.
I changed the name of the Prefab but it still does not appear.

Edit: I don't know if there is a better solution but I reselected my structure and copy/pasted it onto a new Prefab. When saving and reloading the Prefab, the name appears and the switches work.

 
Last edited by a moderator:
I took screenshots but I'm not sure how to add them ^^ I have to go through an external site, right?

I understood why I have this problem but I don't know how to solve it on my second Prefab.

I noticed that on my first working Prefab, at the top right, just below “Alpha 21.1 (b16)”, it says the name of the Prefab.

On my other two Prefabs, this is not indicated. After several tests, I understood that the name of the Prefab must be written for me to be considered on it. If I move away a little, on my first Prefab which works, I get the error.

So I managed to destroy my switch by landing on the block of my third Prefab.

However, on my second Prefab, even when deactivating the flight, the name of my Prefab is never written at the top right of the screen.
I changed the name of the Prefab but it still does not appear.

Edit: I don't know if there is a better solution but I reselected my structure and copy/pasted it onto a new Prefab. When saving and reloading the Prefab, the name appears and the switches work.
Yes unfort would have to use an external site for pics. 

That is weird something might a got borked but as for the name of poi if no localization is done the file name should appear that is correct. 

 
Last edited by a moderator:
Hello,

I continued my tests for learning Prefabs. For the moment, I no longer have any errors on the switches.

So my problem is solved. Thank you for taking the time to help me.

I will finally be able to start creating my first POI.

 
Hello,

I continued my tests for learning Prefabs. For the moment, I no longer have any errors on the switches.

So my problem is solved. Thank you for taking the time to help me.

I will finally be able to start creating my first POI.
Awesome to hear it is solved for you and enjoy 

 
I understood that the name of the Prefab must be written for me to be considered on it. If I move away a little, on my first Prefab which works, I get the error.


That is weird something might a got borked but as for the name of poi if no localization is done the file name should appear that is correct. 


I can confirm that the name of the POI, whether it be file name or localization name must be present for triggers to work. I was modifying an existing RWG tile of mine and could not get the triggers to work. I had the prefab Tag "streettile" in my xml file.  Removing this tag caused the triggers to work. Among other things, the "streettile" tag means that a prefab name does not appear in-game. Why, oh why it is considered 'null' is beyond me. Maybe the Fun Pimps can enact a work-around for POIs without names.

I've also identified other issues with the triggers, though I do not know if they have been reported;
- Cannot check 'Trigger Unlocks' for Trigger Volumes, only for switches (meaning that doors can only be opened, but not unlocked with trigger volumes)
- powerSwitch01 (18814) and powerSwitch02 ( 18815) will not utilize AND/ANY logic for a 'triggered by' event, even if the box is unchecked (meaning that it will always be active)
As an example, I have a switch that I want to be powered only after 3 other switches have been triggered. Once all 3 switches are triggered, the final switch should light up and be used to open a door. Instead, the switch seems to ignore all the 'triggered by' tags (23, 24, 25 in my case) and will always be able to be opened.

Again, I'm not sure if the Fun Pimps are aware of these issues and/or believe them to have been fixed already.

 
Back
Top