Boogman Posted March 29, 2018 Share Posted March 29, 2018 Hello everyone. I'm new to modding 7D2D. How do I get the wire to connect to the model at a specific location. As you can see in the picture, it just defaults to the center of the model block. Do I need to add a node(bone), join, vetor, etc? I have looked around the Assembly-CSharp.dll and can't figure it out. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
xyth Posted March 30, 2018 Share Posted March 30, 2018 Try adding a property to your models xml: <property name="WireOffset" value="x,y,z" /> Link to comment Share on other sites More sharing options...
HAL9000 Posted March 31, 2018 Share Posted March 31, 2018 You can also have a child gameobject on the model called "WireOffset" and it should link to that. Link to comment Share on other sites More sharing options...
Boogman Posted March 31, 2018 Author Share Posted March 31, 2018 Electrical mod Try adding a property to your models xml: <property name="WireOffset" value="x,y,z" /> Wow, worked great...! Thank you very much xyth. I have just started working with the Unity game engine, going to take a while to wrap my head around it. By the way, I do 3d modeling in Maya 2012. Boogman Link to comment Share on other sites More sharing options...
Boogman Posted March 31, 2018 Author Share Posted March 31, 2018 Electrical mod You can also have a child gameobject on the model called "WireOffset" and it should link to that. HAL9000, I added a child GameObject to the model and set it's location where I wanted the wire to be, sry but it didn't work. I even tried to add the GasmeObject to the parent GameObject and that didn,t work ether, maybe I'm doing something else wrong. HAL9000, I remember that movie when it came out. DAVE. Here is a pic of the GameObject setup. Link to comment Share on other sites More sharing options...
Guppycur Posted March 31, 2018 Share Posted March 31, 2018 WireOffSet, case sensitive, if I recall. Link to comment Share on other sites More sharing options...
Boogman Posted March 31, 2018 Author Share Posted March 31, 2018 Electrical mod WireOffSet, case sensitive, if I recall. Here is what I used: WireOffset I checked the Assembly-CSharp. I checked the var at: TileEntityPowered.WireOffset Same thing there. I have made a mistake somewhere. Thanks, didn't know it was case sensitive, I should have, it's C#. Link to comment Share on other sites More sharing options...
Guppycur Posted March 31, 2018 Share Posted March 31, 2018 I logged into my work pc (albeit from my phone) and peeked at a neon sign I made... I had Set instead of set, so I /think/ Set is right. But, it may not be a working copy of my neon sign. =) - - - Updated - - - Find um... Sniper Three08, he's the resident guru on that besides Hal. Xyth likely knows as well. Link to comment Share on other sites More sharing options...
HAL9000 Posted March 31, 2018 Share Posted March 31, 2018 Here is what I used: WireOffset I checked the Assembly-CSharp. I checked the var at: TileEntityPowered.WireOffset Same thing there. I have made a mistake somewhere. Thanks, didn't know it was case sensitive, I should have, it's C#. Hello Boogman, Here's the code from TileEntityPowered: public Transform BlockTransform { get { return this.KZZ; } set { this.KZZ = value; global::BlockValue block = global::GameManager.Instance.World.GetBlock(base.ToWorldPos()); if (this.KZZ != null) { Transform transform = this.KZZ.FindChild("WireOffset"); if (transform != null) { Vector3 wireOffset = global::Block.list[block.type].shape.GetRotation(block) * transform.localPosition; this.WireOffset = wireOffset; return; } } if (global::Block.list[block.type].Properties.Values.ContainsKey("WireOffset")) { Vector3 wireOffset2 = global::Block.list[block.type].shape.GetRotation(block) * global::Utils.ParseVector3(global::Block.list[block.type].Properties.Values["WireOffset"]); this.WireOffset = wireOffset2; } } } It has to be a direct child of the gameobject, not grandchild or deeper. From your screenshot it looks like you've put it as a grandchild but the image is blurry because the forum shrinks images. Cheers, Hal Link to comment Share on other sites More sharing options...
Guppycur Posted March 31, 2018 Share Posted March 31, 2018 Oh, and welcome to 7day modding. =) - - - Updated - - - s it is then. Thanks Hal. Link to comment Share on other sites More sharing options...
Boogman Posted March 31, 2018 Author Share Posted March 31, 2018 Electrical mod Hum, maybe I am referencing the wrong dll. My reference is set to: C:\SDXModding\Game\Working\7DaysToDie_Data\Managed\Assembly-CSharp.dll Is the that correct? copied pasted from the Assembly-CSharp.dll: TileEntityPowered.WireOffset The Assembly-CSharp.dll only has 3 references to WireOffset. TileEntityPowered.WireOffset IPowered.GetWireOffset() TileEntityPowered.GetWireOffset() All the same, it worked with adding the property to the xml file, but not the GameObject child. Link to comment Share on other sites More sharing options...
Boogman Posted March 31, 2018 Author Share Posted March 31, 2018 Ok, I put it under the mesh, not the GameObject. So it should look like this? Hello Boogman, Here's the code from TileEntityPowered: public Transform BlockTransform { get { return this.KZZ; } set { this.KZZ = value; global::BlockValue block = global::GameManager.Instance.World.GetBlock(base.ToWorldPos()); if (this.KZZ != null) { Transform transform = this.KZZ.FindChild("WireOffset"); if (transform != null) { Vector3 wireOffset = global::Block.list[block.type].shape.GetRotation(block) * transform.localPosition; this.WireOffset = wireOffset; return; } } if (global::Block.list[block.type].Properties.Values.ContainsKey("WireOffset")) { Vector3 wireOffset2 = global::Block.list[block.type].shape.GetRotation(block) * global::Utils.ParseVector3(global::Block.list[block.type].Properties.Values["WireOffset"]); this.WireOffset = wireOffset2; } } } It has to be a direct child of the gameobject, not grandchild or deeper. From your screenshot it looks like you've put it as a grandchild but the image is blurry because the forum shrinks images. Cheers, Hal Link to comment Share on other sites More sharing options...
Guppycur Posted March 31, 2018 Share Posted March 31, 2018 Got it sorted homie? Link to comment Share on other sites More sharing options...
Boogman Posted April 1, 2018 Author Share Posted April 1, 2018 Got it sorted homie? Yes, it worked great. I did have the WireOffset (GameObject) in the wrong location. I put it right off the parent GameObject and set is coordinates. Also I found that the block coordinates are from the center of the block. Thanks for help HAL9000 & Guppycur. Link to comment Share on other sites More sharing options...
Guppycur Posted April 1, 2018 Share Posted April 1, 2018 You may find this helpful, if you haven't already seen it. https://7d2dsdx.github.io/Tutorials/index.html Link to comment Share on other sites More sharing options...
Boogman Posted April 2, 2018 Author Share Posted April 2, 2018 You may find this helpful, if you haven't already seen it. https://7d2dsdx.github.io/Tutorials/index.html Oh yes, that was one of the first things I did. It's a good Tut. I also been going through the Unity Tut's as well. And I'm brushing up on my C#, I have not programed in years. I do all my models in Maya 2012, I made models for a game call F.E.A.R. I did the first female character for the game, also working minigun, sniper, duck nade, maps, etc. Here is a pic of her. She was only 3178 Tris, that's a real lightweight model. Oh, HAL9000 posted the source code of the Assembly-CSharp.dll above, can I get that? Do you code in C#? Thanks for the help...! Link to comment Share on other sites More sharing options...
HAL9000 Posted April 2, 2018 Share Posted April 2, 2018 Oh, HAL9000 posted the source code of the Assembly-CSharp.dll above, can I get that? Download dnSpy and put the Assembly-CSharp.dll in and you can see the source. Use the DLL from the SDX version of the game because it does a lot of changes in the background to make the code easier to read Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.