Jump to content
Twiznak

[Help] setObjectScale on simulated objects?

Recommended Posts

Hi everyone! I have a good one for you all today. With the release of the art of war DLC, my mind was blown by the miniatures on display in the museum. I researched and found the wiki on setObjectScale . In the section entitled "Problem(s)" 😎 it reads

Quote

The Arma 3 LOD limits still apply, meaning walk-able surfaces can only be X m in size, and collision in general will only work up to X m from object center. This command works on all objects in Eden Editor or scenario preview, but it will not save and will reset when objects get moved. Eden Editor support is only intended for artists. Setting the scale of actively simulated objects (Vehicles with players/AI in them) is possible, but not officially supported, you may encounter issues.

and again my mind is blown. setting the scale of simulated objects! OMG, Shrink-ray gun mod! and arma versions of old movies: Fantastic Voyage && Attack of the 50 Foot Woman && GODZILLA . But first HOW?!? How do we set the scale of a simulated object and what are the issues we are going to encounter? If my journey through arma has taught me anything, it's that in the absence of a direct solution, there is ALWAYS a work around. Let's have this discussion. Please, how do we do this and what are the issues we are going to encounter?

Gunny, I shrank the Kids!

A52416FB6C694781AF93CF0814BEC661617E8C92

D55A287010D1129A11A23C87B84315422BC2EC58

671455E1F16C9987242E9A1A693365F372972AC6

C402CD4F7ECB49520F4EF98BF7293EC2B96056AD516F4136D5B58993F653AFCDBD35F71362046388

  • Like 2

Share this post


Link to post
Share on other sites

just tried this:

put a man down and named him dude1
in his init:

[] spawn {
	while {alive dude1} do {
	dude1 setObjectScale 0.3;
	};
};

and it seems like its working , atleast he is running and chasing me XD

 

so funny he is ant man

https://i.imgur.com/4qLoZCK.gifv

 

so funny XD

Spoiler

CAQ72he.jpg

 

 

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites
On 3/3/2021 at 1:48 AM, Alert23 said:

just tried this:

put a man down and named him dude1
in his init:


[] spawn {
	while {alive dude1} do {
	dude1 setObjectScale 0.3;
	};
};

and it seems like its working , atleast he is running and chasing me XD

 

so funny he is ant man

https://i.imgur.com/4qLoZCK.gifv

 

so funny XD

  Reveal hidden contents

CAQ72he.jpg

 

 

Hi, Thank you! Sorry for the late reply, I have been super busy. When I get this up and functional I will add you to the credits of whatever I make with it. THANK YOU!

  • Haha 1

Share this post


Link to post
Share on other sites

I love the Fantastic Voyage pic. What mod has the female in bathing suit?

 

I didn't think of a constant loop resetting scale.  Is that expensive performance-wise I wonder?

 

I'm trying a different approach where I attach scaled unit to an invisible normal unit, then control the scaled unit's animations.  Will be releasing something soon.

  • Like 1

Share this post


Link to post
Share on other sites
12 hours ago, johnnyboy said:

I love the Fantastic Voyage pic. What mod has the female in bathing suit?

 

I didn't think of a constant loop resetting scale.  Is that expensive performance-wise I wonder?

 

I'm trying a different approach where I attach scaled unit to an invisible normal unit, then control the scaled unit's animations.  Will be releasing something soon.

Hi! The mod is ZEPHIK Female units. I want to try your approach when it's ready. Right now the loop works for set setObjectScale .4 and 10. Not a noticeable impact on performance. Main issue I have encountered is running as a gaint ( setObjectScale 10 ) , stubbing my tow on a wall or house and dying 🙂 pretty funny to watch.

  • Like 2

Share this post


Link to post
Share on other sites
On 3/3/2021 at 10:48 AM, Alert23 said:

just tried this:

put a man down and named him dude1
in his init:


[] spawn {
	while {alive dude1} do {
	dude1 setObjectScale 0.3;
	};
};

and it seems like its working , atleast he is running and chasing me XD

 

so funny he is ant man

https://i.imgur.com/4qLoZCK.gifv

 

so funny XD

  Hide contents

CAQ72he.jpg

 

 

Hi,


Can  I ask you how do you name the character dude1?

Because I put dude1 in the identity tab of the editor but when the scenario run there is no size modification and I have a error typing that dude1 is not a defined variable.

Thanks

 

Share this post


Link to post
Share on other sites
2 hours ago, Valentor said:

Can  I ask you how do you name the character dude1?

 

Sure!

 

OiZYqJN.png

 

s92gfq1.jpg

  • Haha 4

Share this post


Link to post
Share on other sites
On 3/3/2021 at 10:48 AM, Alert23 said:

just tried this:

put a man down and named him dude1
in his init:


[] spawn {
	while {alive dude1} do {
	dude1 setObjectScale 0.3;
	};
};

and it seems like its working , atleast he is running and chasing me XD

 

