Jump to content

A16 - 7D2D SDX Tutorials and Modding Kit


sphereii

Recommended Posts

Wow, that works, woohoo!!!

 

I didn't realize that it needed special formatting to work, I just built mine by copying what's in other mods. I guess not many people are aware of that, cause all the mods I downloaded don't localize. ;)

 

Thanks a lot, now everything works, I'm a very happy camper!

 

I'm about to do my first mod that adds c# scripts. I have a couple of blocks that are supposed to be Powered blocks, but since I couldn't control their behavior through xml, I never finished them completely. It's pretty nice to have good examples like the Neon Signs and the Windmill.

Link to comment
Share on other sites

hey, i've learned a fair bit of c# now, and i picked up a few materials on Unity that i've started scratching. I'm wondering if anyone here knowledgeable in modding 7 days beyond xml files wants to tutor me for an hourly rate? I can't afford to pay much per hour though, but this way i feel like i'm learning things directly related to my end goal.

Link to comment
Share on other sites

hey, i've learned a fair bit of c# now, and i picked up a few materials on Unity that i've started scratching. I'm wondering if anyone here knowledgeable in modding 7 days beyond xml files wants to tutor me for an hourly rate? I can't afford to pay much per hour though, but this way i feel like i'm learning things directly related to my end goal.

 

I am not sure if you'll find many people able to provide tutoring service. There's not a lot of C# devs here, and even fewer that would have the capacity to teach.

 

I believe the biggest resource will be reviewing the SDX mods on the 7D2DSDX github repository. Read the code in the Scripts folder in the AnimationSDX and Transmogrifier class. Try to understand and follow what each does; Don't worry if you aren't crystal clear on exactly what's its doing and why (that's what questions are for), but just get a general feel for it.

Link to comment
Share on other sites

  • 2 weeks later...

Download the GitHub guide for iOS?

 

Hey, i tried adding the gethub guide you made to googles reading list on my ipad, and not only did it not save the whole guide, it didn't even save a single section.

 

i like to study while riding passenger at work, and i was using google chrome on the iPad.

 

i need a way to read this guide while off-line as alot of time is available there when road trips are involved.

Link to comment
Share on other sites

Hey, i tried adding the gethub guide you made to googles reading list on my ipad, and not only did it not save the whole guide, it didn't even save a single section.

 

i like to study while riding passenger at work, and i was using google chrome on the iPad.

 

i need a way to read this guide while off-line as alot of time is available there when road trips are involved.

 

Try this: https://github.com/7D2DSDX/Tutorials/blob/master/docs/7%20Days%20To%20Die%20SDX%20Tutorial%20and%20Help.pdf

 

It's a PDF version of the tutorials.

Link to comment
Share on other sites

ok thanks, was there a button on github that allowed me to do that? i was looking for an export button

 

No, I don't think there was a iink. When i generate the website, it generates the PDF at the same time. It's only the second time I had to distribute the PDF.

 

When I do the refreshment, I'll add a link for it.

Link to comment
Share on other sites

Hi SDX team! I've lurked on the forums for a while and loved working with your tools. Thank you for the work you put into this stuff. It's incredible.

 

I am attempting to replace a flashlight with a laser sight using sdx. I believe there is some intricacy I have overlooked regarding putting scripts into the game, as the laser script is not turning on when I activate my gun-mounted flashlight. It's supposed to extend a line render to a distance until collision. If you get a moment to spare, could you please provide me with some insight regarding this topic? Thank you so much.

Link to comment
Share on other sites

Hi SDX team! I've lurked on the forums for a while and loved working with your tools. Thank you for the work you put into this stuff. It's incredible.

 

I am attempting to replace a flashlight with a laser sight using sdx. I believe there is some intricacy I have overlooked regarding putting scripts into the game, as the laser script is not turning on when I activate my gun-mounted flashlight. It's supposed to extend a line render to a distance until collision. If you get a moment to spare, could you please provide me with some insight regarding this topic? Thank you so much.

 

How are you attaching the script?

Link to comment
Share on other sites

hey, i've learned a fair bit of c# now, and i picked up a few materials on Unity that i've started scratching. I'm wondering if anyone here knowledgeable in modding 7 days beyond xml files wants to tutor me for an hourly rate? I can't afford to pay much per hour though, but this way i feel like i'm learning things directly related to my end goal.

 

Hey there, I'm not sure I would have time to tutor, but I put all my SDX mods online yesterday, I'm sure you can find useful stuff in there: https://github.com/manux32/7dtdSdxMods.

 

There's 22 modular SDX mods in there, ranging from simple additions of food recipes, to more complex powered systems that are done with C# scripts. I finished porting all my mods to sdx this week, so there may still be little bugs. But I tested a big portion of it already.

 

Some of the mods are adapted versions of elements from other peoples mods that I liked and wanted to have as modular sdx pieces that I can merge easily with any other sdx mods.

 

Scroll down to the bottom of the page to see a visual readme that quickly highlights the contents of the mods.

I hope it helps, cheers!

 

EDIT:

I can also share the unity files for making the custom prefabs, if you want to see how they are built.

Link to comment
Share on other sites

How are you attaching the script?

 

I am attaching it to the line line render within unity. It works fine within unity, but when I bundle the asset, it's not working within 7days. Here's the laser script, if that matters:

 

using UnityEngine;

using System.Collections;

 

public class Laser : MonoBehaviour {

 

private LineRenderer lr;

// Use this for initialization

void Start () {

lr = GetComponent<LineRenderer>();

}

 

// Update is called once per frame

void Update () {

lr.SetPosition(0, transform.position);

RaycastHit hit;

if (Physics.Raycast(transform.position, transform.forward, out hit))

{

if (hit.collider)

{

lr.SetPosition(1, hit.point);

}

}

else lr.SetPosition(1, transform.forward*5000);

}

}

Link to comment
Share on other sites

I think you need to attach the script to your custom prefab from your SDX c# scripts, I don't think scripts that are in your prefab will be imported from Unity to the game. At least, that's how I do all my prefabs that have Monobehaviour scripts on them. Look a the Neon Signs mod, or check my Healing Pod mod: https://github.com/manux32/7dtdSdxMods/tree/master/Manux_HealingPod, or my Perpetual Motion Generator mod: https://github.com/manux32/7dtdSdxMods/tree/master/Manux_PerpetualMotionGenerator.

 

Monobehaviour scripts get created on the prefab by the script of the Block, in the function OnBlockEntityTransformBeforeActivated().

 

I'm not sure how to do this for items though, I haven't done any Monobehaviours for items yet.

A flashlight is of class "ItemClassToggle", so maybe creating a new derived class from "ItemClassToggle", and atttaching your scipt from its Toggle() function would work, not sure...

Link to comment
Share on other sites

Unity Scripts attached to Unity objects, in Unity, get added to the Asset Bundle as a Text Asset. It's not compiled, nor is it executable.

 

manux is correct that the only way to get your scripts in is via the Scripts hook, but takes some effort to do so.

 

There's a few people that have been able to read the Text Asset from the bundle, and compile it on-the-fly using Reflection, but I have never done that myself.

Link to comment
Share on other sites

  • 2 weeks later...
Can tell me what i need to create a block (a form, as a standard block) to which then i can assign textures from the .xml. I suspect that some tags are needed here. Or perhaps each side should be a separate mesh? Then what are the rules when creating this? names?

 

The game really lacks a simple form - a quarter of circle.

The "round" does not fit, it is not completely round. With her help, i want to create round columns four blocks thick.

 

And more, i would like to create an ordinary door (with open/close). I have not found information on the Internet that would relate specifically to 7dtd. Are there topics about it?

 

----------- UPD ---- :D

Ah, sorry, sphereii :) I wanted to send this post to Xith thread. It's more about Unity. But if You can answer that, i'd appreciate it :)

Link to comment
Share on other sites

  • 1 month later...
Please explain

 

In A17 SDX is no longer needed to add or change the games xml or add new .unity3d objects. SDX is still needed to add scripts or patch scripts to the game. Also, sdx will merge localization if the game is launched from sdx otherwise vanilla will not yet merge localization.

Link to comment
Share on other sites

ok? so what we just drop the unity file in the mods like we normally did, icons etc and just add to the existing script?

Here is the block script that comes with sdx how would it look now?

 

<append xpath="/blocks">

<block id="" name="cubetest">

<property name="Material" value="Mconcrete" />

<property name="Shape" value="ModelEntity" />

<property name="Model" value="#Cube?CubePrefab" />

<property name="CustomIcon" value="ui_game_symbol_cubetest" />

 

<!-- ony needed if you want to enable picking up the block -->

<property name="CanPickup" value="true" />

<!-- used to fine tune block position in game if needed -->

<property name="ModelOffset" value="0,0,0" />

<!-- only needed only if the block's dimensions exceeds 1Mx1Mx1M -->

<property name="MultiBlockDim" value="1,1,1" />

<property name="Collide" value="movement,melee,bullet,arrow,rocket" />

<property name="DescriptionKey" value="cubetest" />

<drop event="Destroy" count="0" />

<drop event="Destroy" name="rockSmall" count="1" prob="1" />

<drop event="Fall" name="rockSmall" count="0" prob="1" stick_chance="1" />

<drop event="Fall" name="rockSmall" count="1" prob=".75" stick_chance="1" />

</block>

Link to comment
Share on other sites

ok? so what we just drop the unity file in the mods like we normally did, icons etc and just add to the existing script?

Here is the block script that comes with sdx how would it look now?

 

<append xpath="/blocks">

<block id="" name="cubetest">

<property name="Material" value="Mconcrete" />

<property name="Shape" value="ModelEntity" />

<property name="Model" value="#Cube?CubePrefab" />

<property name="CustomIcon" value="ui_game_symbol_cubetest" />

 

<!-- ony needed if you want to enable picking up the block -->

<property name="CanPickup" value="true" />

<!-- used to fine tune block position in game if needed -->

<property name="ModelOffset" value="0,0,0" />

<!-- only needed only if the block's dimensions exceeds 1Mx1Mx1M -->

<property name="MultiBlockDim" value="1,1,1" />

<property name="Collide" value="movement,melee,bullet,arrow,rocket" />

<property name="DescriptionKey" value="cubetest" />

<drop event="Destroy" count="0" />

<drop event="Destroy" name="rockSmall" count="1" prob="1" />

<drop event="Fall" name="rockSmall" count="0" prob="1" stick_chance="1" />

<drop event="Fall" name="rockSmall" count="1" prob=".75" stick_chance="1" />

</block>

 

The model format would be:

 

<property name="Model" value="#@modfolder:Resources/Cube.unity3d?CubePrefab" />

 

the @modfolder: gets resolved during run-time to your Mods/YourMod/. Resoures would be your folder name.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...