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

Prefabbing - Glitchy triggers

bdenoon

New member
I'm working on building my own prefabs, and I have run in to a weird glitch.

When I tie a switch, or trigger volume to a door, event, or trap, they simply do not work.

They used to work, then I got errors regarding null values, now they just don't work at all.

Any suggestions would be welcome.

B

 
Last edited by a moderator:
They don't work under what conditions?

Is this using the Playtest feature or in a game?

Is the POI in a modlet? If so, is the modlet installed locally?

Do you have the logfile showing those "null values" errors in detail, hopefully with a stack trace?

 
My ignorance is showing here....

I'm new to making prefabs, so you may get frustrated with me...

I am using the prefab editor, build up a POI, and saving it, (presumably), on my local machine.

While in the prefab editor, the switches and triggers do not work, in playtest, they do not work, (This is where I get the null value response)

Insofar as the logfile is concerned, I'll have to admit that I am not sure where to find it.

 
I'm new to making prefabs, so you may get frustrated with me...


That's not a problem. We all started out. If you wanted to connect via Discord, I'm zztong on there too. I'm not always on, but should respond when I can. If we're both on, we can chat live, shared screens, etc. You can also get assistance in the CompoPack's Discord where a number of prefab makers hang out.

In the Prefab Editor they won't work; that's normal. It's the build tool. I usually make a world to test those triggers, but they should work in a Playtest. (It kind of makes its own little world.) If you're getting the Nulls there, then there should be something in the log files.

In the same location as your LocalPrefabs folder (Your AppData folder and then something like Roaming/7DaysToDie/)  there should be a "logs" folder. The log files are located there, organized by date and time. Within the corresponding log file, I suspect you're going to find a NullReferenceException and a stack trace. You want the exception, the stack trace, and any related lines before and after that might lend us a clue as to what was happening.

The POI you're creating should be in the LocalPrefabs folder. That should be fine for local work and solo stuff. At some point you might want to share your creation. At that point I suggest you package your POI(s) into a modlet. It isn't tough to do if somebody talks you through it or you're okay with taking apart an existing modlet with POIs. There are certain things for POIs that are only practical in a modlet, such as having a name in the Danger Meter.

 
Last edited by a moderator:
Not sure why this was moved to modding since it is a vanilla prefab editor bug.... but I'm getting the same issue so lets wake this topic up. I set up my volume and trigger as I have many times before but get the same error as mentioned above. I removed the trigger and sleeper volume via xml edit and tried again. Normal spawn volumes work fine and a previous prefab I set up triggers worked fine in but in this particular instance on this prefab I am getting the following error and cannot get it to work. This is in the playtest mode. I took a video of setting up volume, trigger, and playtest result if needed.

Code:
ArgumentNullException: Value cannot be null.
Parameter name: key
  at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00008] in <31687ccd371e4dc6b0c23a1317cf9474>:0 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) [0x00000] in <31687ccd371e4dc6b0c23a1317cf9474>:0 
  at TriggerManager.TriggerBlocks (EntityPlayer player, PrefabInstance instance, TriggerVolume trigger) [0x00009] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at TriggerVolume.Touch (World _world, EntityPlayer _player) [0x00007] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at TriggerVolume.CheckTouching (World _world, EntityPlayer _player) [0x00098] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at World.CheckTriggerVolumeTrigger (EntityPlayer _player) [0x0005b] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at EntityPlayer.CheckSleeperTriggers () [0x00021] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at EntityPlayerLocal.OnUpdateLive () [0x006d7] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at EntityAlive.OnUpdateEntity () [0x00035] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at EntityPlayer.OnUpdateEntity () [0x00000] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at EntityPlayerLocal.OnUpdateEntity () [0x001e3] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at World.TickEntity (Entity e, System.Single _partialTicks) [0x0011e] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at World.TickEntities (System.Single _partialTicks) [0x000ab] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at GameManager.UpdateTick () [0x00093] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at GameManager.gmUpdate () [0x00495] in <0a824c04d551409fad5953ac8c5c40be>:0 
  at GameManager.Update () [0x00000] in <0a824c04d551409fad5953ac8c5c40be>:0 
 
It's doing something related to a Trigger Volume. Perhaps you entered that volume. Then it tried to look up something in a Dictionary using an undefined key. A Dictionary is a C# data structure where multiple values can be stored along with a name that you use to request those values later. The value "null" is special. It is effectively nothing or nowhere.

It would be handy to know which POI and where you were in the POI. If you were clicking on a button, or door, or something would be good to know too.

I think the original message is here because the OP was creating their own POI and a Vanilla POI was not involved. I'm not sure why your message is here, but that's what I can tell.

 
Back
Top