• Trade Wars 2 Haggle values

    From vela025@VERT to all on Fri Nov 29 14:14:10 2024
    Hey all,
    I'm having a problem with the haggling in Trade Wars 2/Javascript included in the xtrn directory. It seems to cap out the value I can enter, for example: Traders offer for 20 units of Equipment is 534, I then try to enter 500 as my offer but I can only type 50 and then it gives me the "That was pretty funny" line. It does the same for 400 (only allowing 40), 300 only allowing 30, 250 only allowing 25 but does let me enter 200.

    At another port a trader wants 105 for 20 ore, which does allow me to enter 100.

    port.js has:
    while(offer==0) {
    console.write("Your offer? ");

    offer=InputFunc([{min:0,max:(buy?player.Credits:(price*amount*10))}]);
    if(offer==0)
    break;
    if(offer < price*amount/10 || offer > price*amount*10) {
    console.writeln("That was pretty funny, Now make a serious offer.");
    offer=0;
    }

    And InputFunc in input.js is quite lengthy so I won't paste that here.

    Am I doing something wrong, should I be entering the price per unit, not the price for all units? Or is this a bug?
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to vela025 on Fri Nov 29 23:19:53 2024
    Re: Trade Wars 2 Haggle values
    By: vela025 to all on Fri Nov 29 2024 02:14 pm

    Am I doing something wrong, should I be entering the price per unit, not the price for all units? Or is this a bug?

    It sounds like a bug to me. Feel free to work on the solution and let us know what it is.
    --
    digital man (rob)

    Synchronet "Real Fact" #71:
    The largest dial-up Synchronet BBS was The Easy Street BBS with 25 nodes/lines Norco, CA WX: 57.8øF, 26.0% humidity, 0 mph SE wind, 0.00 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From vela025@VERT to Digital Man on Sat Nov 30 02:36:02 2024
    As we all know Javascrip is not my thing however I think changing line 124 in input.js from:

    if(cur*10 <= max)
    to:
    if(cur*10 <= max || cur <= max)

    May solve the issue, I'll play a bit longer and see if I encounter the issue again.
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net