Jump to content
Sign in to follow this  
tupolov

Using visitor scripting to set object size

Recommended Posts

wondering if anyone knows how to set object size in visitor script.

To set relative height is:

_x setRelHeight value;

looking for something like:

_x setRelSize value;

(this doesn't work though)

Share this post


Link to post
Share on other sites

Thanks Gnat.

resize requires an array as an input and not an object.

I have a feeling we can't resize an object in scripting for visitor. :(

Share this post


Link to post
Share on other sites
Thanks Gnat.

resize requires an array as an input and not an object.

I have a feeling we can't resize an object in scripting for visitor. :(

resize is for changing the size of an array as you've already discovered.

As for scaling an object with v3script... not doable from memory... could be wrong about that though... been awhile.

While there was a way to get at the necessary info. from memory there was no way to set the objects matrix that defines it's position, orientation & scale.

I ended up just writing a utility to alter the .pew directly.

Alternatively write a script to dump the current information for the objects of your choice out to a text file. Manually edit the text file to have whatever new size you want or use Excel to modify the file or whatever other app. suits your fancy.

Have another script that during loading the modified text file back in wipes out the current object and the templates they are based on and creates new templates from the incomming file then creates the objects again.

Alternatively one of Mikero's tools may already do this for you. Or, write a simple utility to go through the .pew and alter whatever info. you desire.

Share this post


Link to post
Share on other sites

What about transform and transformfast command?

Share this post


Link to post
Share on other sites

If the file could be exportable and reimportable with resize values it's simple to make a function to update it on WorldTools...

the problem is i never saw how to export those scaling values

Share this post


Link to post
Share on other sites
What about transform and transformfast command?

I think those were throw overs from the O2 side of things but they may just as well be useable on a V3 object... dunno... give em' a try... They weren't in the documentation a few years ago (and probably still aren't I'd guess) so I must admit I never tried them.

Do they do the job?

Also, at the time, after a short look at the .pew I knew that one could have more control over the data by just altering it directly. And with the time constraints at that point ya just end up bypassing the poorly documented scripting language and get it done.

If the file could be exportable and reimportable with resize values it's simple to make a function to update it on WorldTools...

the problem is i never saw how to export those scaling values

You'd extract the 'scale' from the matrix for the object. From memory I think it's the last column (or maybe it's the last row) can't remember off the top of my head... It's just a standard DirectX matrix so look it up on the web it'll tell ya which way around it is...

However, if one of those commands listed on Master85's biki page (haven't seen quite a number of those before... but then again haven't been looking) allows you to 'set' the object instances transform (as opposed the object template's transform) then you wouldn't need to export->alter->import at all.

hmmm... actually while I write this I have some flicker of brain activity that's telling me that the 'setting' of a 'Object Templates' transform may indeed have been possible.

But, that would then only effect object 'instances' placed after one had altered the 'template'. Not, the current crop of already placed instances. I seem to remember something about having to do something like...

Export the current instances, Destroy the current instances, export the current template, destroy the current template, alter the exported template (externally), import the altered template, recreate the instances was the scripting method.

That was literally years ago now, so my memory of it might be quite hazy. I didn't know of things like this 'transform' script command at the time or for that matter a goodly number of other ones mentioned on that page so indeed one of them may be the ticket.

Often too the performance of mass population of the .pew via importing and using the scripting was diabolically time consuming... hence bypassing that altogether seemed the most appropriate course of action.

Post how ya get on with those commands... I'm sure other's would be interested too.

Share this post


Link to post
Share on other sites
I'm sure other's would be interested too.

Yep. Or if anyone has anything else clever or whatnot.

Wouldn't say my wheels are turning, but there is a lot of startup sounds emitting from the brain. Good read there Synide. Regarding "diabolically time consuming", that scares me. (not for little maps.. but yeah) Can you recall time/object counts? Just curious. :)

.

Share this post


Link to post
Share on other sites

Just under a million instances took about 10mins once on my machine. Which pissed me off no end 'cause at the time I was doing it about thirty times a day. So I spent a couple of hours coding up a loader that in the end injected them into a naked .pew... it's runtime was about 30secs at the time if I recall. Haven't looked at Mikero's tools recently... I'm sure though some (or one) of them must be doing the job of manipulating the .pew in a pleasant manner.

Things change... time moves on... people have some pretty grunty rigs nowdays that should chew through far more instances than that... I'm back in the dark ages still.

This was all 2+ years ago now... I think ?! I don't keep track tbh. There's not much in the ArmA world that's enticing anymore it's all a bit bland & grey.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×