Community Forum

AnimationNetwork lua

Forum Overview >> Scripting

Created03.09.2015 00:24

Giuseppe Antista (peppe78) 03.09.2015 00:33
sorry , can someone help me ? I have a script lua AnimationNetwork running some animations . I have used this on other vehicles and works perfect . Now I copied animations that use this script to use it in a mod but something semba not function . Line 216 says null . I do not understand what to look for ! I copied them as other mod functioning . only difference is that the truck is node " 0 " because only one and in the other mod with node problem is " 1 " because it is a articulatedAxis . Help
here is the script :

(Edit by moderator: Please post longer/larger code samples somewhere else, e.g. at pastebin and just put the link to that information in here)

Giuseppe Antista (peppe78) 03.09.2015 00:34
I did not know how to load the script I did paste-- sorry

Emil Drefers (Unknown) 03.09.2015 07:44

so your problem is solved?


Giuseppe Antista (peppe78) 03.09.2015 09:38
not the problma not solved . I have the script but I do not know how to create buttons to display in game .the script has a problem . seeking a warmth that I can not find . can you help me?

is the script :

and is the my xlm:

Emil Drefers (Unknown) 04.09.2015 07:18

if you want to use a custom script in a mod you first have to create a new "vehicleType".
How this can be done respectively how a "modDesc.xml" for such a mod looks like can be seen in hundreds of mods ...

Please take a look at some mods and try to understand ...


But the real problem is that the script which you are using (AnimationNetwork.lua) does not display any inpit binding (buttons) in the help panel (in the game).
So you would need to adjust the script or even better write another script which makes use of AnimationNetwork and displays the input binding.


Giuseppe Antista (peppe78) 04.09.2015 08:42
I thank you for the help . the scripts for the mod uses HKL.lua and AnimantionNetwork.lua . buttons refer to hkl I forgot to load. I will post again scripts corrected

error: Error: Running LUA method 'update'.
................Claas_Jaguar_960_TT/scripts/AnimationNetwork.lua:216: attempt to index a nil value


xlm :




Giuseppe Antista (peppe78) 04.09.2015 12:41
the error is definitely xlm but not know where .

same scripts are used on MAN_TGS_Agrar_HKL and everything works fine without error .

the scripts HLK and AnimationNetwork that do not work on Jaguar960 are on node 1> while in mod MAN TGS is node 0> and work well.

maybe I have to change even node in lua scripts ?? how to do?

Emil Drefers (Unknown) 04.09.2015 14:01

it seems that the first (and only?) animation could not be loaded.

Try to check all entries in your xml file again.
Also check if the animation can be playe in the GIANTS Editor.

Hard to say what's gone wrong ... just double check everything.


Giuseppe Antista (peppe78) 04.09.2015 23:22
which does not load ? hkl ? if I remove animationetwork says error line 106 of hkl

Giuseppe Antista (peppe78) 07.09.2015 00:03
I do not know what to animationNetwork line 216 tries but if I use it as a trailer work . But I can not load the crawler because specialization crawlers may not be compatible with the trailer . help me please. One month of work thrown if not working . I think hkl should work on node 1 > and not on node 0 > . but as I change it ? The model consists of two nodes 0 > and node 1 > hkl records all jointype hooklift and hookjoint and so I canceled the other jointype cutterhaversting on node 0 > . eg if there was a way to work hlk only on node 1 > would be perfect . I tried to delete the code in animationetwork where line 216 and not by works but error hlk gki other jointype not working . help me please

Emil Drefers (Unknown) 11.09.2015 18:25

please do not edit the code if it works correctly i another mod and if you do not exactly know what you are doing!

So, check if the animation works in the GIANTS editor.
Can you select and play the animation?


Giuseppe Antista (peppe78) 11.09.2015 19:29
I can use the animation. I know what I look ... if I replace local MaxTime = Math.min (MINTIME, self.animationParts [animationPart] .animDuration); with local MaxTime = Math.min (MINTIME, self.animationParts [1] .animDuration); It works almost only does not recognize the position of the animation activating the vehicle must stand still if I move it forward or backward animation follows the vehicle and go forward or backward. However in the end I used the script default foldingParts removing the last part of codce animationNetwork to maintain the function HKL.lua.
But now when I load the container the joint is a spring loaded, and the container does not remain stationary when the vehicle is running, but slipped on the trailer. I used <attacherJoint index = "1> 0 | 14 | 0 | 0 | 0" jointType = "Hooklift" allowsJointLimitMovement = "false" allowsLowering = "false" maxRotLimit = "10 80 50" maxTransLimit = "0 0 0" /> I tried <attacherJoint index = "1> 0 | 14 | 0 | 0 | 0" jointType = "Hooklift" allowsJointLimitMovement = "false" allowsLowering = "false" rotLimitSpring = "100 100 100" rotLimitDamping = "100 100 100" transLimitSpring = "100 100 100" transLimitDamping = "100 100 100" /> things improve and remains stuck on the trailer even if it moves a little to the sides in the corners, but when the attack starts and the animation to load it on the trailer he does not slip on the ground but jumps. what are the options to sort it out? thank you

Emil Drefers (Unknown) 14.09.2015 08:18

the specialization "AnimatedVehicle" does support changing componentJoints, but it does not support adjusting attacherJoints.

So, you could get what you want by using the "Cylindered" specialization.

Otherwise you could still try to get the custom script to work.
Put some debug prints in there and try to find the actual problem ;)


Cagen Benedict (Unknown) 27.12.2016 18:23
how do you post a mod

Note: Log in to post. Create a new account here.