Jump to content

ViktorReznov

Member
  • Content count

    119
  • Joined

  • Last visited

2 Followers

About ViktorReznov

  • Rank
    Hardened

Recent Profile Visitors

328 profile views
  1. Would so be worth it tho... Maybe hook it into your vehicle key changer dialog anyways? Can't wait to have my comp back, month and a half later....
  2. Positions

    So, looking through code and trying to learn what things are and in spawning them, ive come acrossed a variable I cannot figure out what it is For example ["hiluxWreck",[11689.701,3422.4888,1.001358e-005],-99.812798], class, posX, posY, posZ and ????? What is that fourth var?
  3. [Release] Virtual Garage for 1.0.6.1+

    BEEN WAITING FOR THIS!
  4. What order did you add the lines: #include "custom\Buildables\MT_Defines.hpp" #include "custom\Buildables\Crafting_Defines.hpp" #include "custom\Buildables\Crafting_Dialogs.hpp" to your description.ext? the reasone being: RscFrame is defined in Crafting_Defines, if you have it defined after Crafting_dialog which needs the class RscFrame, then it will kick back that error. My bet is it is the order you have them defined
  5. Global variables

    when you use a count, it counts in whole numbers and starts with 1 correct? so would we have to modify the count by -1 in order for it to return the proper array value which starts with 0? Using arrays is still really new to me (at least understanding this whole select and stuff) EDIT: Disregard, yes, arrays start at zero and count just counts. but the random of the count will still produce ((count) -1) and random will be a value 0 to ((count) -1) Now this I am happy with if !(isDedicated) exitWith {}; //if not a server then EFF this code // stock prices DZE_buyMult = 1; //initialize at stock DZE_sellMult = 1; //initialize at stock publicVariable "DZE_buyMult"; //sync variable with client and server publicVariable "DZE_sellMult"; //sync variable with client and server diag_log format["[ECONOMY] Initialization of Economy! ~You Buy %1 Percent, You Sell %2 Percent", (DZE_buyMult * 100), (DZE_sellMult * 100)]; while {true} do { //while true so basically == always run script loop except for that sleep down there _multArray = [ //array to hold values and keep the scaling of the market [2.0,0.5], //select 0 [BuyMult,SellMult] = select 0, select 1 [1.9,0.6], //select 1 [1.8,0.7], //select 2 [1.6,0.8], //select 3 [1.5,0.9], //select 4 [1.4,1.1], //select 5 [1.2,1.2], //select 6 [0.9,1.3], //select 7 [0.8,1.4], //select 8 [0.7,1.5], //select 9 [2.5,1.0], //select 10 [0.7,2.0] //select 11 ]; _rand = random(count _multArray); //just generate our random var which will count the number of arrays in _multArray and pull a random from it _sleep = 1800; //30 min sleep cycle _time = diag_tickTime; //track server time DZE_buyMult = (_multArray select _rand) select 0; //in theory will select array value of _rand, buyMult DZE_sellMult = (_multArray select _rand) select 1; //in theory will select array value of _rand, sellMult publicVariable "DZE_buyMult"; //sync variable with client and server publicVariable "DZE_sellMult"; //sync variable with client and server [nil,nil,rTitleText,"Prices have changed! Check out the sweet deals NOW!", "PLAIN",10] call RE; diag_log format["[ECONOMY] Price Change Using Economy! ~You Buy %1 Percent, You Sell %2 Percent", (DZE_buyMult * 100), (DZE_sellMult * 100)]; waitUntil{sleep 1;diag_tickTime >= (_time + _sleep)}; //stop script until new time reached };
  6. Global variables

    alright, trying something new inspired by @TheVampire. I love the code you showed but kinda broke my idea of a scaling price of supply vs demand sort of thing. However, using some ideas from your code to try something new and Im curious about if it will work (im going to test anyways but im looking for the logic behind the reasons for the ensuing answers) Thanks again so much everybody! EDIT: This works, ofcourse only after i changed my strings to integers *facepalm*
  7. omg! was so tired when i posted that last night...
  8. Global variables

    Got it, the final bit of secret..... when someone suggests to use a bit of code you are unfamiliar with.... GO READ IT! Read up on publicVariables and learned that you have to set it as a publicVariable AFTER you change it each time otherwise it doesnt update completed code (has to be a way to write this better but for now, this works)
  9. Global variables

    Well, we are getting there, this was my latest error free report "[ECONOMY] Using Economy, pre initialization of Economy! ~You Buy 100 Percent, You Sell 100 Percent" "[ECONOMY] Using Economy, pre initialization of Economy! ~You Buy 100 Percent, You Sell 100 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 90 Percent, You Sell 130 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 250 Percent, You Sell 100 Percent" "[ECONOMY] Using Economy, pre initialization of Economy! ~You Buy 250 Percent, You Sell 100 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 160 Percent, You Sell 80 Percent" "[ECONOMY] Using Economy, pre initialization of Economy! ~You Buy 160 Percent, You Sell 80 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 120 Percent, You Sell 120 Percent" "[ECONOMY] Using Economy, pre initialization of Economy! ~You Buy 120 Percent, You Sell 120 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 80 Percent, You Sell 140 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 80 Percent, You Sell 140 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 70 Percent, You Sell 200 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 140 Percent, You Sell 110 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 140 Percent, You Sell 110 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 140 Percent, You Sell 110 Percent" "[ECONOMY] Using Economy, pre initialization of Economy! ~You Buy 140 Percent, You Sell 110 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 140 Percent, You Sell 110 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 190 Percent, You Sell 60 Percent" "[ECONOMY] Using Economy, pre initialization of Economy! ~You Buy 190 Percent, You Sell 60 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 90 Percent, You Sell 130 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 120 Percent, You Sell 120 Percent" "[ECONOMY] Using Economy, pre initialization of Economy! ~You Buy 120 Percent, You Sell 120 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 250 Percent, You Sell 100 Percent" "[ECONOMY] Price Change Using Economy! ~You Buy 180 Percent, You Sell 70 Percent" every time you see preInitialization, its my function calling and firing, then it changes the mults. Everytime i was executing the trader script it would do this. I currently have this in my advancedTrading\init.sqf _adv_economyFluc = [] execVM "dayz_code\actions\AdvancedTrading\functions\adv_econFluc.sqf"; i just changed it to this if (isNile "DZE_ecoMult") then { _adv_economyFluc = [] execVM "dayz_code\actions\AdvancedTrading\functions\adv_econFluc.sqf"; }; in hopes i can stop the fluctuation from firing everytime a player activates the trader. It may fire for each player individually, it may not, im not too sure and i dont have a player base to test it. however, it was successfully modifying the mults and prices reflected this so its getting closer. EDIT: Yep, that stopped it from firing everytime the player used the trader. If I move it to init.sqf, and place it in the if (isServer) block, it should start with server launch correct? and with the publicVariable it should be synced to all clients? if i am understanding this correctly?
  10. Global variables

    So running into trouble understanding how to execute this properly. If Im understanding properly, im executing this function diag_log format["[ECONOMY] Using Economy, pre initialization of Economy! ~You Buy %1 Percent, You Sell %2 Percent", (DZE_buyMult * 100), (DZE_sellMult * 100)]; fn_fluctuating = { DZE_ecoMult = (round(random 12)); publicVariable "DZE_ecoMult"; switch (DZE_ecoMult) do { case 0: {DZE_buyMult = 2; DZE_sellMult = 0.5;}; case 1: {DZE_buyMult = 1.9; DZE_sellMult = 0.6;}; case 2: {DZE_buyMult = 1.8; DZE_sellMult = 0.7;}; case 3: {DZE_buyMult = 1.6; DZE_sellMult = 0.8;}; case 4: {DZE_buyMult = 1.5; DZE_sellMult = 0.9;}; case 5: {DZE_buyMult = 1.4; DZE_sellMult = 1.1;}; case 6: {DZE_buyMult = 1.2; DZE_sellMult = 1.2;}; case 7: {DZE_buyMult = 0.9; DZE_sellMult = 1.3;}; case 8: {DZE_buyMult = 0.8; DZE_sellMult = 1.4;}; case 9: {DZE_buyMult = 0.7; DZE_sellMult = 1.5;}; case 10: {DZE_buyMult = 2.5; DZE_sellMult = 1;}; //wildcard! bad day to be buying.... case 11: {DZE_buyMult = 0.7; DZE_sellMult = 2;}; //wildcard! MO MONEY! }; [nil,nil,rTitleText,"Prices have changed! Check out the sweet deals NOW!", "PLAIN",10] call RE; diag_log format["[ECONOMY] Price Change Using Economy! ~You Buy %1 Percent, You Sell %2 Percent", (DZE_buyMult * 100), (DZE_sellMult * 100)]; }; waituntil {(round(time)) > 300}; call fn_fluctuating; waituntil {(round(time)) > 400}; call fn_fluctuating; waituntil {(round(time)) > 500}; call fn_fluctuating; waituntil {(round(time)) > 600}; call fn_fluctuating; from its install location in \z\addons\dayz_server\init\ and calling for it like so _adv_economyFluc = [] execVM \z\addons\dayz_server\init\adv_economyFluc.sqf"; which is placed at the bottom of server_function.sqf Meanwhile, ive removed all other calls for the mults from all other files with exception to the files that actually call for the mults. I then added call fn_fluctuating near the top of advancedTrading\init.sqf hoping it would execute and call and set the variables. I wont lie, i am very lost here however, I am very appreciative of the support and input!
  11. Alright! Got it finally, a simple toggle for lights, makes it a hell of a lot easier to find at night! add this to the bottom of remoteVehicle.sqf if (_option == 5) then { if (_vehicle getVariable["lightOff",true]) then { player action ["lightOn", _vehicle]; systemChat format ["Lights on %1", _vehicleType]; _vehicle setVariable ["lightOn",true]; _vehicle setVariable ["lightOff",false]; } else { player action ["lightOff", _vehicle]; systemChat format ["Lights off %1", _vehicleType]; _vehicle setVariable ["lightOn",false]; _vehicle setVariable ["lightOff",true]; }; }; and add this to the bottom of your click_actions\config.sqf DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["ItemKey","Toggle Lights","spawn remoteVehicle;","true",5]]; id submit a pull request @salival but i leave it to you m8!
  12. I was thinking something similar except add the action to a cargo truck and have the script check the inventory of vehicle for parts, carry more and craft more all at once!
  13. Global variables

    So to clarify a little further on my issue. I would set the variable in my init.sqf if (isNil "DZE_ecoMult") then { DZE_ecoMult = (round(random 12)); }; This way, it would only run once ( a work around I was using to stop the desync between client and server). Then in my if (isServer) block _adv_economyFluc = [] execVM "scripts\adv_economyFluc.sqf"; which would then call this script Will take a quick moment: Changes: fn_selfActions redirect advanced trading call to new advancedtrading_init.sqf modified advancedtrading\init.sqf with if (isNil "DZE_ecoMult") then { DZE_buyMult = 1; DZE_sellMult = 1; }; switch (DZE_ecoMult) do { case 0: {DZE_buyMult = 2; DZE_sellMult = 0.5;}; case 1: {DZE_buyMult = 1.9; DZE_sellMult = 0.6;}; case 2: {DZE_buyMult = 1.8; DZE_sellMult = 0.7;}; case 3: {DZE_buyMult = 1.6; DZE_sellMult = 0.8;}; case 4: {DZE_buyMult = 1.5; DZE_sellMult = 0.9;}; case 5: {DZE_buyMult = 1.4; DZE_sellMult = 1.1;}; case 6: {DZE_buyMult = 1.2; DZE_sellMult = 1.2;}; case 7: {DZE_buyMult = 0.9; DZE_sellMult = 1.3;}; case 8: {DZE_buyMult = 0.8; DZE_sellMult = 1.4;}; case 9: {DZE_buyMult = 0.7; DZE_sellMult = 1.5;}; case 10:{DZE_buyMult = 2.5; DZE_sellMult = 1;}; //wildcard! case 11:{DZE_buyMult = 0.9; DZE_sellMult = 2;}; //wildcard! }; diag_log Format["[ECONOMY] You Buy %1 Percent, You Sell %2 Percent",(DZE_buyMult * 100), (DZE_sellMult * 100)]; modified 7 files in custom dayz_code\actions\advancedTrading\functions\: z_at_buyItems, z_at_calcPrice, z_at_displayBackpackInfo, z_at_displayItemInfo, z_at_displayVehicleInfo, z_at_displayWeaponInfo, z_at_sellItems Those 7 files only include modification to the prices with DZE_buyMult or DZE_sellMult respectively.
  14. Global variables

    So i have quite the conundrum, this is in relation to the script tweak i put out, and the question is: What all can I do with globals? Are they static once they have been set? Can they be altered after server start? Can I modify a global variable anytime I want during server uptime? I have defined three variables (global) in a total of 7 files in order to get my code to function. Ill go ahead and break it down here so that I can get an accurate answer and possibly figure this out. The last gentlemen to help me with this helped me blindly without fully understanding what I modified so I never discoverd if it is possible to do what Id like to. (i appreciate all of the good sir's help and hopefully this post here will get the answers needed!) The three variables are DZE_ecoMult, DZE_buyMult and DZE_sellMult. I initialize the ecoMult in init.sqf with = (round(random 12)) to give a value between 0 and 11. This value then uses a switch case to modify the buy/sellMults which are then coded to modify the prices of the traders. What Id like to do, and havent been able to succeed in doing, is modify the buy/sellMults by modifying the ecoMult say every hour of server up time. I however, couldnt get it to do this. Would I have to de-globalize my globals in order to do this? OR can i keep them global and modify them? I do not quite understand the nature of the global....
×