Author Topic: I'm going to make a Warchest points calculator  (Read 7538 times)

Bedwyr

  • A Sticky Wicket
  • Global Moderator
  • Lieutenant Colonel
  • *
  • Posts: 10195
  • RIP. Again. And again. And again.
I'm going to make a Warchest points calculator
« on: 30 January 2011, 11:18:13 »
Mostly to give me practice with both VB.net and javascript.  The first one to be finished depends on how much help I get.  Javascript would be the most useful.

Design considerations:

- There are three textboxes and three scrolling counters. 

- You either type or click up the numbers in the counters for:
--Unit number (lance, star, level II)
--Advanced unit number (any non-clan unit with above intro tech)
--Clan unit number (and clan unit, not differentiating between 2nd and 1st line for now)

- You enter any number into one of the text fields and the other two automatically update with the properly calculated results.  If possible, no buttons needed.

- You cannot enter numbers that aren't integers (they can be negative)
Alas poor Photobucket. I knew him Horatio, a fellow of infinite jest, of most excellent fancy.

Bedwyr

  • A Sticky Wicket
  • Global Moderator
  • Lieutenant Colonel
  • *
  • Posts: 10195
  • RIP. Again. And again. And again.
Re: I'm going to make a Warchest points calculator
« Reply #1 on: 30 January 2011, 11:23:13 »
Toughest part I'm trying to find right now is finding a proper javascript event handler.  Calculation shouldn't begin until 1) the proper box is clicked on and 2) has something inside it to calculate.  Most people insist on having buttons. :P
Alas poor Photobucket. I knew him Horatio, a fellow of infinite jest, of most excellent fancy.

ScrapYardArmory

  • Master Sergeant
  • *
  • Posts: 316
    • ScrapYardArmory
Re: I'm going to make a Warchest points calculator
« Reply #2 on: 30 January 2011, 11:27:58 »
Is this a stand alone desktop type program?

So just a simple Warchest to Support Points to CBills conversion tool?

Bedwyr

  • A Sticky Wicket
  • Global Moderator
  • Lieutenant Colonel
  • *
  • Posts: 10195
  • RIP. Again. And again. And again.
Re: I'm going to make a Warchest points calculator
« Reply #3 on: 30 January 2011, 11:32:23 »
Is this a stand alone desktop type program?

So just a simple Warchest to Support Points to CBills conversion tool?

Yup and nope.  Yup and nope.

I'm teaching myself a bit of VB and Js for fun this weekend so it'll be both standalone and web-page based.  The calculator should be able to convert between any currency type.  So if your group blows a wad on a new mech (30mill cbills), then what's left can quickly and easily be translated back into warchest points.


I'm actually the closest to being done with the VB app.

After that I'll consider making a droid app.
« Last Edit: 30 January 2011, 11:34:48 by Bedwyr »
Alas poor Photobucket. I knew him Horatio, a fellow of infinite jest, of most excellent fancy.

ScrapYardArmory

  • Master Sergeant
  • *
  • Posts: 316
    • ScrapYardArmory
Re: I'm going to make a Warchest points calculator
« Reply #4 on: 30 January 2011, 19:39:10 »
Let me know if I can help at all. 

How do you plan on hosting the web-based version?

Bedwyr

  • A Sticky Wicket
  • Global Moderator
  • Lieutenant Colonel
  • *
  • Posts: 10195
  • RIP. Again. And again. And again.
Re: I'm going to make a Warchest points calculator
« Reply #5 on: 30 January 2011, 21:46:07 »
Let me know if I can help at all. 

How do you plan on hosting the web-based version?

There's this guy who runs a site that rhymes with "ride", "rock", and "listening free" who might be willing to do it I'll bet. :)  I'm sure I'll find a place.

I've been stubborn so far about having it auto-calc based on text box entries and I think I need to just use a button to save sanity.
Alas poor Photobucket. I knew him Horatio, a fellow of infinite jest, of most excellent fancy.

Bedwyr

  • A Sticky Wicket
  • Global Moderator
  • Lieutenant Colonel
  • *
  • Posts: 10195
  • RIP. Again. And again. And again.
Re: I'm going to make a Warchest points calculator
« Reply #6 on: 30 January 2011, 23:59:20 »
I got a VB app done using a button.  It needs cleaning up and better commenting and, yes, it is .NET.  But it works and hopefully I can get a javascript version done soon enough.  Have a lot of work this week though.  It may be a bit.
Alas poor Photobucket. I knew him Horatio, a fellow of infinite jest, of most excellent fancy.

Ladob

  • Sergeant
  • *
  • Posts: 137
Re: I'm going to make a Warchest points calculator
« Reply #7 on: 31 January 2011, 08:20:31 »
Here is the Excel one I've made. Perhaps you can use the calculations as a base. It is very primitive still, but makes for the most basic needs: i.e. technology % on the unit and its change into the designated Support/C-Bills, etc. By the way make the B column wider that C-Bills show correctly. :P
Change, even for the worse

Bedwyr

  • A Sticky Wicket
  • Global Moderator
  • Lieutenant Colonel
  • *
  • Posts: 10195
  • RIP. Again. And again. And again.
Re: I'm going to make a Warchest points calculator
« Reply #8 on: 31 January 2011, 08:40:12 »
Here is the Excel one I've made. Perhaps you can use the calculations as a base. It is very primitive still, but makes for the most basic needs: i.e. technology % on the unit and its change into the designated Support/C-Bills, etc. By the way make the B column wider that C-Bills show correctly. :P

