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

array/duplicate object command

3 posters

Go down

array/duplicate object command Empty array/duplicate object command

Post by ADbve Tue Aug 31, 2021 7:49 am

hello

when working on an object sometime we want to duplicate it to certain axis in certain lenght.

as far as i know how to duplicate an object(b3d or csv) is to duplicate the code and add translate command, that works but some time make harder to edit and increase the file size. because of that i want to propose a new command to make duplicating an object easier.

Array/Duplicate
write that command more like the rotate or translate command.


Code:
Array (how much object is duplicated in X axis), (how much object is duplicated in Y axis), (how much object is duplicated in Z axis), (how much Length until its duplicated)


an example like this in b3d or csv:

Code:
Array 15, 0, 0, 7

its means duplicate that object 15 times on positive X axis every 7 meter.

ADbve

Posts : 72
Join date : 2020-05-14

Back to top Go down

array/duplicate object command Empty Re: array/duplicate object command

Post by ADbve Tue Aug 31, 2021 7:56 am

as example if using translate command and duplicating the object code.

i duplicate the object 7 times to X axis, the code contain 57622 lines and the file size is 3.83MB

array/duplicate object command 110

ADbve

Posts : 72
Join date : 2020-05-14

Back to top Go down

array/duplicate object command Empty Re: array/duplicate object command

Post by leezer3 Tue Aug 31, 2021 12:41 pm

Use an animated file for this Smile

That'll also have the advantage that it's supported in all versions.

I don't really see an advantage to adding this sort of functionality ot the B3D / CSV files.
Include command *maybe*, but animated files are an already supported thing which does this.

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

array/duplicate object command Empty Re: array/duplicate object command

Post by ADbve Wed Sep 01, 2021 2:20 am

How? Can you give an example ? Im not good writing command in animated file 😅

ADbve

Posts : 72
Join date : 2020-05-14

Back to top Go down

array/duplicate object command Empty Re: array/duplicate object command

Post by Delsin Wed Sep 01, 2021 6:22 pm

https://openbve-project.net/documentation_hugo/en/objects/native/animated.html

But generally, you only need something like this:

Code:
[include]
object.b3d
Position = 0,0,0.69

[include]
object.b3d
Position = 0,0,1.69

[include]
object.b3d
Position = 0,0,2.69
Delsin
Delsin

Posts : 313
Join date : 2016-08-20

leezer3 likes this post

Back to top Go down

array/duplicate object command Empty Re: array/duplicate object command

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