Hmm, some new and interesting breakage:
Loading Assets/Arcadia/Source/arcadia/linear.clj...
System.InvalidOperationException: No such var: clojure.core/inline-arity-pred
clojure.lang.Compiler.ResolveIn (clojure.lang.Namespace, clojure.lang.Symbol, System.Boolean)
clojure.lang.Compiler.Resolve (clojure.lang.Symbol)
clojure.lang.Compiler.AnalyzeSymbol (clojure.lang.Symbol)
clojure.lang.Compiler.Analyze (clojure.lang.CljCompiler.Ast.ParserContext, object, System.String)
Not sure why it's suddenly started blowing up at this point, anyone seen this before?
Ok, so I sort of dumbly stumbled into this one =)...
(defn vec->c#list [v]
(let [xs (|System.Collections.Generic.List`1[System.String]|.)]
(doseq [e v]
(.Add xs e))
xs))
Anyone have anything more elegant that I missed? I specifically need a List of Strings, not Persistent List... Unity's new UI Toolkit doesn't like it if you try and bind Persistent Lists to dropdown boxes =)... If not I'll add it as a pattern!
Serialization
, I'll have to adjust logic
Anyone have any suggestions on how to specify this interop call?
public static T Q(UIElements.VisualElement e, string name, string className);
From: https://docs.unity3d.com/2019.1/Documentation/ScriptReference/UIElements.UQueryExtensions.Q.html
This is used as:
var label = root.Q<Label>("label-name");
My digging around in the clr docs is that the way to do this is using (type-args UnityEngine.UIElements.Label)
to represent the <Label>
part:
(UQueryExtensions/Q (type-args Label) (get-root ui-screen) "label-name" "")
Except this always returns nil
, stepping through the nrepl evaluation in the debugger makes me believe that it's not finding the function... Except it's not returning an undefined fn error... Really not sure what's going on...
root
and get-root
are the same as far as I can tell =)...
My delightful workaround for this is to manually create a function for each type, which is viable as there are only finite types that cover this...
I'm seeing references to StrongBox`1
, which some googling is telling me is a way of boxing stuff... specifically this? System.Runtime.CompilerServices.StrongBox
, except no idea how to construct it. I've tried importing it with no luck.
I tried constructing it via:
(by-ref (uint 0))
(|System.Runtime.CompilerServices.StrongBox`1[uint]|. 1)
(|StrongBox`1[uint]|. 1) ;; wasn't really expecting this to work, but I figured give it a shot =)...
Maybe this is a rabbit hole, what I'm trying to do is use a function that takes out uint x
. Any suggestions on how to do this would be great =)...
Reading the clr docs implies that you should use by-ref
and though that works for ref
's, it doesn't appear to work on out
...
I think I'm hitting this:
arcadia-unity/Arcadia#114
(Vector3/SmoothDamp (-> obj .transform .forward) target-dir (by-ref smooth-v) smooth-time)
Commonly smooth-v
just blows up, and I have no idea how to tell if it's null or not. Any ideas or ways of working with these?
Ok, I figured it out, but it involved having to add smoothDamp
to LinearHelper
:
public static IPersistentVector smoothDamp(Vector3 current, Vector3 target, Vector3 currentVelocity, float smoothTime)
{
Vector3 newCurrentVelocity = currentVelocity;
Vector3 result = Vector3.SmoothDamp(current, target, ref newCurrentVelocity, smoothTime);
return PersistentVector.create(result, newCurrentVelocity);
}
as well as add smooth-damp
to arcadia.linear
(definline smooth-damp
"Given a `Vector3` `current`, a `Vector3` `target` a `Vector3` `current-velocity` and a `float` `smooth-time`, returns a collection containing the result (`Vector3`) of smoothly changing from the current to the target over the time smooth-time and current-velocity (`Vector3`), as set by the `Vector3/SmoothDamp`.
Calls to this function will be inlined if possible."
[^UnityEngine.Vector3 current ^UnityEngine.Vector3 target ^UnityEngine.Vector3 current-velocity smooth-time]
`(Arcadia.LinearHelper/smoothDamp ~current ~target ~current-velocity ~smooth-time))
Happy to PR it (though it will probably need some improvement), as there seems to be precedent with working with ref
according to arcadia-unity/Arcadia#267.
I've managed to post the question here with some more details if anyone is interested:
https://answers.unity.com/questions/1873894/trying-to-build-a-pipeline-but-getting-error-in.html
If I can get this figured out I'd definitely adding it into the wiki, this is an unnecessary pain =)...
Hi,
I've encountered below error while I was trying to execute build-result of <orbomancy> which is Arcadia-Godot Example.
Can you please enlighten me any clue what I've been doing wrong ?
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'clojure.lang.RT' threw an exception. ---> System.IO.FileNotFoundException: Could not locate clojure.core.cljc.dll or clojure/core.cljc on load path.
at clojure.lang.RT.load (System.String relativePath, System.Boolean failIfNotFound) [0x001a2] in <fb1204dbf0b848beaab1559f81f1b22c>:0
at clojure.lang.RT.load (System.String relativePath) [0x00000] in <fb1204dbf0b848beaab1559f81f1b22c>:0
at clojure.lang.RT.DoInit () [0x00000] in <fb1204dbf0b848beaab1559f81f1b22c>:0
at clojure.lang.RT..cctor () [0x01f3d] in <fb1204dbf0b848beaab1559f81f1b22c>:0
--- End of inner exception stack trace ---
at Arcadia.Boot.Initialize () [0x00037] in <2a86192f9b0a4b49ab80b15f8828eb2b>:0
at Arcadia.ArcadiaHook._EnterTree () [0x00001] in <2a86192f9b0a4b49ab80b15f8828eb2b>:0
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'clojure.lang.RT' threw an exception. ---> System.IO.FileNotFoundException: Could not locate clojure.core.cljc.dll or clojure/core.cljc on load path.
at clojure.lang.RT.load (System.String relativePath, System.Boolean failIfNotFound) [0x001a2] in <fb1204dbf0b848beaab1559f81f1b22c>:0
at clojure.lang.RT.load (System.String relativePath) [0x00000] in <fb1204dbf0b848beaab1559f81f1b22c>:0
at clojure.lang.RT.DoInit () [0x00000] in <fb1204dbf0b848beaab1559f81f1b22c>:0
at clojure.lang.RT..cctor () [0x01f3d] in <fb1204dbf0b848beaab1559f81f1b22c>:0
--- End of inner exception stack trace ---
at Arcadia.Boot.Initialize () [0x00037] in <2a86192f9b0a4b49ab80b15f8828eb2b>:0
at Arcadia.ArcadiaHook._EnterTree () [0x00001] in <2a86192f9b0a4b49ab80b15f8828eb2b>:0
Here is how I got this error:
I've proceeded Godot engine build first, then
I used command below via repl:
(require 'arcadia.internal.compiler)
(arcadia.internal.compiler/aot "export/dlls" ['game.core])
``
and witnessed below from Godot output..
compiling clojure.core ..
compiling clojure.core.server ..
compiling arcadia.internal.namespace ..
compiling arcadia.repl ..
then these dlls are produced on export/dlls/
arcadia.2D.clj.dll
arcadia.core.clj.dll
arcadia.internal.config.clj.dll
arcadia.internal.namespace.clj.dll
arcadia.linear.clj.dll
arcadia.repl.clj.dll
game.baddies.clj.dll
game.core.clj.dll
game.data.clj.dll
game.gen.clj.dll
```
Then I copied these dlls to exe folder.
I find those errors on top when I run the exe.
I'm using:
Godot_v3.3.3-stable_mono_win64.exe
latest Arcadia-godot
Thanks in advance,
I'm all ears.
Hi everyone, I’m currently working on replacing clojure-clr with nostrand/magic in ArcadiaGodot:
https://github.com/AydarLukmanov/ArcadiaGodot/tree/feature/replace-clr-with-magic
have working version which allow export @selfsame orbmancy on iphone (but needed some fixes because magic is more strict on types), it’s running okay, aside absence of controls
https://github.com/AydarLukmanov/orbomancy