Thanks.  I've got the math though.  The trick is to be able to reverse the process because people buy things in support points and Cbills and then you need to work backwards.  The trickier, erm, trick is to make it happen all in the same cells.  I tried making a spreadsheet, but three-way dependency using VB scripting crashed Excel.  I think now that I've used the right event handler in VB itself, I might be able to get rid of that button.

Here's what it looks like.  You can enter in any one of the three currencies and out pops the other two.  I *think* I know how to get rid of the button and have it calculate on the fly, but we'll see.  Now someone just has to show me how to do HTML layout to look like this and I can work on the javascript.




*Also, I'm really unhappy with how packaging is done with VB.  I assumed you could just get a portable exe to run (maybe with a popup complaining about wanting .NET runtime) but nooo.  You actually have to "install" the silly thing like a full size program with libraries.  If I want to make something reasonably portable it'll have to be Java or some-such thing.
« Last Edit: 31 January 2011, 08:54:50 by Bedwyr »
Alas poor Photobucket. I knew him Horatio, a fellow of infinite jest, of most excellent fancy.

ScrapYardArmory

  • Master Sergeant
  • *
  • Posts: 316
    • ScrapYardArmory
Re: I'm going to make a Warchest points calculator
« Reply #9 on: 31 January 2011, 09:46:31 »
I'll second the idea of going java.  That way us mac folks can make use of it.

On the web version, don't worry about the presentation.  That should be left to cascading style sheets.  Write good semantic html, and the presentation will be an afterthought.


ScrapYardArmory

  • Master Sergeant
  • *
  • Posts: 316
    • ScrapYardArmory
Re: I'm going to make a Warchest points calculator
« Reply #10 on: 31 January 2011, 09:56:33 »
Heya, i just noticed that there is no static Force Size Modifier in your program.

The FSM should not change even as the force expands or contracts.  This should be a static setting then for your calculations.


Col. Chiang

  • Sergeant
  • *
  • Posts: 190
Re: I'm going to make a Warchest points calculator
« Reply #11 on: 31 January 2011, 10:49:17 »
Well, that's a whole lot cooler than the freehand stuff I've been using. 

Please, please let us know if you do a droid version; until my tax returns come in, I'm dependant upon my smartphone for computing needs.  Even after I get a computer, it'd be real helpful to have such a thing in my pocket.

Bedwyr

  • A Sticky Wicket
  • Global Moderator
  • Lieutenant Colonel
  • *
  • Posts: 10195
  • RIP. Again. And again. And again.
Re: I'm going to make a Warchest points calculator
« Reply #12 on: 31 January 2011, 11:26:54 »
Heya, i just noticed that there is no static Force Size Modifier in your program.

The FSM should not change even as the force expands or contracts.  This should be a static setting then for your calculations.

Fair consideration, but it isn't meant to be an on-going tracker.  Just a one-off calculator same as "how much should I save for my mortgage?"  So it depends on the honesty of the user.  I can re-label the lances to actually read FSM and explain that it's supposed to remain static as your forces adjust.
Alas poor Photobucket. I knew him Horatio, a fellow of infinite jest, of most excellent fancy.

Spaceman

  • Catalyst Demo Team
  • Warrant Officer
  • *
  • Posts: 790
Re: I'm going to make a Warchest points calculator
« Reply #13 on: 01 February 2011, 07:33:16 »
Wow that's cool. Can't wait for a finished product. For your android app you might be able to code it in Google's App inventor.
Demo Agent #567 Binghamton, NY (Southern Tier)
FLGS: Jupiter Games - Johnson City, NY

Southern Tier BattleTech Group
https://www.facebook.com/groups/STierBattleTech/

Bedwyr

  • A Sticky Wicket
  • Global Moderator
  • Lieutenant Colonel
  • *
  • Posts: 10195
  • RIP. Again. And again. And again.
Re: I'm going to make a Warchest points calculator
« Reply #14 on: 02 February 2011, 21:45:54 »
Aaand I made a javascript page for it.  Works nice without a button too.  Will try to do the CSS if I have any more time after working out and homework tonight.  Then to find a host...
Alas poor Photobucket. I knew him Horatio, a fellow of infinite jest, of most excellent fancy.

ScrapYardArmory

  • Master Sergeant
  • *
  • Posts: 316
    • ScrapYardArmory
Re: I'm going to make a Warchest points calculator
« Reply #15 on: 02 February 2011, 22:09:38 »
And hosted.  The CSS still needs a bit of work but that can be added in later as time allows.

http://www.scrapyardarmory.com/warchestcalc/warchestpointcalculator.html

Bedwyr

  • A Sticky Wicket
  • Global Moderator
  • Lieutenant Colonel
  • *
  • Posts: 10195
  • RIP. Again. And again. And again.
Re: I'm going to make a Warchest points calculator
« Reply #16 on: 03 February 2011, 00:00:05 »
I can already see a few things that can be improved.  It would be better to say "support points" instead of "enter support points" because the three bottom-most fields are outputs as well as inputs.  And then there's the arrangement, yes. :)

Urgh.  And I need to make it round to whole numbers or you'll get complaints about decimals once you click on a field that auto-calculated a decimal.

I like it against the background there.
« Last Edit: 03 February 2011, 00:01:52 by Bedwyr »
Alas poor Photobucket. I knew him Horatio, a fellow of infinite jest, of most excellent fancy.