Jump to content

[RELEASE] VASP - Vehicle and Skin preview on Traders v1.2 (Updated 06/18/2014)


Recommended Posts

I may have forgot to do a part but I'm sure I didn't, but basically it works perfectly fine, but when you exit it just shows a black screen, and when you press escape it shows the sky and you need to re-log to fix it, There is also no errors in my rpt log. Not sure if this is a known problem but I'm currently using Linux, so I'm not sure if that would make a difference 

Link to comment
Share on other sites

I may have forgot to do a part but I'm sure I didn't, but basically it works perfectly fine, but when you exit it just shows a black screen, and when you press escape it shows the sky and you need to re-log to fix it, There is also no errors in my rpt log. Not sure if this is a known problem but I'm currently using Linux, so I'm not sure if that would make a difference 

 

I have the same problem.

InfiStar Antihack is disabled - same, so it's not related to antihack.

 

The error is the following in client RPT:

Error in expression <if ((_this select 1) == 0x3F) then {[Veh>
  Error position: <if ((_this select 1) == 0x3F) then {[Veh>
  Error type Script, expected Bool

It happens in player_traderMenuHive.sqf:

VehiclePreviewHotkey = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 0x3F) then {[VehiclePreviewList,LastTraderSelectCategory,LastTraderSelectItem] spawn ON_fnc_VehiclePreview;};"];

Spent some hours already trying to find a solution, but nothing so far.

First I tried to disable serialization, because we use findDisplay... it's not the problem.

Then I tried to change the format of displayAddEventHandler, removing ; at end or adding {} around " if ", but still error appeared in log.

Then I created a separate function with spawning the ON_fnc_VehiclePreview for the event handler function and gave 'true' for return value.

This caused no errors appear in RPT log, but destroying the preview camera still doesn't drop you back to your camera view and screen remains black.

 

other issue:

Does anyone have idea where infiStar disabled or changed using the F5 (maybe other keys too)?

I already assigned the Map icons to F6 in AH, so pressing F5 in VASP works for admins.

However it doesn't work for players; pressing F5 does nothing.

 

Suggestion to OtterNas3:

 

You could use

AllAllowedSkins = [];
{
    AllAllowedSkins = AllAllowedSkins + [format["Skin_%1",_x]];
} forEach AllPlayers;

to define the skin magazine list, instead of listing the names in an array in VASP script.

Link to comment
Share on other sites

 

 

1

this is working great and very awesome...

thankz....

 

would be great if in description it included vehicle weapons

and then weapons with or without preview but maybe  the range, damage and mag type

 

I have created a text file with all that info if you could add it somehow  save yourself  alot of work (maybe) let me know I will post the list.

shows almost all weapons overwatch and epoch

classname

magazine classname

Damage

Link to comment
Share on other sites

Don't suppose there's an easy way to re-assign F5 to something else? Guessing it's not as simple as changing a dik code since I couldn't find one in there. Then again, also not sure if that's the only thing or if there's something else that the AH doesn't like.

Link to comment
Share on other sites

I may have forgot to do a part but I'm sure I didn't, but basically it works perfectly fine, but when you exit it just shows a black screen, and when you press escape it shows the sky and you need to re-log to fix it, There is also no errors in my rpt log. Not sure if this is a known problem but I'm currently using Linux, so I'm not sure if that would make a difference 

 

Do u use the new Amra 2 patch maybe where the deleteVehicle function is not working? Cause it works on all of my friends servers now perfectly on 103718 beta patch.

The script waits until the preview vehicle is deleted before it goes back to player cam so maybe thats a point?

else i dont know what but, scripts work good tested it again on a vanilla epoch.

 

 

I have the same problem.

InfiStar Antihack is disabled - same, so it's not related to antihack.

 

The error is the following in client RPT:

Error in expression <if ((_this select 1) == 0x3F) then {[Veh>
  Error position: <if ((_this select 1) == 0x3F) then {[Veh>
  Error type Script, expected Bool

It happens in player_traderMenuHive.sqf:

VehiclePreviewHotkey = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 0x3F) then {[VehiclePreviewList,LastTraderSelectCategory,LastTraderSelectItem] spawn ON_fnc_VehiclePreview;};"];

Spent some hours already trying to find a solution, but nothing so far.

First I tried to disable serialization, because we use findDisplay... it's not the problem.

Then I tried to change the format of displayAddEventHandler, removing ; at end or adding {} around " if ", but still error appeared in log.

Then I created a separate function with spawning the ON_fnc_VehiclePreview for the event handler function and gave 'true' for return value.

This caused no errors appear in RPT log, but destroying the preview camera still doesn't drop you back to your camera view and screen remains black.

 

other issue:

Does anyone have idea where infiStar disabled or changed using the F5 (maybe other keys too)?

I already assigned the Map icons to F6 in AH, so pressing F5 in VASP works for admins.

However it doesn't work for players; pressing F5 does nothing.

 

Suggestion to OtterNas3:

 

You could use

AllAllowedSkins = [];
{
    AllAllowedSkins = AllAllowedSkins + [format["Skin_%1",_x]];
} forEach AllPlayers;

to define the skin magazine list, instead of listing the names in an array in VASP script.

For the error in your RPT file, its quite usual error for this kinda hotkey call, but the call itself works fine.

Never figured out why it shows that error sometimes, but will have a deeper look on it. But again it works fine, even if it shows that error.

 

for the use of the AllPlayers variable from epoch:

Cause not all Skins are in the AllPlayers variable, and to give the Server owner a option for custom skins, this is not a option.

 

 

this is working great and very awesome...

thankz....

 

would be great if in description it included vehicle weapons

and then weapons with or without preview but maybe  the range, damage and mag type

 

I have created a text file with all that info if you could add it somehow  save yourself  alot of work (maybe) let me know I will post the list.

shows almost all weapons overwatch and epoch

classname

magazine classname

Damage

Send me the list as a PM i will see if its easy to do, if i do my best, but dont watned to put alot of work on this Mode for more options!

 

 

Don't suppose there's an easy way to re-assign F5 to something else? Guessing it's not as simple as changing a dik code since I couldn't find one in there. Then again, also not sure if that's the only thing or if there's something else that the AH doesn't like.

There is!

Yyou would just need to change the dikCode in the calls:

player_traderMenuHive / player_traderMenuConfig:

		VehiclePreviewHotkey = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 0x3F) then {[VehiclePreviewList,LastTraderSelectCategory,LastTraderSelectItem] spawn ON_fnc_VehiclePreview;};"];



and


		SkinPreviewHotkey = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 0x3F) then {[SkinPreviewList,LastTraderSelectCategory,LastTraderSelectItem] spawn ON_fnc_SkinPreview;};"];

and in VASP_init.sqf are 2 blocks that looks like this:

		PreviewAbortHotkey = (findDisplay 46) displayAddEventHandler ["KeyDown", "
			if ((_this select 1) == 0x3F) then {
				PreviewLoop = false;
				(findDisplay 46) displayRemoveEventHandler ['KeyDown', PreviewAbortHotkey];
				(findDisplay 46) displayRemoveEventHandler ['KeyDown', PreviewRotateHotkey];
				(findDisplay 46) displayRemoveEventHandler ['KeyDown', PreviewZoomHotkey];
			};
		"];

change the 0x3F to whatever dik code you want, a list can be found on this website https://community.bistudio.com/wiki/DIK_KeyCodes

 

Moo,

Otter

Link to comment
Share on other sites

another great addition  would be to be able to cycle through skins and vehicles

 

That would require to generate the tradermenucategory and the itemlist for each cycle, as for the hive version this is a bad idea, cause it would be such slow!

And would need a lot of work around how to get the selected item and what comes nex/before in the list!

 

If someone wants to give a shot on adding such a function, go ahead and use my files as a base for it.

Feel free to publish it here or send me the files and i put them in the OP.

But as i said too much effort for such a small function ^^

 

Moo,

Otter

Link to comment
Share on other sites

For the error in your RPT file, its quite usual error for this kinda hotkey call, but the call itself works fine.

Never figured out why it shows that error sometimes, but will have a deeper look on it. But again it works fine, even if it shows that error.

 

I'm not sure if I understood well, displayAddEventHandler have needed a return value true or false, but I applied this method on all keybinds in script, and errors disappeared from RPT log, while script calls run okay:

        PreviewAbortHotkey = (findDisplay 46) displayAddEventHandler ["KeyDown", "
            _handled = false;
            if (_this select 1 == 0x3F) then {
                PreviewLoop = false;
                (findDisplay 46) displayRemoveEventHandler ['KeyDown', PreviewAbortHotkey];
                (findDisplay 46) displayRemoveEventHandler ['KeyDown', PreviewRotateHotkey];
                (findDisplay 46) displayRemoveEventHandler ['KeyDown', PreviewZoomHotkey];
                _handled = true;
            };
            _handled
        "];
Link to comment
Share on other sites

I may have forgot to do a part but I'm sure I didn't, but basically it works perfectly fine, but when you exit it just shows a black screen, and when you press escape it shows the sky and you need to re-log to fix it, There is also no errors in my rpt log. Not sure if this is a known problem but I'm currently using Linux, so I'm not sure if that would make a difference 

 

Do u use the new Amra 2 patch maybe where the deleteVehicle function is not working? Cause it works on all of my friends servers now perfectly on 103718 beta patch.

The script waits until the preview vehicle is deleted before it goes back to player cam so maybe thats a point?

else i dont know what but, scripts work good tested it again on a vanilla epoch.

 

Yeah, it seems (some version of?) Arma 2 doesn't nulls the object out by the a deleteVehicle command.

(Probably that's why you can see the lights, the gear option or can get in/out of a sold vehicle at trader.)

 

Commenting the waitUntil lines out solves the problem and script works like a charm. :)

 

/* Wait until all is deleted */

//waitUntil {sleep 0.01; isNull previewVehicle};

 

//waitUntil {sleep 0.01; isNull previewUnit};

 

Thanks Otter for sharing this! :lol:

 

One more suggestion:

At the moment you can not preview bikes and boats, you could use this:

if (["trade_any_",_item select 9] call fnc_inString) then {

 

(_initUnit variable is not used, only defined. however, forEach playableUnits will not work for servers using infiStar AH, because playableUnits array contains only player object for players.

I didn't test it, but probably if two players are previewing skins in the same time, both agents will be visible for them.)

Link to comment
Share on other sites

 

I'm not sure if I understood well, displayAddEventHandler have needed a return value true or false, but I applied this method on all keybinds in script, and errors disappeared from RPT log, while script calls run okay:

        PreviewAbortHotkey = (findDisplay 46) displayAddEventHandler ["KeyDown", "
            _handled = false;
            if (_this select 1 == 0x3F) then {
                PreviewLoop = false;
                (findDisplay 46) displayRemoveEventHandler ['KeyDown', PreviewAbortHotkey];
                (findDisplay 46) displayRemoveEventHandler ['KeyDown', PreviewRotateHotkey];
                (findDisplay 46) displayRemoveEventHandler ['KeyDown', PreviewZoomHotkey];
                _handled = true;
            };
            _handled
        "];

Sweet found, i ever misunderstood that then ^^

I will change the files for VASP v1.3 then :)

 

Unfortunately, remapping the dikcode doesn't help, it's definitely the antihack that's blocking the preview functionality. Oh well.

Isn't infistar lgging all of the detections?

Nothing in the rpt? Would love to help but, like i mentioned earlier i dont know how and what infistar blocks :/

 

Yeah, it seems (some version of?) Arma 2 doesn't nulls the object out by the a deleteVehicle command.

(Probably that's why you can see the lights, the gear option or can get in/out of a sold vehicle at trader.)

 

Commenting the waitUntil lines out solves the problem and script works like a charm. :)

 

/* Wait until all is deleted */

//waitUntil {sleep 0.01; isNull previewVehicle};

 

//waitUntil {sleep 0.01; isNull previewUnit};

 

Thanks Otter for sharing this! :lol:

 

One more suggestion:

At the moment you can not preview bikes and boats, you could use this:

if (["trade_any_",_item select 9] call fnc_inString) then {

 

(_initUnit variable is not used, only defined. however, forEach playableUnits will not work for servers using infiStar AH, because playableUnits array contains only player object for players.

I didn't test it, but probably if two players are previewing skins in the same time, both agents will be visible for them.)

Yeah that was my thought also objects get not null on deleteVehicle command, so the script waits forever.

I just implemented the waituntil so i can get sure that on a Vehicle preview the last previewed vehicle gets deleted before a new one is spawned in on same spot.

Would cause such a nice explosion :)

I forgot to delete the _initUnit define from the last version when i used it. Will do that right now for the next version.

 

if (["trade_any_",_item select 9] call fnc_inString) then {

Good point, will do that :)

 

 

Thanks for all the feedback!

Thats what makes a good community, still learning things ^^

 

 

 

Moo,

Otter

Link to comment
Share on other sites

Do u use the new Amra 2 patch maybe where the deleteVehicle function is not working? Cause it works on all of my friends servers now perfectly on 103718 beta patch.

The script waits until the preview vehicle is deleted before it goes back to player cam so maybe thats a point?

else i dont know what but, scripts work good tested it again on a vanilla epoch.

I'm using the 1.63 beta patch on my servers 

Link to comment
Share on other sites

I'm using the 1.63 beta patch on my servers 

 

If it's the 112555 beta then the deleteVehicle function is not working.

I will upload soon the v1.3, which has the waitUntil's removed.

This should help you with the blackscreen thing, but you will need to have a look, when you make preview of a second vehicle if the first one is deleted!

Link to comment
Share on other sites

I forgot to delete the _initUnit define from the last version when i used it. Will do that right now for the next version.

 

It was a good idea to hide the agent from all other players. However it will not work for servers using infiStart Antihack, because playableUnits array contains only self player object for players.

If you make a new release you may could spawn the skin preview place randomly anywhere on the map, so there's very few chance one player can see the skin preview of another one.

 

I tried it today, and yes, all spawned skin preview agents are visible for others too.

Link to comment
Share on other sites

It was a good idea to hide the agent from all other players. However it will not work for servers using infiStart Antihack, because playableUnits array contains only self player object for players.

If you make a new release you may could spawn the skin preview place randomly anywhere on the map, so there's very few chance one player can see the skin preview of another one.

 

I tried it today, and yes, all spawned skin preview agents are visible for others too.

They are visible eachother cause i needed to change the creation of the unit, i will think about another solution.

As i dont support infistar, and never will, i dont care about if its working for infistar with the playableUnits array. Dont know why and if he is making the array just containing the player himself?

But anyway, i try to find another way...

Link to comment
Share on other sites

if i have the debugmonitor of the antihack open i guess the window with the press f5 for preview hint will not be shown? or only be shown for some milliseconds and then overwritten by the debugmonitor again?

 

maybe we can add some button to the trader menu here?

 

For infistar:

Add this above the debug moniter code above the debug moniter code for vasp

debugMonitorX = false;
Link to comment
Share on other sites

 

For infistar:

Add this above the debug moniter code above the debug moniter code for vasp

debugMonitorX = false;

 

Where would you re-trigger the debug monitor on preview close? The above works but the VASP debug stays up for a while before fading out.

Link to comment
Share on other sites

Where would you re-trigger the debug monitor on preview close? The above works but the VASP debug stays up for a while before fading out.

 

Put this after the debug moniter code

sleep 10;
debugMonitorX = true;
Link to comment
Share on other sites

I hesitated to add this to my server thinking it was going to be another time consuming effort to make this mod work for me, but thankfully it already has everything I was looking for!

 

Recorded my test with fraps, thought I would share it: http://youtu.be/N0nIY-um7E4

 

 I had a complaint by player not being able to leave the preview but I suspect it is my infiStar.. and regardless I'm sure I will figure out a way to fix it so.. Thanks for the great script!

Link to comment
Share on other sites

I hesitated to add this to my server thinking it was going to be another time consuming effort to make this mod work for me, but thankfully it already has everything I was looking for!

 

Recorded my test with fraps, thought I would share it: http://youtu.be/N0nIY-um7E4

 

 I had a complaint by player not being able to leave the preview but I suspect it is my infiStar.. and regardless I'm sure I will figure out a way to fix it so.. Thanks for the great script!

Nice testing vid :)

 

 

I'm working on a v1.3 which has a check for the bad beta version 112555 which has problems on the deleteVehicle command.

But i can barely test it as i never used that version.

 

Rolling Changelog v1.3:

  • VASP_HotKey   in the config secton, here you can set any dik_code you like to use as Preview / Preview abort  Hotkey
  • A routine to add, any Skin that is set in the AllPlayers variable in Epoch's variables.sqf also to the allowed list if someone used that variable to add more Skins also
  • Fixed the displayAddEventHandler error Error type Script, expected Bool (thanks again to Gwandoya for the finding!)
  • Fixed no preview for Ships and Motos (thanks again to Gwandoya for this line if (["trade_any_",_item select 9] call fnc_inString) then { )
  • TEST for Infistar detection and if found Skin-Preview position depends on amount of Players Previewing a Skin - Handled by a publicVariable - DebugMonitor override so the Preview-Message stays and not get overwritten by Infistar's Debug-Monitor
  • Check for beta 112555 inplemented - If found all created objects get destroyed and moved away from the Playable Map-Area - Fixes the deleteVehicle not working in that beta version

 

For all that wanna test it out:

https://www.dropbox.com/s/fn3kxhm5n92873o/VASP_v1.3.zip

 

THIS IS NOT THE FINAL v1.3 IT IS FOR TESTING ONLY!

 

If someone runs Infistar or Arma2OA beta 112555 and gimme a feedback if it's working or not, i would much appreciate it!

 

 

Moo,

Otter

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...