so funny he is ant man

https://i.imgur.com/4qLoZCK.gifv

 

so funny XD

  Reveal hidden contents

CAQ72he.jpg

 

 

Hi there. This is a very nice script. But every time I try the script the uit is very buggy cause it turns big and small very fast and I don't know what i can do that this stops.

Share this post


Link to post
Share on other sites

I recently found out that setObjectScale on real objects (not simple objects) does not work in published missions.  But it will work when you preview run a mission within the editor.   So if you want to scale up a unit, that unit will flicker and look like shit.   Even if you use setObjectScale on eachFrame.

 

For me this is a huge bummer as I was finally going to publish a mission using my very functional giants.  I put at least 100 hours work into the giants, but that effort is wasted.

 

If you want to make a static object larger using setObjectScale, create the object as a simple object, then scale it up.

Share this post


Link to post
Share on other sites
29 minutes ago, johnnyboy said:

I recently found out that setObjectScale on real objects (not simple objects) does not work in published missions.  But it will work when you preview run a mission within the editor.   So if you want to scale up a unit, that unit will flicker and look like shit.   Even if you use setObjectScale on eachFrame.

 

For me this is a huge bummer as I was finally going to publish a mission using my very functional giants.  I put at least 100 hours work into the giants, but that effort is wasted.

 

If you want to make a static object larger using setObjectScale, create the object as a simple object, then scale it up.

The problem is that I want to create a scenario with the Half Life Striders from the mod "Half Life- Our Benefactors" to look like the giant Martian Tripods from War of the Worlds. But they're simulated objects and everything I've done so far with the scaling has created the problem of the Strider unit flickering.

Share this post


Link to post
Share on other sites
1 minute ago, Vernichter91 said:

But they're simulated objects and everything I've done so far with the scaling has created the problem of the Strider unit flickering.

Yeah its sad, but I don't think its going to work.

Share this post


Link to post
Share on other sites
2 minutes ago, johnnyboy said:

Yeah its sad, but I don't think its going to work.

Thats very bad. I wish i would be easier wioth the scaling in Arma

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, johnnyboy said:

Yeah its sad, but I don't think its going to work.

How did you scale your giants, cause they look very great in the video and it seems that they are not flickering there

Share this post


Link to post
Share on other sites

For some simulated objects (men objects in particular), you can attach them to another man object or game logic, then use setObjectScale to make them larger.  You can then play animations on the scaled up object and they look good.  

 

So for my giants I created a regular sized unit and made him invisible using hideObjectGlobal.  This is the unit that my scripts give doMove commands to to move him around.  I then attach the giant unit to this hidden unit, and scale him up.  I have a loop running per giant that plays standing, walking, or running animations on giant depending on how fast the hidden unit is moving, which makes it appear the giant is moving.  This works well if ran from Editor.  But if you export the mission to SP missions, then play the mission from SP scenarios, it does not work. 

 

 

Share this post


Link to post
Share on other sites
16 minutes ago, johnnyboy said:

For some simulated objects (men objects in particular), you can attach them to another man object or game logic, then use setObjectScale to make them larger.  You can then play animations on the scaled up object and they look good.  

 

So for my giants I created a regular sized unit and made him invisible using hideObjectGlobal.  This is the unit that my scripts give doMove commands to to move him around.  I then attach the giant unit to this hidden unit, and scale him up.  I have a loop running per giant that plays standing, walking, or running animations on giant depending on how fast the hidden unit is moving, which makes it appear the giant is moving.  This works well if ran from Editor.  But if you export the mission to SP missions, then play the mission from SP scenarios, it does not work. 

 

 

Can you maybe make a Video where you exactly show and describe what you have to do to scale a simulated Unit?

Share this post


Link to post
Share on other sites
1 hour ago, Vernichter91 said:

Can you maybe make a Video where you exactly show and describe what you have to do to scale a simulated Unit?

Sorry but that is too much work.  But you are welcome to look at my code and use anything you find useful.  Unzip this sample giant mission into your missions folder, and then you can open the giant mission in the editor, and also look at the code.

 

https://www.dropbox.com/s/5bf4u2hzrlfi104/JBOY_Giant_v1.Tanoa.7z?dl=0

Share this post


Link to post
Share on other sites

I have some other problem with scaled objects (simple objects) I use the craters and deformer script to make hole after that and it works - look nice but in moment of resize of crater texture/simple object (with removed roadway lod - > avoiding problems with walking in explosion zone) whole game froze for even few minutes to acomplish resize operation this poroblem depend on level of resize in up of course bigger rescale bigger delay, this happen only when I start to see deformed object beacouse when I drop bomb and I have explosion on my back all going fine (deformation of terrain is made in one moment without delay and crater simple object is created to and resized - but for this moment only in memory) after that when I turn plane again front side to explosion place all froze to make resize of crater texture for be  ready to see.?imw=5000&imh=5000&ima=fit&impolicy=Lett

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

×