Umbrella Posted December 20, 2019 Share Posted December 20, 2019 Hello, I just coded a cool effect in 7D (actually just spawning a block at a given location), how do you test it ? - Can I define a game command that would execute my effect ? - Should I define a new game object that triggers the effect when used ? Thank you ! Link to comment Share on other sites More sharing options...
n2n1 Posted December 20, 2019 Share Posted December 20, 2019 What do you mean by "effects"? Link to comment Share on other sites More sharing options...
Umbrella Posted December 21, 2019 Author Share Posted December 21, 2019 Hi n2n1. How do you quickly and isolatedly test a C# method or class you just wrote ? Link to comment Share on other sites More sharing options...
n2n1 Posted December 21, 2019 Share Posted December 21, 2019 I've read a few of your posts, but to be honest - i'm very bad at what you're asking. There is a feeling that you have specific knowledge in a particular area (с#?) , but are completely unfamiliar with xml for 7dtd. Hi n2n1. How do you quickly and isolatedly test a C# method or class you just wrote ? What is the effect in your understanding here? many things can be called effects! Well....create a new (own) block/item and use your function in the block or item, with the appropriate rules... Yes, sounds corny. for example, if it is a block - you can declare this class in a block in the same way as it is done in other blocks. Further - control should be transferred to your functions....as i understand...if what you wrote is a new class. You need more specifics. //// I just coded a cool effect in 7D (actually just spawning a block at a given location), how do you test it ? //// Okay, what commands (from xml) control your custom spawn now? (it's rhetoric) (I just don't understand how you could write this without imagining how it would work) Who will deal with the spawning of this block? Another block? item? entity? world generator? You want to spawn the block at coordinates x,y,z? on a particular type of biome? in prefab? //// - Can I define a game command that would execute my effect ? //// What are you talking about here? xml, dll, console ? Regarding c# - i can't help, unfortunately. If it is xml, then you can take for example some of the existing commands to do something like that...but i can't advise because the purpose of your C# code is shrouded in mystery. PS: If you have knowledge with c# coding maybe you could help me in this matter https://7daystodie.com/forums/showthread.php?139016-Question-about-editing-class-methods-in-dnSpy Link to comment Share on other sites More sharing options...
meganoth Posted December 21, 2019 Share Posted December 21, 2019 Maybe look up the xml in Data/Config/blocks.xml. Look for example how a farm plot block is defined and mimic that with your block (throw away lines that are about farming, keep the rest). If you have everything correct you should be able to get your effect block just like you could get a farm plot block from the creative menue and set it down somewhere. Link to comment Share on other sites More sharing options...
Umbrella Posted December 21, 2019 Author Share Posted December 21, 2019 Thank you for your replies. I am sorry I was not clear. It is more of a general question. All the great mods that you guys are coding use some effects/content, whether that's implemented via xml xpath, c# code, unity model, whatever. My point is : how do you test those features while developping ? What I currently do is restart 7D, activate mods, launch it, create a new game, spawn in creative whatever item my mod affects and then see what happens. This is very long and tedious (and should get worse to test more complex effects / conditions)... even having a command to spawn your test object (or set your xml attribute to some test value) would save time. Can we create commands ? For xml alterations, I am aware you can export settings and see the altered xml for yourself. You also have online xpath tools. For unity models, I imagine there are editors / renderers. But how can you test DMT or scripts ? Can we import the game's dll in some debug mode ? attach debugger to running 7D ? If we need the whole game running, any way to speed-up game start ? To generate a 50x50 map only ? ... So just a general question to get your good practices. @n2n1: you are right, I am starting. I have read the game's xml a few times in the past, and know about xpath. I don't know c# but I am a regular programmer in other languages. You are also very right that the proper test depends on the feature. Regardless, seeing the altered xml or having quick shortcuts to set the test setting sounds useful. Link to comment Share on other sites More sharing options...
n2n1 Posted December 22, 2019 Share Posted December 22, 2019 What I currently do is restart 7D, activate mods, launch it, create a new game, spawn in creative whatever item my mod affects and then see what happens. This is very long and tedious (and should get worse to test more complex effects / conditions)... even having a command to spawn your test object (or set your xml attribute to some test value) would save time. Unfortunately - so and there is. We often have to restart the game. Only there are small optimizations, for example: - no need to exit the game in most cases, just exit to the menu (quit game) and re-load the save (but in this way - some resources, localization, icons, sprites are not refresh) - for fast loading choose small worlds (4K or less) . I use 2K slice. - there are not many console commands, they are useful only for specific tasks. Make command to debug?...hmm...questionable business... This is in case xml editing. But in the case of DTM, i'm thinking - is harder. I would probably first create a working prototype based on direct editing .dll, and only then did the patch-code. But it would be better for you to be prompted about it by those who are engaged in it. I'm old school. Direct configuration is available only to developers - they have the source code, they work with the Unity environment (as far as i know) - we work with the compiled build...hence the limitations. I too, before, wondered similar questions - but then was accustomed. SSD and large memory - to help Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.