Randomize objects
3 posters
Page 1 of 1
Randomize objects
Hello!
Recently I've been working on the Class 321 for openBVE. The model is basically done, so I'm making small details for a better model overall.
So, I decided to start with the front numeration and I wonder, Is there any way to make them change every time you enter a route?
Ex: when you enter a route for the first time it shows this number...
and if you enter a second time it shows this other number...
Any ways to do it? Thanks in advance!
Recently I've been working on the Class 321 for openBVE. The model is basically done, so I'm making small details for a better model overall.
So, I decided to start with the front numeration and I wonder, Is there any way to make them change every time you enter a route?
Ex: when you enter a route for the first time it shows this number...
and if you enter a second time it shows this other number...
Any ways to do it? Thanks in advance!
SP1900 likes this post
Re: Randomize objects
Animated objects:
Use a separate object state for each of the desired numbers, and switch between them using a function with RandomInt
Not sure when this was added off the top of my head, but at least three years ago.
Rotefiles:
Use separate .FreeObj numbers and the $Rnd command to switch between them.
This should work all the way back to BVE4.
There's no way I can think of to sequentially number upwards, you'd just have to have a few different number models and switch between them
Use a separate object state for each of the desired numbers, and switch between them using a function with RandomInt
Not sure when this was added off the top of my head, but at least three years ago.
Rotefiles:
Use separate .FreeObj numbers and the $Rnd command to switch between them.
This should work all the way back to BVE4.
There's no way I can think of to sequentially number upwards, you'd just have to have a few different number models and switch between them
Rakago likes this post
Re: Randomize objects
Thanks! Although I'm not very good at animating files, can you tell me how I am supposed to write it correctly? (I've read the documentation too, but it didn't gave much info)
Thanks again!
Thanks again!
Re: Randomize objects
I think that you should write such as below:
- Code:
[object]
states = nums/401.csv, nums/402.csv
StateFunction = randomInt[0, 1]
RotateYFunction = 3.141593653589793
Midnight Express Ginga81- Posts : 154
Join date : 2016-09-25
Re: Randomize objects
I've tried that, but the number doesn't change...Midnight Express Ginga81 wrote:I think that you should write such as below:I think that the 'randomInt' means recieve integer number.
- Code:
[object]
states = nums/401.csv, nums/402.csv
StateFunction = randomInt[0, 1]
RotateYFunction = 3.141593653589793
I also tried to write StateFunction = randomInt[0, 2] but then this happens:
https://drive.google.com/file/d/1UclzB7ob6_ILLchhcW0Bd9l8lJdR3g7x/view?usp=sharing
I don't know what to do, please help.
Re: Randomize objects
- Code:
[object]
states = test1.csv,test2.csv
;work correctly
;But these functions are ignored value 0. It is enable from 1.
;StateFunction = abs[ randomInt[0, 2] ]
;StateFunction = ceiling[ randomInt[0, 2] ]
StateFunction = randomInt[0, 2]
;I do not know why so not start from 0.
;And I don't know why randomInt cannot use directly.
;do not work. only test1.csv show
;StateFunction = randomInt[0, 1]
I tested create these csv and animated.
These commands can change randomly by 'randomInt'.
But, these animated cannot change at only the start of the game.
There are always change.
I don't know how to only change the when the start the game only one time change rondomly.
If someone wants these sample file, I create the new issue to github, and upload.
Midnight Express Ginga81- Posts : 154
Join date : 2016-09-25
Re: Randomize objects
Nevermind, I finally sorted it out thanks to a guy I have contacts with. The solution is to write RefreshRate = 1000000 after the RandomInt command.
Like this:
[object]
states = nums/401.csv, nums/402.csv
StateFunction = randomInt[0, 2]
RefreshRate = 1000000
Thanks everyone for the help anyway!
Like this:
[object]
states = nums/401.csv, nums/402.csv
StateFunction = randomInt[0, 2]
RefreshRate = 1000000
Thanks everyone for the help anyway!
Midnight Express Ginga81 likes this post
Similar topics
» [PROJECT TURNED PRIVATE] 1970s New York City Subway recreation in OpenBVE
» Is it possible to add objects to a track?
» HS2: Objects needed
» Two Switch objects
» Objects - using the texture
» Is it possible to add objects to a track?
» HS2: Objects needed
» Two Switch objects
» Objects - using the texture
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum