Page 4 of 5

Re: Warhammer 40k or Fantasy Wargame?

Posted: Thu Aug 06, 2009 10:08 am
by Malekith
nice feedback.
But I'd like to point out that was pretty much what I had when I left it, and the Dice Roller we had worked out above could handle over 100 dice, only problem was that it didn't process what the dice meant, just showed you the numbers and/or successes. I may have to cannibalise your script into mine and see what comes of it.
Right then, I may try picking this up again and seeing what I can do with it. However it's mostly Cosmetic things like templates, tokens and tables.
I also had a bad time trying to find decent top-downs of the vehicles.

Mal

EDIT: on my computer your macro doesn't have a limit mate...

Re: Warhammer 40k or Fantasy Wargame?

Posted: Thu Aug 06, 2009 4:57 pm
by Malekith
ok, i've stuck em together and got this:

Code: Select all

[h: TotalWins = 0]
[h: TotalFailures = 0]
[h: TotalSixes = 0]

[h: Input(
   "UnitRoll|1|Number of unit dice to roll",
   "UnitTN|2, 3, 4, 5, 6|Unit's Target Number|LIST|select=2 Value=string",
   "SgtRoll|1|Number of sergeant dice to roll",
   "SgtTN|2, 3, 4, 5, 6|Sergeant's Target Number|LIST|select=2 Value=string"
)]

<b>Unit's Target Number:</b> [r: eval("UnitTN")]<br>
<b>Unit's results:</b><br>
[count(UnitRoll), CODE:
{
  [Rawroll = 1d6]
  [h: UnitSix = IF(Rawroll == 6, 1, 0)]
  [h: UnitWin = IF(Rawroll >= UnitTN, 1, 0)]
  [h: UnitFail = IF(Rawroll < UnitTN, 1, 0)]
  [h: UnitSixs = TotalSixes + UnitSix]
  [h: UnitWins = TotalWins + UnitWin]
  [h: UnitFailures = TotalFailures + UnitFail]
}]<br>
[r: UnitWins] Successes (of which [r: UnitSixs] are 6s) and [r: UnitFailures] Failures<br>

<b>Sergeant's Target Number:</b> [r: eval("SgtTN")]<br>
<b>Sergeant's results:</b><br>
[count(SgtRoll), CODE:
{
  [Rawroll = 1d6]
  [h: SgtSix = IF(Rawroll == 6, 1, 0)]
  [h: SgtWin = IF(Rawroll >= UnitTN, 1, 0)]
  [h: SgtFail = IF(Rawroll < UnitTN, 1, 0)]
  [h: SgtSixs = TotalSixes + SgtSix]
  [h: SgtWins = TotalWins + SgtWin]
  [h: SgtFailures = TotalFailures + SgtFail]
}]<br>
[r: SgtWins] Successes (of which [r: SgtSixs] are 6s) and [r: SgtFailures] Failures<br>
To me it looks ok.
But when I run it I get an unexpected character error message. Probably a typo on my part but i cant see it anywhere. Apparently it's in line: 1:10 and it's the character 0xA0, which to my knowledge is the UTF-8 code for a space character. I've had a couple of these errors thrown up at different points in the macro and I've managed to clear the few extra spaces. However I've looked it over and over and there aren't any extra spaces that I can see. I just need it to throw up the results so I can see if it's actually working. can anyone help?

Mal

Re: Warhammer 40k or Fantasy Wargame?

Posted: Sun Aug 09, 2009 12:05 pm
by Malekith
ok then,
after a bit of work I got it all working (for some reason the macro button I was using to write it didn't like the code, but copying and pasting the code from my post into a new button made the unexpected char error go away :lol: then I needed to do a bit of fiddling the variables. xD)
so no thanks to any of you I have come up with this:

Code: Select all

[h: Input(
   "UnitRoll|1|Number of unit dice to roll",
   "UnitTN|2, 3, 4, 5, 6|Unit's Target Number|LIST|select=2 Value=string",
   "SgtRoll|1|Number of sergeant dice to roll",
   "SgtTN|2, 3, 4, 5, 6|Sergeant's Target Number|LIST|select=2 Value=string"
)]

[h: UnitWins = 0]
[h: UnitFailures = 0]
[h: UnitSixs = 0]
[h: UnitOnes = 0]
[h: SgtWins = 0]
[h: SgtFailures = 0]
[h: SgtSixs = 0]
[h: SgtOnes = 0]

<b>Unit's Target Number:</b> [r: eval("UnitTN")]<br>
<b>Unit's results:</b><br>
[h, count(UnitRoll), CODE:
{
  [h: Rawroll = 1d6]
  [h: UnitSix = IF(Rawroll == 6, 1, 0)]
  [h: UnitWin = IF(Rawroll >= UnitTN, 1, 0)]
  [h: UnitFail = IF(Rawroll < UnitTN, 1, 0)]
  [h: UnitOne = IF(Rawroll == 1, 1, 0)]
  [h: UnitSixs = UnitSixs + UnitSix]
  [h: UnitOnes = UnitOnes + UnitOne]
  [h: UnitWins = UnitWins + UnitWin]
  [h: UnitFailures = UnitFailures + UnitFail]
}]
<span color="green">[r: UnitWins] Successes (of which [r: UnitSixs] are 6s)</span> and <span color="red">[r: UnitFailures] Failures (of which [r: UnitOnes] are 1s)</span><br>

<b>Sergeant's Target Number:</b> [r: eval("SgtTN")]<br>
<b>Sergeant's results:</b><br>
[h, count(SgtRoll), CODE:
{
  [h: Rawroll = 1d6]
  [h: SgtSix = IF(Rawroll == 6, 1, 0)]
  [h: SgtWin = IF(Rawroll >= UnitTN, 1, 0)]
  [h: SgtFail = IF(Rawroll < UnitTN, 1, 0)]
  [h: SgtOne = IF(Rawroll == 1, 1, 0)]
  [h: SgtSixs = SgtSixs + SgtSix]
  [h: SgtOnes = SgtOnes + SgtOne]
  [h: SgtWins = SgtWins + SgtWin]
  [h: SgtFailures = SgtFailures + SgtFail]
}]
<span color="green">[r: SgtWins] Successes (of which [r: SgtSixs] are 6s)</span> and <span color="red">[r: SgtFailures] Failures (of which [r: SgtOnes] are 1s)</span> 
So, what's next on the agenda?... :p

Mal

Re: Warhammer 40k or Fantasy Wargame?

Posted: Wed Sep 02, 2009 4:57 pm
by iamhacim
I have been working on a 40K framework and have been working with the scripts and ideas you guys have posted here. However, I am old and have a job and family and not much time to code anymore. I was wondering if any of you guys ever got your 40K game up and running and would be willing to share your framework with me?

I would also be very ineterested in playing matches if any of you are looking for a game.

Re: Warhammer 40k or Fantasy Wargame?

Posted: Thu Sep 03, 2009 7:02 am
by Malekith
I've not done much since my last.
I'd be up for putting more work in if someone tells me what needs to be done and I'd defo be up for a game :D

Mal

Re: Warhammer 40k or Fantasy Wargame?

Posted: Thu Sep 03, 2009 7:18 pm
by iamhacim
Malekith wrote:I've not done much since my last.
I'd be up for putting more work in if someone tells me what needs to be done and I'd defo be up for a game :D

Mal
I have been speaking with my brother (who is an avid 40K player) and it looks like we may have everything we need with what has already been developed. The only other thing I can think of might be a macro to set-up tokens with stats, weapons, armor, etc. I am going to work on that. I am also going to modify the properties slightly to handle vehicles, dreadnaughts, and demons.

The next challenge is getting pics of overhead models for play, which he is working on. He is going to start by taking pictures of his own army of Space Wolves and his Chaos Nurgle army.

Do you have tokens already set up? Do you know what army you plan on playing?

Re: Warhammer 40k or Fantasy Wargame?

Posted: Thu Sep 03, 2009 9:04 pm
by Malekith
1 that's awesome. there were some ideas furthur back in this thread about what else might be nice to include.
2 use a new set of properties under 'Vehicle' or something to keep everything nice and separate.
3 i have a few tokens but setting up the right sizes and getting decent ones is hard. I have often thought that physically taking the pictures myself would be easier. So I'll probably make a start on some of mine too once they're ready.
4 I'll play any army i can get enough rules to make a list for and the tokens to field it with. :D

Mal

Re: Warhammer 40k or Fantasy Wargame?

Posted: Fri Oct 09, 2009 5:54 pm
by Malekith
heya guys.
Sorry If I'm necroing and no-one else is interested. just tell me if that's the case and i'll shut up.
My laptop died on me the other day and so I lost all the campaign files etc for this project, however I've managed to get most of it back now on my external hard drive (next to my MT installation there :D) however I'm missing those template tokens that are found on page 2, anyone have a copy they can send me?
I'm also probably gonna be working on this for my own benefit and seeing where I can take it. Is anyone else interested, or shall I just shut up now and keep to myself? lol :P

Mal

Re: Warhammer 40k or Fantasy Wargame?

Posted: Sat Oct 10, 2009 3:46 pm
by emirikol
I've got WFRP tokens (all of them from all of the books) on my gallery page if that helps. They're from my periodic WFRP on Maptools minicampaigns.

Jay H

Re: Warhammer 40k or Fantasy Wargame?

Posted: Sun Oct 11, 2009 5:12 am
by Malekith
cheers, but I'm after the tokens that were posted in this thread, by Jshock.
I may still have a look at your tokens tho :D

Mal

Re: Warhammer 40k or Fantasy Wargame?

Posted: Sun Oct 11, 2009 10:03 am
by Jshock
Ahh crap, didn't realize the links weren't working! They're up in my gallery now, they won't be going anywhere.

Large template (w/scatter):
http://gallery.rptools.net/d/34468-2/La ... 0d25ae7918

Small template (w/scatter):
http://gallery.rptools.net/d/34471-2/Sm ... 0d25ae7918

These could be redone better nowadays with MoveToken, though.

Re: Warhammer 40k or Fantasy Wargame?

Posted: Tue Oct 13, 2009 12:34 am
by seanb
Here's my Scatter macro. Just lay down the blast token on your target, make sure the blast token is selected, and then click this macro button:

Code: Select all

[h: Input(
   "AttackerBS|1|Attacker's BS"
)]
[h: Rawroll = 1d6]
[h: ScatDice = IF(Rawroll < 3, "Dead On", "Scattered")]
[h: ScatterInches = IF(Rawroll < 3, 0, 2d6 - AttackerBS)]
[h: ScatterInchesText = IF(Rawroll < 3, "", ScatterInches)]
[h: ScatterText = IF(Rawroll < 3, "", " inches<br>")]
[h: myAngle = 1d90]
[h: myRadians = divide(myAngle, 57.2958)]
[h: sinAngle = myRadians - divide(power(myRadians, 3),6)]
[h: sinAngle = sinAngle + divide(power(myRadians, 5),120)]
[h: sinAngle = sinAngle - divide(power(myRadians, 7),5040)]
[h: cosAngle = 1 - divide(power(myRadians, 2),2)]
[h: cosAngle = cosAngle + divide(power(myRadians, 4),24)]
[h: cosAngle = cosAngle - divide(power(myRadians, 6),720)]
[h: XMovement = IF(Rawroll < 3, 0, floor(multiply(ScatterInches,cosAngle,50)))]
[h: YMovement = IF(Rawroll < 3, 0, floor(multiply(ScatterInches,sinAngle,50)))]
[h: leftRight = 1d2]
[h: leftRight = IF(leftRight == 2, -1, 1)]
[h: upDown = 1d2]
[h: upDown = IF(upDown == 2, -1, 1)]
[h: myAngle = IF(upDown == -1, myAngle + 90, myAngle)]
[h: myAngle = IF(leftRight == -1, 360- myAngle, myAngle)]
[h: XMovement = multiply(XMovement,leftRight)]
[h: YMovement = multiply(YMovement,upDown)]
[h: ScatterAngle = myAngle]
[h: ScatterAngleText = IF(Rawroll < 3, "", ScatterAngle)]
[h: ScatterAnglePreText = IF(Rawroll < 3, "", "Angle: ")]
[h: ScatterAnglePostText = IF(Rawroll < 3, "", " degrees (0=East, 90=North, etc.)")]

Scatter Results: [ScatDice]<br>

[h: ids = getSelected()]
[foreach(id, ids), CODE: 
	{
	[h: CurrentX = getTokenX(1, id)]
	[h: CurrentY = getTokenY(1, id)]
	[h: NewX = CurrentX + XMovement]
	[h: NewY = CurrentY - YMovement]
	[h: moveToken(NewX, NewY, 1, id)]
	}
]

[ScatterInchesText][ScatterText]
[ScatterAnglePreText][ScatterAngleText][ScatterAnglePostText]

Re: Warhammer 40k or Fantasy Wargame?

Posted: Wed Oct 14, 2009 3:07 pm
by Malekith
Wow, that's an impressive macro there seanb!
How long that take you to make? and what scale grid is that working on? IIRC a basic troop base is about 2/3 inches depending on the game type and army so that's what I'm basing mine on. And a little breakdown of it would be lovely as it'd help my macro writing skills. :D
And thanks Jshock for re-posting, the tokens are still useful especially when used with sean's nice new macro.

Mal

Re: Warhammer 40k or Fantasy Wargame?

Posted: Fri Nov 20, 2009 5:32 pm
by Greegan
hey is there any way i can get in on the 40k bash?
Have only played 40k a couple of times. I have all the books, except the tau i think...
I'd love to learn how to play so if it just means being in vent with some players for their game I would be up for that.
Assuming its a yes...
Do you need my email?

Re: Warhammer 40k or Fantasy Wargame?

Posted: Sun Aug 19, 2012 12:41 pm
by Jaedar
Hi.

Sorry for the massive necropost, but did anything become of this? Any campaign files to download if one wanted to play with these macros?