BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Some much needed functions for train .animated files

2 posters

Go down

Some much needed functions for train .animated files Empty Some much needed functions for train .animated files

Post by Delsin Fri Aug 27, 2021 10:08 pm

Aside from sound, I've found some more functions missing that make animating some essential things (gangways, couplers, pipes, etc) impossible or very difficult and imprecise:

  • a standard variable returning current car index to avoid creating multiple copies of .animated files just to put in a different car index
  • variable continuously obtaining position and rotation of any [x,y,z] spot on a car [i] relative to a similarly defined spot on another specified car, including all the car sway and motion against each other as they go
  • function that deforms objects (stretch/squish against axis specified. Basically, DeformX/Y/ZFunction)
  • damping for this and Translate functions
  • KlaxonHandle variables returning to 0 as soon as respective key is released (or probably changing existing variable behavior to this can do just fine)
  • Curve, Cant and Pitch variables returning respective values from directly under object origin regardless of placement relative to any car/axis


Ideally, there should be a way to put a "coupler" object between cars that will have it's own "axles" which are always in the same position as separately defined "CouplerAxles" on adjacent cars and the object is always moving to keep them matched, this is pretty much all about real coupler physics (not getting into longitude "play" yet, but this can be implemented by sliding coupler object "axles" along its Z axis) which seems easy enough to implement.
Also, a similar "gangway" object is also needed, which just deforms (a simple linear "rubber band" deformation is enough) so that its front and rear ends always match separately defined "GangwayAttachment" spots on adjacent cars.
Delsin
Delsin

Posts : 313
Join date : 2016-08-20

Back to top Go down

Some much needed functions for train .animated files Empty Re: Some much needed functions for train .animated files

Post by leezer3 Sun Aug 29, 2021 8:10 pm

Some of those have already been added, but don't seem to have made it to the documentation. (Have now.....)

carNumber - If part of a train, returns the index of the car.

Coupler objects:
Try adding an object to the [Coupler] section of extensions.cfg / train.xml


---

The curve, cant and pitch variables are likely to be a lot more work.
To get this, we need a track follower, which would have to be added somehow, or to maintain the appropriat offset values within the object. Will think about it, but no promises.

Deformation is interesting, will have to look at that in some more detail. Not sure if it's possible easily with the current setup.

leezer3

Posts : 1980
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Some much needed functions for train .animated files Empty Re: Some much needed functions for train .animated files

Post by Delsin Mon Aug 30, 2021 2:49 pm

Interesting, will try that out.

Honestly, cant/pitch/curve functions aren't really important if proper bar coupler and deformable gangway objects are supported.
Delsin
Delsin

Posts : 313
Join date : 2016-08-20

Back to top Go down

Some much needed functions for train .animated files Empty Re: Some much needed functions for train .animated files

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum