Jump to content
oldmatechoc

[Release] Trader Catalogue / Previews

Recommended Posts

Thanks for this! I installed it but I'm not sure it's working. What key do I press to make the catalogue appear or under what circumstances does it appear?

Thanks!

Share this post


Link to post
Share on other sites
6 hours ago, oldmatechoc said:

@Vladick
 

	if (_dikCode == 0x15) then { []execVM "scripts\catalogue\catalog_menu.sqf"; 	};	

0x15 = Y

https://community.bistudio.com/wiki/DIK_KeyCodes

@oldmatechocI thought so. Thanks for confirming. I've done something wrong in the install then and I can't figure out what it is. Can you see anything wrong with my config (below)?

1. First, I put the catalogue folder folder in the mission scripts folder.

2, I extracted the keyboard.sqf file from the dayz_code pbo into the dayz_code\compile folder and added the following at the very bottom just above _handled

:

Spoiler

//---------------------------------------------------------------- Catalogue Start
    if (_dikCode == 0x15) then { []execVM "scripts\catalogue\catalog_menu.sqf";     };    
    private ["_isBusy"];
    _isBusy = player getVariable["isBusy",false];
    if (_isBusy) then {
        if (_dikCode == 0x05) then {            
            [15,preview_bot] call fnc_rotate_bot;
            [15,vehicle_bot] call fnc_rotate_bot;
        };    
        if (_dikCode == 0x07) then {            
            [-15,preview_bot] call fnc_rotate_bot;
            [-15,vehicle_bot] call fnc_rotate_bot;
        };    
    };    
//---------------------------------------------------------------- Catalogue End

_handled

3. In init.sqf I called the keyboard.sqf this way:

Spoiler

if (!isDedicated) then {
    call compile preprocessFileLineNumbers "dayz_code\Configs\CfgServerTraderZSC\chernarus11.sqf";
    
    call compile preprocessFileLineNumbers "dayz_code\compile\keyboard.sqf";

    if (toLower worldName in ["chernarus","chernarus_winter"]) then {
        execVM "\z\addons\dayz_code\system\mission\chernarus\hideGlitchObjects.sqf";
    };

4. In compiles.sqf I added the following at the very end:

Spoiler

if (!isDedicated) then {
    diag_log "Loading custom client compiles";

    fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
    player_selectSlot = compile preprocessFileLineNumbers "dayz_code\compile\ui_selectSlot.sqf";
    locateVehicle = compile preprocessFileLineNumbers "scripts\locateVehicle.sqf";
    remoteVehicle = compile preprocessFileLineNumbers "scripts\remoteVehicle\remoteVehicle.sqf";
    local_lockUnlock = compile preprocessFileLineNumbers "dayz_code\compile\local_lockUnlock.sqf";
    
    //---------------------------------------------------------------- Catalogue Start
    weapon_preview = compile preprocessFileLineNumbers "scripts\catalogue\weapon_preview.sqf";
    vehicle_preview = compile preprocessFileLineNumbers "scripts\catalogue\vehicle_preview.sqf";
    trader_preview = compile preprocessFileLineNumbers "scripts\catalogue\trader_preview.sqf";
    fnc_rotate_bot = {
            private ["_dir","_input","_bot"];
            disableSerialization;
            _input = _this select 0;
            _bot = _this select 1;
            _dir = getDir _bot;
            _dir = _dir + _input;
            _bot setDir _dir;
        };
//---------------------------------------------------------------- Catalogue End

};

5. In variables.sqf I added this:

Spoiler

if (!isDedicated) then {
    diag_log "Loading custom client variables";
    
    weapon_preview=objNull;
    vehicle_bot=objNull;
    preview_bot=objNull;
    preview_camera = nil;
    preview_cameraPos = nil;

    dayz_resetSelfActions = {
        s_player_equip_carry = -1;
        s_player_fire = -1;
        s_player_cook = -1;
        s_player_boil = -1;
        s_player_packtent = -1;
        s_player_packtentinfected = -1;
        s_player_fillfuel = -1;
        s_player_grabflare = -1;
        s_player_removeflare = -1;
        s_player_studybody = -1;
        s_player_deleteBuild = -1;
        s_player_flipveh = -1;
        s_player_sleep = -1;
        s_player_fillfuel210 = -1;
        s_player_fillfuel20 = -1;
        s_player_fillfuel5 = -1;
        s_player_siphonfuel = -1;
        s_player_repair_crtl = -1;
        s_player_fishing = -1;
        s_player_fishing_veh = -1;
        s_player_gather = -1;
        s_player_destroytent = -1;

        // Epoch Additions
        s_player_packvault = -1;
        s_player_lockvault = -1;
        s_player_unlockvault = -1;
        s_player_attack = -1;
        s_player_callzombies = -1;
        s_player_showname = -1;
        s_player_pzombiesattack = -1;
        s_player_pzombiesvision = -1;
        s_player_pzombiesfeed = -1;
        s_player_tamedog = -1;
        s_player_parts_crtl = -1;
        s_player_movedog = -1;
        s_player_speeddog = -1;
        s_player_calldog = -1;
        s_player_feeddog = -1;
        s_player_waterdog = -1;
        s_player_staydog = -1;
        s_player_trackdog = -1;
        s_player_barkdog = -1;
        s_player_warndog = -1;
        s_player_followdog = -1;
        s_player_information = -1;
        s_player_fuelauto = -1;
        s_player_fuelauto2 = -1;
        s_player_fillgen = -1;
        s_player_upgrade_build = -1;
        s_player_maint_build = -1;
        s_player_downgrade_build = -1;
        s_player_towing = -1;
        s_halo_action = -1;
        s_player_SurrenderedGear = -1;
        s_player_maintain_area = -1;
        s_player_maintain_area_force = -1;
        s_player_maintain_area_preview = -1;
        s_player_heli_lift = -1;
        s_player_heli_detach = -1;
        s_player_lockUnlock_crtl = -1;
        s_player_lockUnlockInside_ctrl = -1;
        s_player_toggleSnap = -1;
        s_player_toggleSnapSelect = -1;
        snapActions = -1;
        s_player_plot_boundary = -1;
        s_player_plotManagement = -1;
        s_player_toggleDegree = -1;
        degreeActions = -1;
        s_player_toggleVector = -1;
        vectorActions = -1;
        s_player_manageDoor = -1;
        s_player_hide_body = -1;
        s_player_changeDoorCode = -1;
        s_player_changeVaultCode = -1;
        s_givemoney_dialog = -1;
        s_bank_dialog = -1;
        s_bank_dialog1 = -1;
        s_bank_dialog2 = -1;
        s_bank_dialog3 = -1;
        s_player_checkWallet = -1;
        s_garage_dialog = -1;
        s_player_bury_human = -1;
        s_player_butcher_human = -1;
        s_player_gdoor_opener = [];
        s_player_gdoor_opener_ctrl = -1;
        s_player_clothes = -1;    
        s_player_copyToKey = -1;
        s_player_claimVehicle = -1;        
    };
    call dayz_resetSelfActions;
};
 

6. Since I don't have a server_traders.sqf I defined the trader array in chernarus11.sqf which is being called from the init.sqf just as keyboard.sqf is. I added this to chernarus11.sqf:

Spoiler

serverTraders = ["trader_catalog","BAF_Soldier_SniperH_MTP","FR_AC","GUE_Commander","GUE_Woodlander2","RU_Citizen4","Profiteer1","Rita_Ensler_EP1","Dr_Hladik_EP1","Worker2","Villager1","TK_CIV_Worker01_EP1","CIV_EuroMan01_EP1","CIV_EuroMan02_EP1","RU_WorkWoman5","Doctor","Worker1","TK_CIV_Worker02_EP1","Rocker4","RU_Citizen3","RU_WorkWoman1","Dr_Annie_Baker_EP1","Worker3","RU_Pilot","RU_Villager3","HouseWife1","Profiteer2","Profiteer3","Functionary1_EP1"];

6. And this at the bottom of chernarus11.sqf:

Spoiler

menu_trader_catalog= [
    [
//Start of categories
        [ "BLACKMARKET",11],
        [ "ATTACHMENTS",12],
        [ "PISTOLS",13],
        [ "SUB MACHINE GUNS",14],
        [ "SINGLESHOT",15],
        [ "ASSAULT RIFLES",16],
        [ "SNIPER RIFLES",17],
        [ "LIGHT MACHINE GUNS",18],
        [ "PISTOL AMMO",19],
        [ "SUB MACHINEGUN AMMO",20],
        [ "SINGLE SHOT AMMO",21],
        [ "ASSAULT RIFLE AMMO",22],
        [ "SNIPER RIFLE AMMO",23],
        [ "LIGHT MACHINEGUN AMMO",24],
        [ "PACKAGEFOOD",27],
        [ "COOKMEAT",28],
        [ "DRINKS",29],
        [ "CLOTHES",30],
        [ "BACKPACKS",31],
        [ "MISCELLANEOUS",32],
        [ "MEDICAL SUPPLIES",33],
        [ "SMOKE GRENADES",25],
        [ "FLARES",26],
        [ "TOOLS",34],
        [ "BUILDING SUPPLIES",35],
        [ "VEHICLE PARTS",36],
        [ "BIKES ATVS",37],
        [ "CARS",38],
        [ "PICKUPS",39],
        [ "UAZS",40],
        [ "SUVS",41],
        [ "CARGO TRUCKS",42],
        [ "FUEL TRUCKS",43],
        [ "MILITARY UNARMED",44],
        [ "MISCELLANEOUS VEHICLES",45],
        [ "BOATS ARMED",48],
        [ "BOATS UNARMED",49],
        [ "AIRPLANES",46],
        [ "HELICOPTER",47]
//End of categories
    ],
    [],
    "neutral"
];

7. Finally, in description.ext I added this at the very bottom:

Spoiler

#include "scripts\catalogue\chx_defines.hpp" 
#include "scripts\catalogue\chx_catalog.hpp" 

Do you see anything wrong with this config? I assume it's probably broken because I'm using chernarus11.sqf instead of server_traders.sqf but I don't have a server_traders.sqf and did not find one in any of my folders. Any ideas how I can make this work? Thanks for your help!

Share this post


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

@Vladick
Looks like you havent redirected the custom keyboard.sqf In your compiles correctly.

 

add

DZ_KeyDown_EH = compile preprocessFileLineNumbers "path_to your\keyboard.sqf";


some where under
 

if (!isDedicated) then {

in your compiles.sqf

@oldmatechocThat did it! Thanks so much for your help!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...