Jump to content
Sign in to follow this  
blakeace

Blake's Mirrors

Recommended Posts

Blake's Mirrors

HCoBY853yUE

Requirements: (All EE versions)

Requires extended event handlers found in Community Base Addons.

http://forums.bistudio.com/showthread.php?t=103871

History:

v1.0 (Only in EE version)

Changed the way key presses are detected. Now using CBA Key Management for a more robost detection.

Changed the drivers key press from hold breath to toggleweapons.

v0.2.1a (Only in EE version) & v0.1.1a (module)

A quick fix where I hadn't limited the getin handler to the player allowing the addon to possibly run multiple times

v0.2a (Only in EE version)

Extended eventhandler version.

Added black and white camera effect.

Added global array to store mirror positions.

Global array allows other vehicle type to gain mirror functionality without additional code.

v0.1a

Initial release only module version.

Introduction:

A mod that allows drivers of cars and trucks to use mirrors giving a more realistic experience in those roles, rather than having to rely on the outer body experience to view behind when reversing :P

Hopefully A3 will make this redundant.

The placement is determined by a generic placement by type of the vehicles. As such one size doesn't always fit. See below to override the default placements if required.

Features:

The ability to look backwards emulating the side mirrors of a vehicle. Being able to still control the vehicle while viewing backwards. NVG compatible, though you will get the over exposure effect each time you change view.

Installation:

Install as you would any other addon. (Check the BIS forums if unsure!).

In the editor place a Blake's Mirrors module onto the map. All editor placed cars and trucks are now enabled.

If the player starts in the vehicle, functionality is created through the getin event handler requiring the player to dismount and get in the vehicle again.

Keys:

Drivers Mirror - Toggle Weapons (Default F button).

Passengers mirror - Gear (Default G button).

Usage:

There are three ways to define the camera positions for different vehicles.

Option 1.

All cars and trucks automatically have mirrors. If you don't define a custom position then a generic position is assigned automatically. Position results will vary between object types.

Option 2.

To set a custom positon. First create an object variable that contains the positions in a vehicles init area.

e.g.

_this setvariable ["mirrorpos",[1.4,3.0,-0.1],true];

If you want the mirrors to emulate a black nd white camera effect then add an object variable for the camera effect.

e.g.

_this setvariable ["Camera",true,true];

Other vehicles need to actually call the function to be given the mirrors. See the examples below.

Below great for the LAV25.

spwnrtn1 = this spawn 
{   

_this setvariable ["mirrorpos",[0,-3.1,-0.2],true]; 
_this setvariable ["Camera",true,true]; 
waituntil{Blakes_Mirrors_Loaded};
sleep 0.01;
[[_this]] CALL Fcn_Blakes_Mirrors;
};

Below great for the striker.

nul1 = this spawn
 { 

   _this setvariable ["mirrorpos",[1.4,3.0,-0.1],true];
   waituntil{Blakes_Mirrors_Loaded};
   sleep 0.01;
   [[_this]] CALL Fcn_Blakes_Mirrors;
 };

Option 3.

Use the global array to store all the information.

The first entry is the class name of the vehicle.

The second entry is the position of the mirrors.

The third entry is true or false to indicate whether it is a camera or not.

Blakes_Mirror_positions = 	["LAV25",[0,-3.1,-0.2],true,"LAV25_HQ",[0,-3.1,-0.2],true];

The other benefit of creating this global array is that non car and truck class vehicles will automatically gain mirrors if they are in the array.

In the above example placing either types of the Lav down will automatically have mirrors when the mission is played.

Download:

Version 1.0:

news_download_a2_4.png

Blake's Mirrors - Extended Eventhandlers v1.0

Blakes Mirrors - EE version (v 1.0) : http://www.armedassault.info/index.php?game=1&cat=addons&id=1823

https://rapidshare.com/files/1282061961/Blakes_Mirrors_EE_v1.0.rar

Edited by blakeace

Share this post


Link to post
Share on other sites

Will this be setup as a auto exec addon pbo too? Id like to see this running by default on vehicles, maybe an external config to list array of third party vehicles but most BIS stock by default.

Anyway, very useful, thanks.

If only AI drivers could use it ;)

Share this post


Link to post
Share on other sites

YES!!!

I've been waiting FOREVER for a mod like this, I even wanted to do one myself but I'm crap at scripting and coding : /

thank you so much blakeace!

what mrcrash2009 said would be very useful too, and probably the last bit to make this mod seriously completely perfect.

Share this post


Link to post
Share on other sites

Looking great Blake, both your releases are great. Just a thought... would it be posible to implement this into choppers. EG looking left-down or right-down, back-left or right-left. It would be great for 1st person flying, really improve gameplay!

Share this post


Link to post
Share on other sites

This is great, is there a way to do a switch from right mouse to just using the "S" key?

Share this post


Link to post
Share on other sites

Whoa. This is very clever. Any way to produce a script based solution?

-k

Share this post


Link to post
Share on other sites

Thank all for your kind comments, remeber this is only an alpha release and needs feedback on how it does or doesn't perform in mp.

@Old Bear and Foxhound Thanks!

Will this be setup as a auto exec addon pbo too? Id like to see this running by default on vehicles, maybe an external config to list array of third party vehicles but most BIS stock by default.

Should be fine, just need to do some research into how, from this great community resource. Time is the only real hinderance I imagine.

Looking great Blake, both your releases are great. Just a thought... would it be posible to implement this into choppers. EG looking left-down or right-down, back-left or right-left. It would be great for 1st person flying, really improve gameplay!

I should be fine, I did already have a quick play with that in mind a while ago, I just have to be in the right frame when playing with setVectorDirAndUp family of commands. Time is the biggest factor for me atm though.

