Closed TokyoSU closed 3 years ago
If you use TR1 Lara the c# code does not work. I think that the commands are also different with respect to TR4. Anyway commands should be preserved in the json, can you send me the wad so I can check?
For the json I reformatted using vscode when I needed it :D
https://www.mediafire.com/file/ow4hpubdowd3zqy/TR1_LARA.zip/file there the file. i could try TR3 maybe ?
Sorry, I can't check today, anyway the problem is that TR1 Lara doesn't crouch so it will raise errors when unity executes crouch related code. Maybe TR3 Lara will work if the state/animation ids are the same as TR4 otherwise you need to change the code.
Does the CurrentAnimFrame can have negative value ?
Because it's what i have, some check like if (CurrentAnimFrame > -0.0147)
o.o'
EDIT: it was caused by me, when refactoring GenerateLaraAnimation script, i messed up and changed Frame by CurrentState:
transition.AddCondition(AnimatorConditionMode.Greater, startm1, CurAnimFrameName);
transition.AddCondition(AnimatorConditionMode.Less, end, CurAnimFrameName); // <--- there !
but it not fix the problem of negative value for box collider being invalid. since box collider not support negative value.
Im using a new project, so the state are not setup with TR4 lara code, so it work fine with TR1 one :) Also i have the leaked code of TR1, so i will code it with TR1 code :D And upgrade it when necessary. It not solve the command being not extracted through :x
It should be fixed now, I also formatted the json!
Does the CurrentAnimFrame can have negative value ? Because it's what i have, some check like
if (CurrentAnimFrame > -0.0147)
o.o' EDIT: it was caused by me, when refactoring GenerateLaraAnimation script, i messed up and changed Frame by CurrentState:transition.AddCondition(AnimatorConditionMode.Greater, startm1, CurAnimFrameName); transition.AddCondition(AnimatorConditionMode.Less, end, CurAnimFrameName); // <--- there !
but it not fix the problem of negative value for box collider being invalid. since box collider not support negative value.
The current animation frame is used to check whether an animation transition can happen. For instance when Lara runs, she can jump only in the frames where one of her feet is close to the ground. The frame > -0.0147 just means that the animation switch can also happen at frame 0.
Just one more question before closing :) I get some Infinity or -Infinity in the frame condition, it cause many error ❌ Do you have an idea how to fix ? EDIT: the json not contains any command after the update :x but the formatting is great :) Maybe the original tr1 lara cause that, i will try with TR3 one. EDIT2: Command work with TR3 one, but not TR1, wreid... EDIT3: The Infinity is not here when using TR3 one, dont know if TR2 one is working too :x
I tested with your wad and the json included the commands, did you try keeping the tr4 object names?
For the infinity, maybe you are dividing by zero somewhere? Maybe it is not loading the animation correctly and gives you 0 frames in total.
Im trying to load with TR4 object name yes, since it's the only one with Lara Full Model Mode.
Its working on my end with your TR1 wad, that's strange. Some animations have no commands but others do have them such as walk forward. Maybe some issue overwriting the json file.. did you delete it? I've no idea :o
Dont know, maybe using the WadMerger with TRNG fix cause that ?
I would have asked to try emptying the addon pycache folders but if it is working for TR3.. it should also work for TR1. That TRNG fix I think that just changes the wad version number.
This is the file I get from your TR1 wad:
https://mega.nz/file/tdYwiLxQ#95uUFVNM5UKzKkfhJ5mEe5Rmr-90S9s2Vcqkwbcb8A0
It's wreid i dont get this at all (command), for me it's empty. i could try another time, but it will give me 0 command :x
EDIT: wreid i retested it with tr1 lara to get the json file with command, after updating to the flip update and it worked this time :x
I see, sometimes Blender is weird. Being a modal editor, it can behave differently depending on a lot of stuff, and it is difficult to take account of everything.
Ive spotted this when doing a small rewrite by changing the int to a command enum for the GenerateLaraAnimations script:
Command instruction = (Command)com[0].AsInt;
The Debug.Log() returned 0 command found for each animation, it's what caused me to check it on the json. The extracted json dont have any command writed only that:
"commands": [],
It's pretty wreid that nothing is extracted, my lara object (from TR1) have actually command like PlaySound or SetPosition. can you check whats going on :)PS: the json is unreadable when its only one line :x