shadow_wxh Posted May 18, 2021 Share Posted May 18, 2021 I made a digital piano with 44 keys last year,here is the video. https://www.bilibili.com/video/BV1MJ411B7oZ/ https://www.bilibili.com/video/av78037533 <p><iframe src="//player.bilibili.com/player.html?aid=78037533&bvid=BV1MJ411B7oZ&cid=133509524&page=1" frameborder="no" scrolling="no" width="95%" height="600"> </iframe></p> But the problem is storing data for this equipment require huge amount of Filter/Buffer gates and lots of maunal editing. So I need a way to quickly read data from a midi file and convert them to game Filer/Buffer gates configuation.The template yaml method doesn't work because the time setting is not recoreded in those file and timing in music is critical. Anyone can shed some light? Link to comment Share on other sites More sharing options...
gabberworld Posted May 25, 2021 Share Posted May 25, 2021 midi is complex file, it contains 15 channels what it needs handle, its doable but takes allot time. Link to comment Share on other sites More sharing options...
gabberworld Posted May 26, 2021 Share Posted May 26, 2021 Link to comment Share on other sites More sharing options...
shadow_wxh Posted May 28, 2021 Author Share Posted May 28, 2021 Interesting App but my challenge is to make things within ONI physics boundaries. So the sound has to be generated by the game sound effect and the data has to be stored by logic gates, no MOD allowed. Looks like I have publish my next video by painstakingly edit gates by gates. Link to comment Share on other sites More sharing options...
shadow_wxh Posted June 13, 2021 Author Share Posted June 13, 2021 Tried patch this piece of code in harmony and It seems enable template loader in recongnise buffer gate delay time. [HarmonyPatch(typeof(TemplateLoader))] [HarmonyPatch("PlaceBuilding")] public class TemplateLoader_PlaceBuilding_Patch { public static bool Prefix(ref GameObject __result, Prefab prefab, int root_cell) { Debug.Log("TemplateLoader PlaceBuilding Prefix!"); ..... if (prefab.other_values != null) { foreach (Prefab.template_amount_value otherValue in prefab.other_values) { string id = otherValue.id; if (!(id == "joulesAvailable")) { if (!(id == "sealedDoorDirection")) { if (id == "switchSetting") { LogicSwitch s = gameObject1.GetComponent<LogicSwitch>(); if ((bool)(UnityEngine.Object)s && (s.IsSwitchedOn && (double)otherValue.value == 0.0 || !s.IsSwitchedOn && (double)otherValue.value == 1.0)) s.SetFirstFrameCallback((System.Action)(() => s.HandleToggle())); } else if (id == "delayAmount") { Debug.Log("Delay Amount set to " + otherValue.value); LogicGateBuffer component4 = gameObject1.GetComponent<LogicGateBuffer>(); if ((bool)(UnityEngine.Object)component4) component4.DelayAmount = otherValue.value; } else { } } else { Unsealable component4 = gameObject1.GetComponent<Unsealable>(); if ((bool) (UnityEngine.Object) component4) component4.facingRight = (double) otherValue.value != 0.0; } } else { Battery component4 = gameObject1.GetComponent<Battery>(); if ((bool) (UnityEngine.Object) component4) component4.AddEnergy(otherValue.value); } } } ....... if (prefab.connections != 0) TemplateLoader.PlaceUtilityConnection(gameObject1, prefab, root_cell); __result = gameObject1; return false; } } } } Also edit yaml file like this name: Gate_Test info: size: X: 2 Y: 1 area: 2 cells: - element: Oxygen mass: 6.68891478 temperature: 192.216827 - element: Oxygen mass: 6.90753126 temperature: 208.156052 location_x: 1 buildings: - id: LogicGateBUFFER element: Copper temperature: 293.149994 other_values: - id: delayAmount value: 1.23 Now it is just a matter of refine this code and edit the yaml file Link to comment Share on other sites More sharing options...
gabberworld Posted June 13, 2021 Share Posted June 13, 2021 On 5/28/2021 at 1:55 PM, shadow_wxh said: Interesting App but my challenge is to make things within ONI physics boundaries. So the sound has to be generated by the game sound effect and the data has to be stored by logic gates, no MOD allowed. Looks like I have publish my next video by painstakingly edit gates by gates. app is for transfer midi or some other info to the game, but as i understand you want make it like game poi is maded what stored inside yaml file Link to comment Share on other sites More sharing options...
shadow_wxh Posted June 13, 2021 Author Share Posted June 13, 2021 Something like that, another way I can think of is to prase game sav file and edit from there but I haven't figure out how to do that yet. Anyway the limit is not to change the game physics this is only mean to reduce manual labour. Link to comment Share on other sites More sharing options...
shadow_wxh Posted June 22, 2021 Author Share Posted June 22, 2021 Just made a C# program doing this job gonna give it a shot real quick Link to comment Share on other sites More sharing options...
shadow_wxh Posted June 23, 2021 Author Share Posted June 23, 2021 Just done testing my little program. I am proud of announce that it is 100% totally working. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.