Skip to content
Snippets Groups Projects

Converted saWorkTheFarm to JS

Merged brickode requested to merge (removed):dcoded-dev into pregmod-master

There are a lot of TODOs - areas that I've marked for consideration / input.

Merge request reports

Approval is optional
Ready to merge by members who can write to the target branch.

Merge details

  • 1 commit and 1 merge commit will be added to pregmod-master.
  • Source branch will be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • brickode added 1 commit

    added 1 commit

    Compare with previous version

  • All tested?

  • Author Reporter

    In the process now. The biggest issue I'm seeing is that getSlaveStatisticData() doesn't want to play nice with it, so I'm going to see how it goes with it commented out.

  • That could be a problem. I'm not well versed in it, so here's hoping the arcade stuff goes well tomorrow.

  • Though frankly, I don't see why it takes issue when the variables aren't changing. Mystery errors are lovely, right?

  • Author Reporter

    Always. Here's the error I'm getting: Error: <<=>>: bad evaluation: Cannot create property 'income' on number '5'

    No idea what the hell "number 5" is supposed to mean.

    Edited by brickode
  • brickode added 5 commits

    added 5 commits

    • bec35408...db2781a4 - 3 commits from branch pregmodfan:pregmod-master
    • 9f38721b - Cleanup
    • f5113154 - Merge branch 'pregmod-master' of https://gitgud.io/pregmodfan/fc-pregmod into dcoded-dev

    Compare with previous version

  • You'd have to look at the function and see what .income is being called on. It's likely something in an array that, for one reason or another, has something wrong being pushed into it.

  • Alternatively, an object. You see that a lot when $activeSlave being set to 0 manages to get someplace it shouldn't.

  • Author Reporter

    Maybe the Farmyard doesn't have an .income property for whatever reason? I'm also wondering if it's because var incomeStats is defined as getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.farmyard : undefined), and it maybe slave.assignment and everything after it is unnecessary / should be something else.

    Edited by brickode
  • Is Job.FARMYARD defined? It feels like it is somehow getting V.farmyard someplace it shouldn't as that's value would be 5.

  • Calling it a night, but definitely check Job.FARMYARD and make sure it matches the assignment value. Also double check against another facility to make sure you are giving it the proper arguments. It may just be a case of passing the wrong value in the wrong argument.

  • Author Reporter

    Alright, I'll keep working on for a bit - I'm going to head off to bed soon too. Now that's interesting - I'm getting a "bad evaluation" error in main.tw: Error: <<set>>: bad evaluation: job is not defined. The dropdown says <<set $costs = Math.trunc(predictCost($slaves))>>, so somehow, somewhere in predictCost(), job isn't defined. Looks like that was because I added case job.FARMER: to getSlaveCost(). The rabbit hole goes deeper. I don't know how capitalization works, apparently.

    Edited by brickode
  • brickode added 1 commit

    added 1 commit

    Compare with previous version

  • Author Reporter

    The weird thing is that getSlaveStatisticData() works perfectly fine when it's being called in the .tw passages, but when it gets put into the JS version is decides to freak out and throw errors.

  • Pregmodder
  • So should I merge this given the hiccuping? Or wait to see if I slam into the same issue?

  • Author Reporter

    I'm disabling incomeStats for now until we can figure out exactly what's causing the issue, so you can go ahead and merge (I think), but players' income stats for the Farmyard won't be recorded. Mildly inconvenient, but hardly game-breaking.

  • brickode added 9 commits

    added 9 commits

    • 1a8e32a7...1dae4de8 - 7 commits from branch pregmodfan:pregmod-master
    • 7cb4db38 - Changes, disabled incomeStats again
    • 27cac155 - Merge branch 'pregmod-master' of https://gitgud.io/pregmodfan/fc-pregmod into dcoded-dev

    Compare with previous version

  • brickode resolved all discussions

    resolved all discussions

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading