1. Dashboard
  2. Forum
    1. Unerledigte Themen
  3. Downloads
  4. Galerie
    1. Alben
  5. Toolbox
    1. Passwort Generator
    2. Portchecker
  6. Mitglieder
    1. Mitgliedersuche
    2. Benutzer online
    3. Trophäen
    4. Team
Mi: 21 Mai 2025
  • Anmelden oder registrieren
  • Suche
Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Forum
  • Dateien
  • Seiten
  • Bilder
  • Erweiterte Suche

Schön, dass du den Weg zu NodeZone.net gefunden hast! Aktuell bist du nicht angemeldet und kannst deshalb nur eingeschränkt auf unsere Community zugreifen. Um alle Funktionen freizuschalten, spannende Inhalte zu entdecken und dich aktiv einzubringen, registriere dich jetzt kostenlos oder melde dich mit deinem Account an.

Anmelden oder registrieren
    1. Nodezone.net Community
    2. Forum
    3. Gameserver & Hosting
    4. ArmA Series - ArmA 3 / Reforger
    5. Hilfeforum

    5.0 Dyn Marktsystem Erkennt Unterpreisgrenze nicht und Fällt dauernd auf 0

    • HN Alosius Black
    • 18. Juli 2018 um 14:06
    • Erledigt
    • HN Alosius Black
      Frischling
      Reaktionen
      3
      Trophäen
      7
      Beiträge
      8
      • 18. Juli 2018 um 14:06
      • #1

      Hi Zusammen ich sitze Bereits seit 2 Wochen am Einrichten unseres Marktsystems allerdings Fällt beim verkauf der Preis Dauernd auf 0 Obwohl eine Mingrenze eingestellt ist

      Ein Auszug aus der core/market/fn_marketconfiguration.sqf

      Code
      /*
      
          Main configuration for non-persistent market system
          Will need triggers to hook into vanilla pricing methods
      
      */
      
          //Schema: SHORTNAME, Default, Min, Max, changes in action, [Sales multiplied by 1, Purchase multiplied by -1]
          //["gold", 1500, 450, 2300, 8, 5],
      
      ////////////MAIN CONFIG
      
      life_market_resources = [
          
          // Default İsler
          
          ["oil_processed", 400, 275, 650, 1, 2, 
              [ 
                  ["diamond_cut",1], 
                  ["iron_refined",1],
                  ["copper_refined",1],
                  ["gold_refined",1],
                  ["cement",1],
                  ["glass",1] 
              ] 
          ],
          
          ["diamond_cut", 750, 345, 1000, 1, 2, 
              [ 
                  ["oil_processed",1],
                  ["iron_refined",1],
                  ["copper_refined",1],
                  ["gold_refined",1],
                  ["salt_refined",1],
                  ["cement",1],
                  ["glass",1] 
              ] 
          ],
          
          ["copper_refined", 350, 155, 550, 1, 1, 
              [ 
                  ["diamond_cut",1], 
                  ["oil_processed",1],
                  ["iron_refined",1],
                  ["gold_refined",1],
                  ["cement",1],
                  ["glass",1] 
              ] 
          ],
          
          ["iron_refined", 450, 175, 650, 1, 1,  
              [ 
                  ["diamond_cut",1], 
                  ["oil_processed",1],
                  ["copper_refined",1],
                  ["gold_refined",1],
                  ["salt_refined",1],
                  ["cement",1],
                  ["glass",1] 
              ] 
          ],
          
          ["salt_refined", 200, 100, 350, 1, 1, 
              [ 
      
                  ["copper_refined",1],
                  ["gold_refined",1],
                  ["glass",1] 
              ] 
          ],
          
          ["glass", 300, 190, 500, 1, 1, 
              [ 
                  ["diamond_cut",1], 
                  ["oil_processed",1],
                  ["iron_refined",1],
                  ["copper_refined",1]
              ] 
          ],
          
          ["cement", 380, 180, 480, 1, 1, 
              [ 
      
                  ["oil_processed",1],
                  ["iron_refined",1],
                  ["copper_refined",1],
                  ["glass",1]
              ] 
          ],
          
          ["goldbar", 1, 0, 2, 2, 1, 
              [ 
                  ["diamond_cut",1], 
                  ["oil_processed",1],
                  ["iron_refined",1],
                  ["copper_refined",1],
                  ["glass",1]
              ] 
          ],
          
          ["marijuana", 500, 250, 850, 3, 5,   
              [ 
                  ["cocaine_processed",1],
                  ["heroin_processed",1]
              ] 
          ],
      
          ["cocaine_processed", 650, 390, 950, 3, 5,   
              [ 
                  ["marijuana",1], 
                  ["heroin_processed",1]
              ] 
          ],
              
          ["heroin_processed", 850, 420, 1000, 3, 5,   
              [ 
                  ["marijuana",1], 
                  ["cocaine_processed",1]
              ] 
          ]
      ];
      publicVariable "life_market_resources";
      
      ////////////GENERATED CONFIG
      //life_market_changes = []; //[SHORTNAME,SELL,BUY]
      life_market_shortnames = []; //shortnames if in market
      //life_market_clampprices = []; //[SHORTNAME,MIN,MAX]
      
      {
          life_market_shortnames set [count life_market_shortnames, _x select 0];
          //life_market_clampprices set [count life_market_clampprices, [_x select 0, _x select 2, _x select 3] ];
          //life_market_changes set [count life_market_changes, [_x select 0, _x select 4, _x select 5] ];
      }
      foreach life_market_resources;
      
      publicVariable "life_market_shortnames";
      //publicVariable "life_market_clampprices";
      
      ////////////SYNC PRICES WITH SERVER IF EMPTY
      //if(isNil("life_market_prices")) then
      //{
          life_market_prices = []; //[SHORTNAME,CURRENTPRICE,DIRECTIONGLOBAL,DIRECTIONLOCAL]
          {
          
              life_market_prices set [count life_market_prices, [_x select 0, _x select 1, 0, 0] ];
          }
          foreach life_market_resources;
          
          publicVariable "life_market_prices";
          
          systemChat "Market Prices Generated!";
      //};
      Alles anzeigen

      Und hier aus der core/market/fn_marketChange.sqf

      Hier habe ich Allerdings nichts Geändert da ich da nicht durchblicke

      Code
      #include "..\..\script_macros.hpp"
      /*
      
          Some random and dynamical stuff for market
      
      */
      
      private["_rand","_modifier","_price", "_globalchange","_defaultprice","_shortname","_difference"];
      
      _rand = [0,200] call life_fnc_randomRound; //0-200
      
      /*
      
          HINWEIS: obige Zahl in random erhöhen, um alle ereignisse seltener zu machen!
          
      */
      
      diag_log "[MARKET] marketChange called.";
      
      switch(true) do
      {
          case (_rand <= 30): //30% default market change value (strong version)
          {
              {
                  if(random(10) <= 4) then //Random for each resource
                  {
                      /*_price = _x select 1;
                      _globalchange = _x select 2;*/
                      
                      _modifier = [-20,20] call life_fnc_randomRound; //Verkaufte/Gekaufte Items
                      /*_modifier = _price * _modifier;
                      
                      _price = _price + _modifier;
                      _globalchange = _globalchange + _modifier;
                      
                      life_market_prices set [_forEachIndex, [_x select 0, _price, _globalchange, _modifier] ];*/
                      
                      if(_modifier < 0) then
                      {
                          [_x select 0, -(_modifier), true] call life_fnc_marketSell; 
                      }
                      else
                      {
                          [_x select 0, _modifier, true] call life_fnc_marketBuy; 
                      };
                  };
              }
              foreach life_market_prices;
          };
          case (_rand <= 36): //6% Drogenpreis erhöhen
          {
              [0,format["News: drugs prices increased."]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
              
              //Erhöhe Marktpreis mit marketSell
              ["marijuana", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              ["cocaine_unprocessed", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              ["cocaine_processed", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              ["heroin_unprocessed", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              ["heroin_processed", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              
              diag_log "+Market+ Event drugp";
          };
          case (_rand <= 44): //8% Ölpreis erhöhen
          {
              [0,format["News: oil processed price increased."]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
              
              ["oil_processed", [20,40] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              
              diag_log "+Market+ Event oilp";
          };
          case (_rand <= 54): //10% Eisenpreis + zementpreis + glaspreis erhöhen
          {
              [0,format["News: cement-ironrefined-glass prices increased."]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
              
              ["cement", [20,40] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              ["iron_refined", [20,30] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              ["glass", [25,35] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              
              diag_log "+Market+ Event wcc";
          };
          case (_rand <= 60): //4% Goldpreis sinkt
          {
              [0,format["News: goldbar price decreased."]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
              
              ["goldbar", [15,30] call life_fnc_randomRound, true] call life_fnc_marketSell; 
              
              diag_log "+Market+ Event goldm";
          };
          case (_rand <= 68): //8% Kupfer/Silber erhöht sich
          {
              [0,format["News: goldbar - copper refined prices increased."]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
              
              ["goldbar", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              ["copper_refined", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              diag_log "+Market+ Event copperp";
          };
          case (_rand <= 74): //6% Goldpreis erhöht sich
          {
              [0,format["News: goldbar price increased."]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
              
              ["goldbar", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy; 
              
              diag_log "+Market+ Event goldp";
          };
          case (_rand <= 80): //6% Drogenpreis niedriger
          {
              [0,format["News: drugs prices decreased"]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
              
              //Erhöhe Marktpreis mit marketSell
              ["marijuana", [15,30] call life_fnc_randomRound, true] call life_fnc_marketSell; 
              ["cocaine_unprocessed", [15,30] call life_fnc_randomRound, true] call life_fnc_marketSell; 
              ["cocaine_processed", [15,30] call life_fnc_randomRound, true] call life_fnc_marketSell; 
              ["heroin_unprocessed", [15,30] call life_fnc_randomRound, true] call life_fnc_marketSell; 
              ["heroin_processed", [15,30] call life_fnc_randomRound, true] call life_fnc_marketSell; 
              
              diag_log "+Market+ Event drugm";
          };
          case (_rand <= 90): //10% Schildkröten höher
          {
              [0,format["News: example items prices increased"]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
              
              //Erhöhe Marktpreis mit marketSell
              ["exampleitem", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy;     
              ["exampleitem", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy;     
              ["exampleitem", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy;     
              ["exampleitem", [15,30] call life_fnc_randomRound, true] call life_fnc_marketBuy;     
              
              diag_log "+Market+ Event exampleitem";
          };
          default //market change: default version
          {
              //diag_log format["[MARKET] marketChange did nothing. Rand=%1", _rand];
              {
                  //Get default price
                  _defaultprice = 0;
                  _shortname = _x select 0;
                  _price = _x select 1;
                  _globalchange = _x select 2;
              
                  {
                      if((_x select 0) == _shortname) exitWith
                      {
                          _defaultprice = _x select 1;
                      };
                  }
                  foreach life_market_resources;
                  
                  if(_defaultprice > 0) then
                  {
                  
                      //Get difference
                      _difference = _defaultprice - _price; //Defaultprice - current price
                  
                      _modifier = _difference * (random 0.4);
                      _modifier = round _modifier;
                  
                      //Protecting hard caps
                      /*if( _modifier < -700) then {_modifier = -700;};
                      if( _modifier > 700) then {_modifier = 700;};*/
                  
                      //_modifier = [-15,25] call life_fnc_randomRound; //Verkaufte/Gekaufte Items
                      
                      /*if(_modifier < 0) then
                      {
                          [_x select 0, -(_modifier), true] call life_fnc_marketSell; 
                      }
                      else
                      {
                          [_x select 0, _modifier, true] call life_fnc_marketBuy; 
                      };*/
                      
                      diag_log format["+Market+ Correcting market value of %1 from %2 to %3 by %4", _shortname, _price, (_price + _modifier), _modifier];
                      
                      _price = _price + _modifier;
                      _globalchange = _globalchange + _modifier;
                      
                      
                      
                      //New price arr
                      life_market_prices set [_forEachIndex, [_shortname, _price,_globalchange,_modifier] ]; //set raw values
                  
                  }
                  else
                  {
                      diag_log format["+Market+ Cannot correct market value of %1", _shortname];
                  };
              }
              foreach life_market_prices;
          };
      };
      
      publicVariable "life_market_prices";
      Alles anzeigen

      Wenn sich jemand mit dem Script auskennt wäre wirklich Bombe

    • Virus_
      Anfänger
      Reaktionen
      10
      Trophäen
      9
      Beiträge
      63
      • 18. Juli 2018 um 18:10
      • #2

      Im ersten Skript sind einige Sachen auskommentiert. Unter anderem die Erstellung eines Arrays aus den "Config"-Infos, wo minimale und maximale Werte übernommen werden sollten.

      Im zweiten Skript wird darauf auch gar nicht eingegangen. Da gibt es keine Berücksichtigung dieser Werte. Eventuell in den Funktionen life_fnc_marketBuy oder life_fnc_marketSell, aber in dem, was du uns zur Durchsicht gegeben hast, werden diese Werte an keiner Stelle verarbeitet.

    • HN Alosius Black
      Frischling
      Reaktionen
      3
      Trophäen
      7
      Beiträge
      8
      • 19. Juli 2018 um 18:57
      • #3

      Wo ist denn im Ersten Script etwas Auskommentiert irgendwie seh ich das nicht oder es ist zu Offensichtlich das ich gerade zu Kompliziert denke / Suche


      Ok Hier mal unsere fn_marketBuy.sqf

      Code
      /*
      
          Buy [SHORTNAME, AMOUNT, israw, send?]
      
      */
      
      private["_shortname","_amount","_price","_modifier","_globalprice","_min","_dir","_israw","_arr_resource","_arr_price","_modifier","_send","_relamount","_max"];
      
      _shortname = _this select 0;
      _amount = _this select 1;
      _israw = [_this, 2, false] call BIS_fnc_param;
      _send = [_this, 3, true] call BIS_fnc_param;
      
      //Get all necessary arrays
      _arr_resource = [_shortname] call life_fnc_marketGetRow;
      _arr_price = [_shortname] call life_fnc_marketGetPriceRow;
      
      //Calculate the new price of the product
      _price = _arr_price select 1; //current price
      _globalprice = _arr_price select 2; //current change rate
      
      _modifier = (_amount * (_arr_resource select 5)); //calculate modifier
      
      _price = _price + _modifier;
      _globalprice = _globalprice + _modifier;
      
      //Check borders
      if(_price < 0) then {_price = 0;};
      
      _max = _arr_resource select 3;
      
      if( _price > _max)then {_price = _max;};
      
      //insert into new array
      [_shortname, [_shortname,_price,_globalprice,_modifier], false ] call life_fnc_marketSetPriceRow; //dont broadcast!
      
      
      /////Change related prices
      if(!_israw) then
      {
          {
              _relamount = ceil (_amount * (_x select 1));
              if(_relamount < 0) then //INVERTED!
              {
                  _relamount = -(_relamount);
                  [_x select 0, _relamount, true, false] call life_fnc_marketBuy; //Make prices higher, no broadcast!
              }
              else
              {
                  [_x select 0, _relamount, true, false] call life_fnc_marketSell; //Make prices higher, no broadcast!
              };
          }
          foreach (_arr_resource select 6); //in change array
      };
      
      //Broadcast now if can send
       if(_send) then {publicVariable "life_market_prices";};
      Alles anzeigen

      Und unsere fn_marketSell.sqf

      Code
      /*
      
          Sell [SHORTNAME, AMOUNT, israw, send?]
      
      */
      
      private["_shortname","_amount","_price","_modifier","_globalprice","_min","_dir","_israw","_arr_resource","_arr_price","_modifier","_send","_relamount","_max"];
      
      _shortname = _this select 0;
      _amount = _this select 1;
      _israw = [_this, 2, false] call BIS_fnc_param;
      _send = [_this, 3, true] call BIS_fnc_param;
      
      //Get all necessary arrays
      _arr_resource = [_shortname] call life_fnc_marketGetRow;
      _arr_price = [_shortname] call life_fnc_marketGetPriceRow;
      
      //Calculate the new price of the product
      _price = _arr_price select 1; //current price
      _globalprice = _arr_price select 2; //current change rate
      
      _modifier = (_amount * (_arr_resource select 4)); //calculate modifier
      
      _price = _price - _modifier;
      _globalprice = _globalprice - _modifier;
      
      //Check borders
      if(_price < 0) then {_price = 0;};
      
      _min = _arr_resource select 2;
      
      if( _price < _min)then {_price = _min;};
      
      //insert into new array
      [_shortname, [_shortname,_price,_globalprice,-(_modifier)], false ] call life_fnc_marketSetPriceRow; //dont broadcast!
      
      
      /////Change related prices
      if(!_israw) then
      {
          {
              if((count _x) == 2) then
              {
                  _relamount = ceil (_amount * (_x select 1));
              
                  if(_relamount > 0) then
                  {
                  [_x select 0, _relamount, true, false] call life_fnc_marketBuy; //Make prices higher, no broadcast!
                  }
                  else
                  {
                  _relamount = -(_relamount);
                  [_x select 0, _relamount, true, false] call life_fnc_marketSell; //Make prices higher, no broadcast!
                  };
              }
              else
              {
                  
              };
              
          }
          foreach (_arr_resource select 6); //in change array
      };
      
      //Broadcast now if can send
       if(_send) then {publicVariable "life_market_prices";};
      Alles anzeigen
    • HN Alosius Black
      Frischling
      Reaktionen
      3
      Trophäen
      7
      Beiträge
      8
      • 19. Juli 2018 um 19:07
      • #4

      Ah Okay jetz seh ichs *Selbst gegen die Stirnhau* Also müsste ich eigentlich nur unter

      ////////////GENERATED CONFIG

      x

      x

      x

      x

      Die // wieder Entfernen und dann sollte es gehen ?

    • Virus_
      Anfänger
      Reaktionen
      10
      Trophäen
      9
      Beiträge
      63
      • 19. Juli 2018 um 19:38
      • #5

      joa so wie das aussieht könnte es reichen:

      Code
      ////////////GENERATED CONFIG
      //life_market_changes = []; //[SHORTNAME,SELL,BUY]
      life_market_shortnames = []; //shortnames if in market
      life_market_clampprices = []; //[SHORTNAME,MIN,MAX]
      {
       life_market_shortnames set [count life_market_shortnames, _x select 0];
       life_market_clampprices set [count life_market_clampprices, [_x select 0, _x select 2, _x select 3] ];
       //life_market_changes set [count life_market_changes, [_x select 0, _x select 4, _x select 5] ];
      }
      foreach life_market_resources;
      publicVariable "life_market_shortnames";
      publicVariable "life_market_clampprices";
      Alles anzeigen

      Dann mal testen. Eventuell reicht das auch noch nicht. Dazu müsste man noch schauen, wie life_fnc_marketGetRow innerlich aussieht. Aber kannst ja erstmal testen. Und bitte sicher stellen, dass im Log keine Fehler sind. Sonst suchen wir hier unnötig Logiksachen, wenn es eventuell Syntaxprobleme gibt.

    • HN Alosius Black
      Frischling
      Reaktionen
      3
      Trophäen
      7
      Beiträge
      8
      • 19. Juli 2018 um 22:45
      • #6

      also was den Markt betrifft sind keine Fehler in den Logs ich werde es mal testen und Morgen Rückmeldung geben

      Da sehe ich eigentlich nichts wirklich unaufälliges fn_marketGetRow.sqf

      Code
      /*
      
          [MARKET-ROW] marketGetModifiers [SHORTNAME];
      
      */
      
      private["_ret","_shortname"];
      
      _shortname = _this select 0;
      _ret = [];
      
      {
          if((_x select 0) == _shortname) exitWith
          {
              _ret = _x;
          };
      }
      foreach life_market_resources;
      
      _ret;
      Alles anzeigen

    Registrieren oder Einloggen

    Du bist noch kein Mitglied von NodeZone.net? Registriere dich kostenlos und werde Teil einer großartigen Community!

    Registrieren

    Benutzer online in diesem Thema

    • 1 Besucher

    Wichtige Links & Informationen

    Server & Hosting-Ressourcen

      Server Administration & Hosting Basics

      Windows Server Support & Guides

      Linux Server Configuration & Help

      Setting up TeamSpeak 3 & VoIP Servers

      Domains & Web Hosting for Beginners & Professionals

      Cloud Hosting, Docker & Kubernetes Tutorials

    Gameserver & Modding-Ressourcen

      ArmA 3 Tutorials & Script Collection

      Renting & Operating Gameservers

      DayZ Server Management & Help

      FiveM (GTA V) Server & Script Development

      Rust Server Modding & Administration

      Setting up & Optimizing ARK Survival Servers

    NodeZone.net – Deine Community für Gameserver, Server-Hosting & Modding

      NodeZone.net ist dein Forum für Gameserver-Hosting, Rootserver, vServer, Webhosting und Modding. Seit 2015 bietet unsere Community eine zentrale Anlaufstelle für Server-Admins, Gamer und Technikbegeisterte, die sich über Server-Management, Hosting-Lösungen und Spielemodding austauschen möchten.


      Ob Anleitungen für eigene Gameserver, Hilfe bei Root- und vServer-Konfigurationen oder Tipps zu Modding & Scripting – bei uns findest du fundiertes Wissen und praxisnahe Tutorials. Mit einer stetig wachsenden Community findest du hier Antworten auf deine Fragen, Projektpartner und Gleichgesinnte für deine Gaming- und Serverprojekte. Schließe dich NodeZone.net an und werde Teil einer aktiven Community rund um Server-Hosting, Gameserver-Management und Modding-Ressourcen.

    Wer jetzt nicht teilt ist selber Schuld:
    1. Nutzungsbestimmungen
    2. Datenschutzerklärung
    3. Impressum
    4. Urheberrechts- oder Lizenzverstoß melden
  • Trimax Design coded & layout by Gino Zantarelli 2023-2025©
    Community-Software: WoltLab Suite™