Jump to content

Recommended Posts

MVYh2EC.jpg

 

 

Download:

MIL_Mirror: Dropbox/Armaholic

 

Description:

MIL_Mirror allows a mission maker to add a mirror-type effect to an object capable of using setObjectTexture.

 

To use:

- PIP MUST BE ENABLED for the mirror to work (Options >> Video >> General >> PIP).

- Copy the file MIL_Mirror.sqf into your mission directory.
- Place your intended mirror object (e.g. a whiteboard - "Land_MapBoard_01_Wall_F") and name it.
- Add this line to the object's Init field in the mission editor:

_mirror setObjectTexture [0,"#(argb,256,256,1)r2t(_surface,1)"];

- _mirror - object
          - the name you give to the object in the editor
- _surface - name given to the surface

- Example:
mirror1 setObjectTexture [0,"#(argb,256,256,1)r2t(mirror1surface,1)"];

- Run the script from either init.sqf or initPlayerLocal.sqf (it's local only) using:

nul = [_mirror,_surface] execVM "MIL_Mirror.sqf";

- _mirror - object
          - the name you gave to the object in the editor
- _surface - string
           - the string equivalent of what was used for _surface in the object's Init field in the editor

- Example:
nul = [mirror1,"mirror1surface"] execVM "MIL_Mirror.sqf";

 

Media:

Day/Night demo of some mirrors (0.50):

 

Known issues:

- The reflection doesn't behave quite like a mirrored reflection, but it's the best I could achieve.
- Resolution is low.
- Torch beams (and probably most other light sources) aren't reflected, which is pretty obvious in the video.

 

If anyone finds any problems please let me know.

 

Thank you.

 

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

Nice concept / release! Does this require PIP to be enabled? Can't remember if rt2 requires it.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks @HazJ, it's obviously not as good as what an actual mod can achieve, but as far as I could figure, this is as good as a script can do. As for PIP, I have no idea :headscratch:. I'll have to have a look.

  • Like 1

Share this post


Link to post
Share on other sites

Yeah, I understand due to the limitation however a very good idea and concept. As you said, the best you can do! I think it is a great feature to have in a mission.

Share this post


Link to post
Share on other sites
11 hours ago, beno_83au said:

MIL_Mirror allows a mission maker to add a mirror-type effect to an object capable of using setObjectTexture.

That is very cool and creative.  You bloody Aussies are pretty smart!  I guess I have to work on a mission like this now:

 

Idea for enhancement:  Add handleDamage EventHandler to the white board object that spawns broken glass fragments (like when windows are shot),  sets texture to original whiteboard texture, and plays breaking glass sound.  It would be awesome if the mirror is destructible.

  • Like 1
  • Thanks 1
  • Haha 1

Share this post


Link to post
Share on other sites
11 hours ago, HazJ said:

Does this require PIP to be enabled?

OP updated. Thanks for the heads up, it DOES require PIP to be turned on.

 

3 hours ago, johnnyboy said:

Idea for enhancement:

I'm keeping an eye on that other post you tagged me in. Not a bad idea at all.

 

3 hours ago, johnnyboy said:

You bloody Aussies are pretty smart!

There's the rugged (very rugged) good looks too, don't forget that.

  • Haha 2

Share this post


Link to post
Share on other sites

Expanding on @johnnyboy idea - you could use setObjectMaterial too.

  • Like 1

Share this post


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

There's the rugged (very rugged) good looks too, don't forget that.

Haha.  I took a year off to travel many years ago, and spent 2 months in Oz.  Loved every minute of it.  Yanks may not be too popular around the world, but at least back then Aussie's loved my yank "surfer dude" accent (I'm not a surfer, but have the california accent).  And the opposite is true:  I love the Aussie accent.  One of my favorite sayings I learned was "There's only two states to be in:  Queensland or pissed!".  Hahaha.

  • Haha 1

Share this post


Link to post
Share on other sites

Good day mate, put us a shrimp on the barbie! :rofl:

  • Haha 1

Share this post


Link to post
Share on other sites
7 minutes ago, HazJ said:

Good day mate, put us a shrimp on the barbie! :rofl:

Close enough haha.

  • Haha 2

Share this post


Link to post
Share on other sites

excellent job but is it just me or is your mirror mirrored

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

×