can it be implemented into missions as a script only version?

That is possible, just the usual time card being played again. I've got a couple of other things I am trying to organise to upload too.

This is great, is there a way to do a switch from right mouse to just using the "S" key?

The problem is trying to find keys that work in the vehicle that aren't assigned to something else. Right mouse was chosen or hold breath as it is convenient if using the default keyboard mouse layout. The s key isn't valid as every time you looked into the mirror your vehicle would start going backwards. Not ideal if you are just waiting for the vehicle behind to catch up keeping an eye for him in the mirror. I just retested the custom commands, which in the past i wasn't able to get to respond when in a vehicle, worked tonight? Maybe that changed in the last patch or I was just having a brain fade when I first tested. I'll do some more testing, and change them if they seem to work ok.

I think I answered everyone, apologies if I missed somebody, I'm really tired atm. If anybody tries it on a dedicated server with a number of players on I would the results thanks.

Share this post


Link to post
Share on other sites

About keys, maby apply a keymodifier? CTRL+A (L mrr), CTRL+D (R mrr), CTRL+W (Reset)

About code intergration, module its good, but need a array with list of cars (in array set vehicle positions), or use templates to type of vehicles - truks have are the same height, cars and AVT's too, check this ;)

And i think this addon must been a serverside only! because 'angry' cheaters can reedit mirror points ;) and set cam position on hight height :)

Share this post


Link to post
Share on other sites

Brilliant! Simulates reversing cameras perfectly.

Much fun driving everywhere backwards, but I have failed my driving test a good few times...:)

Excellent idea and implementation.

Share this post


Link to post
Share on other sites

Sorry I have updated the first page, after noticing I had incorrectly set part of the example code in both the front page and the readme file. I have updated the front page and will update the readme in the next version. The change only effects things in MP.

Sorry small correction with the code below, note the red component now reads true, and was wrongly set as false. Readme file will be rectified with the next version.

spwnrtn1 = this spawn

{

waituntil {(mirrorModule getvariable "MIRRORS_initDone")};

_this setvariable ["mirrorpos",[0,-3.1,-0.2],true];

sleep 0.01;

[[_this]] CALL Fcn_Blakes_Mirrors;

};

The setvariable command can be used to customise where the mirrors are located, if the default values are not suitable.

Place below in a vehicles initilization area to customise the position. This is for a LAV-25 reversing camera.

this setvariable ["mirrorpos",[0,-3.1,-0.2],true];

I am currently working on a version that will automatically enable the mirrors.

I have added a setting to give a black and white camera effect to be used as a reverse camera emulation if required.

I experimented with the key inputs again, and found the custom keys to be ineffective most of the time. The only time I was able to get a response is when I also added a small spawn script into a vehicles init to hint at the inputactions result. It then also responded in the addon. So at the moment I am restricted to using the few keys I can get to consistently respond that don't effect driving components. eg why I use gear and hold breath.

Share this post


Link to post
Share on other sites

Nice mod! Funky music, what is that? Jaco Pastorius?

Share this post


Link to post
Share on other sites
Should be fine, just need to do some research into how, from this great community resource. Time is the only real hinderance I imagine.

Good news :) Its such a must have feature IMHO that a solid exec version would be well used. Have you spoken to any ACE team for implementation into ACE as well at all?

Share this post


Link to post
Share on other sites
Nice mod! Funky music, what is that? Jaco Pastorius?

No from some stuff supplied by Brian Boyko, Link is at the bottom of this article by him. It's the one called Groovin.

http://www.geeksaresexy.net/2010/08/24/how-to-finding-music-for-youtube-videos/

Good news :) Its such a must have feature IMHO that a solid exec version would be well used. Have you spoken to any ACE team for implementation into ACE as well at all?

Cheers, working on it. Just finding time to get my teeth into it atm is the problem. No re ACE, it is only in an alpha state, and really needs a lot more feedback to establish if it can even be considered a stand alone completed addon.

Share this post


Link to post
Share on other sites

Update:

I've uploaded an extended event handlers version in the first post.

This version includes the ability to have the mirrors use a black and white camera effect.

Players starting in vehicles don't have to get out and back in to gain functionality.

Added a global array for storing positions. Meaning those vehicles listed automatically gain those stored positions without having to add code to the vehicles init area. It also allows non car and truck classes to automatically gain functionality without extra code if they are stored in the global array.

This allows the positions to remain in control of the server and mission designer.

Important only use one version. Note the module version is yet to be updated.

Share this post


Link to post
Share on other sites

It would be great if you could find the time to make a script version - it seems like I'm not the only one who would love to see that (NkEnNy and others agree). It would be really useful in an addons-free mission.

Share this post


Link to post
Share on other sites

Update:

A quick fix where I hadn't limited the getin handler to the player allowing the addon to possibly run multiple times

Module Version:

https://rapidshare.com/files/760198207/Blakes_Mirrors_v0_1_1a.rar

Extended Eventhandlers version:

https://rapidshare.com/files/2573827564/Blakes_Mirrors_EE_v0_2_1a.rar

First post updated.

Share this post


Link to post
Share on other sites

New on front page at Armed Assault.info

Link to updated mirrors :

Blakes Mirrors (v 0.1.1a) : http://www.armedassault.info/index.php?game=1&cat=addons&id=1809

Blakes Mirrors - EE version (v 0.2a) : http://www.armedassault.info/index.php?game=1&cat=addons&id=1809

Needed :

@CBAv0.7.10 (v build 167) : http://www.armedassault.info/index.php?game=1&cat=addons&id=1814&game=1

Share this post


Link to post
Share on other sites

Just wanted to say thank you for another great mod, another 'must have'..

Thanks

.

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  

×