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 folder MIL_Mirror into your mission directory.
- Place your intended mirror object (e.g. a whiteboard - "Land_MapBoard_01_Wall_F" - they work best) and name it.
- Add this line to your mission's init.sqf file:

nul = [_mirrors] execVM "MIL_Mirror\initialise.sqf";
- _mirrors - array
           - names of all the mirrors
		
Example:
nul = [mirror_1,mirror_2] execVM "MIL_Mirror\initialise.sqf";

 

 

Media:

Day/Night demo of some mirrors (0.50):

 

Glass House Update (2.05):

**Disclaimer - Duke Nukem is talking about himself here, definitely not me 😄

 

 

Known issues:

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

- As far as I'm aware you can only have up to 8 mirrors working at a time (once one is destroyed the next in the list will start working). I assume this is a limitation of the game unfortunately.

 

If anyone finds any problems please let me know.

 

Thank you.

 

Change log:

Spoiler

v1.1:

Added - Breaking glass.

             - 1-3 shots at random.

             - Breaks from explosions.

             - Glass shatter effect.

             - Glass breaking noises.

Added - 50m distance check to mirrors being "active".

Changed - How mission creators implement the function.

                 - Objects no longer need to have setObjectTexture run on them from the editor!!!

                 - Instructions have changed due to this, but are now MUCH simpler.

Changed - Increased mirror resolution.

Fixed - Working MP implementation.

 

v1 - Release.

 

Edited by beno_83au
Update v1.1 - Glass House Update
  • Like 4
  • 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
1 hour ago, johnnyboy said:

Idea for enhancement: 

 

This is a crazy GOOD idea Johnnyboy !

  • Like 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
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

Thanks @johnnyboy. I've just had some down time from being crook but I'll have a look at it over the next few days and try and get something out.

  • Like 1

Share this post


Link to post
Share on other sites

Little WIP video:
 

 

"#particlesource" createVehicleLocal got me pointed in the right direction, then I just had to look for the broken glass particle classes and go from there 👍

  • Like 3

Share this post


Link to post
Share on other sites

Ehhh, I'm on struggle street again. So the problem this time is one that has been persistent with the "mirrors" since the beginning. In MP, clients don't see any basic texture changes when executed locally (I guess I might've known about that issue a while ago, but forgot about it since). So, on the server (hosted), this works fine:

testMirror setObjectTexture [0,"#(rgb,8,8,3)color(0,0,0,1)"];

However, when the client tries this the object (whiteboard) goes black. This was also occurring when I was trying to get a client to see the mirror with:

_mirror setObjectTexture [0,format["#(argb,512,512,1)r2t(%1,1)",_surface]];

Again, host worked fine. So I kind of went on a journey (comparable to LOTR journeys) thinking that it was either camCreate or procedural textures being used locally that was the issue somehow. I even tried creating a whiteboard locally from the client PC but got no where. Eventually I cut it back to bare basics and found that the texture just would not set on the client PC.

 

What's going on here!!???!?!?! :hang:

Share this post


Link to post
Share on other sites

@GEORGE FLOROS GR I need to use it locally. When a player goes more than 50m away from a mirror the texture gets set back to it's default (which works), then when they are back within the 50m a loop resumes running. I have it pause to save on resources, as I figured that beyond 50m at would be unlikely that someone would be seeing themselves in the mirror. This is what I'm using for the loop:

nul = [_mirror,_dir1,_camera,_camPos,_surface] spawn {
	params ["_mirror","_dir1","_camera","_camPos","_surface","_dir2"];
	while {true} do {
		waitUntil {(player distance _mirror) < 50};
		_mirror setObjectTexture [0,format["#(argb,512,512,1)r2t(%1,1)",_surface]];
		while {(player distance _mirror) < 50} do {
			_dir2 = _dir1 - ((player getDir _mirror) - (getDir _mirror));
			_camera camPrepareTarget [
				(_camPos getPos [player distance _mirror,_dir2]) select 0,
				(_camPos getPos [player distance _mirror,_dir2]) select 1,
				_camPos select 2
			];
			_camera camCommitPrepared 0;
		};
		_mirror setObjectTexture [0,"a3\structures_f\civ\infoboards\data\mapboard_default_co.paa"];
	};
};

I figured it'd save on resources/lag if the script wasn't needlessly running on anything too far away. So this works fine for the host, but not clients.

  • Like 1

Share this post


Link to post
Share on other sites

I thing that you need so else to use the global and are you running this from the intPlayerlocal ?

Share this post


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

What's going on here!!???!?!?! :hang:

I hope Georgie talked you off the ledge Frodo!  setObjectTextureGlobal!  I've been there mate.  Sometimes you just spin your wheels and go crazy...

  • Haha 2

Share this post


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

I hope Georgie talked you off the ledge Frodo!

 Lol, yeah he tried to help. The problem is though I need the textures to be set locally and at different times for different players, so running all this locally made sense. New day anyway, i might have a think about a different way to do this. 

  • Like 1

Share this post


Link to post
Share on other sites

Ugh, god damnit.

 

Quote

Make sure PIP is enabled in the video options.

 

Me:

"Pft, of course it is. I cAn SeE iT wOrKiNg On ThE hOsT pC!?!??!!?!?!"

 

Better me (and far too late):

"OMG the client PC!!!!!!!!!!!!!!!!!!!!!"

 

Anyway, I gotta go to the dentist now. Cheers 🤣

 

edit: Thanks @GEORGE FLOROS GR, told you I'd figure it out haha

  • Like 1

Share this post


Link to post
Share on other sites

Updated.

 

v1.1 - Glass House Update:

Added - Breaking glass.

             - 1-3 shots at random.

             - Breaks from explosions.

             - Glass shatter effect.

             - Glass breaking noises.

Added - 50m distance check to mirrors being "active".

Changed - How mission creators implement the function.

                 - Objects no longer need to have setObjectTexture run on them from the editor!!!

                 - Instructions have changed due to this, but are now MUCH simpler.

Changed - Increased mirror resolution.

Fixed - Working MP implementation.

 

Glass House Update (2.05):

**Disclaimer - Duke Nukem is talking about himself here, definitely not me 😄

 

Link/s on the OP have been updated.

Props in the video, other than the mirrors, were done using @phronk's furniture script (it's unoptimised, but this is SP using one building).

As far as I'm aware you can only have up to 8 mirrors working at a time (once one is destroyed the next in the list will start working). I assume this is a limitation of the game unfortunately.

  • Like 1
  • Thanks 2

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

×