Warhammer 40k or Fantasy Wargame?

Talk about whatever topic you'd like, RPG related or not. (But please discuss things related to our software in the Tools section, below.)

Moderators: dorpond, trevor, Azhrei

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by Malekith »

Great work.
Love the macros. I've just compiled them together and got 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: x = "1d6s"+ UnitTN]
[h: y = "1d6s"+ SgtTN]
<b>Unit's Target Number:</b> [r: eval("UnitTN")]<br>
<b>Unit's roll:</b> [r, c(UnitRoll): eval(x)]<br>
<b>Sergeant's Target Number:</b> [r: eval("SgtTN")]<br>
<b>Sergeant's roll:</b> [r, c(SgtRoll): eval(y)]
This throws up a string of 1s and 0s like Jshok's threw up the raw rolls. cos i found it quicker to count 1s for hits/wounds and 0s for saves than the rolls (but that's me being lazy and also so that i can develop it later. so it's a kind of generic macro.
Next step is to use GetProperty() for both the impersonated and target (although this will probably mean that the macro will have to run twice, once for unit and once for sergeant/champion), then comparing them and using the result of the comparison for the TN input. Also i'll try and clear up the output and split off almost a reverse macro to use for saves etc.
After that i'll try and modify them more to allow different dice types (well, d6/d3 at least)
I'll try to get a leadership check macro up tonight after some work and at some future date modifying it so you can input if it's a S, T or Ld test and on what amount of d6.
anything else people can think of?

Mal
Mal

User avatar
Jshock
Dragon
Posts: 311
Joined: Sat Jan 26, 2008 8:55 pm
Location: West Warwick, RI
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by Jshock »

Yeah, That's way better than my roller Malekith! Wish I had thought of that.

Hmmm... Vehicle AP needs a different kind of roller, I'll work on that next.

Ld roller will have to take double 1/double 6 into account... also modifiers. I can't remember taking S/T tests in 40k though- what does that?

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by Malekith »

Good question. as i've said haven't played 40k in ages. I was thinking of this as a generic macro set that included both gametypes with any specific macros in groups :D
Cheers for the praise, but as i posted, just me being lazy more than anything ;) but i was thinking ahead to when we get to functions based on the hit rolls as the results can be called as 1s and 0s if needs be :D
you get on with that then :D we'll need some pics for vehicle damage and artillery tables then they're easy as p***

Mal
Mal

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by Malekith »

currently making up a Leadership/panic check macro and come a-cropper:

Code: Select all

[h: Input(
   "Dice|1d6, 2d6, 3d6|Number of dice to roll|LIST|select=1 Value=string",
   "Mod|0|Modifier"
)]
[h: Ld= getProperty(Leadership)]
<b><u>Test Result:</u> [r: if(Dice<=Ld+Mod, "eval(Dice), Passed!", "eval(Dice), Failed")]</b>
currently I'm getting this error:
net.rptools.parser.function.ParameterException: Illegal argument type java.lang.String, expecting java.math.BigDecimal error executing expression: if(Dice=Ld+Mod, "eval(Dice), Passed!", "eval(Dice), Failed")
anyone around have a clue?

The input is working cos I used the code in another macro and replaced everything after the input with [r: eval(Dice)] and it chucks up the roll nicely. So I'm stumped how cani get it to work?

Mal

EDIT: ok, got it working, kind of.

Code: Select all

[h: Input(
   "Dice|1d6, 2d6, 3d6|Number of dice to roll|LIST|select=1 Value=string",
   "Mod|0|Modifier"
)]
[h: x= getProperty(Leadership)]
<span style="color:red"><b><u>Leadership Test Result:</u><br>
Roll: [r: Roll= eval(Dice)], Target: [r: Ld= x+Mod]<br>
[r: if(Roll<=Ld, "Pass!", "Fail")]</b></font>
1 problem: I cant manipulate the getProperty() function properly. x=getProperty(Leadership) calls the Leadership value properly yet the Ld= x+Mod wont place the value called in the space x yet the Mod input has been used. (If i use the shortname for Leadership (Ld) then it doesn't work at all despite my settings in the Campaign Properties xD)
HELP!
Last edited by Malekith on Wed Mar 04, 2009 5:05 pm, edited 2 times in total.
Mal

User avatar
Mathemagician
Dragon
Posts: 666
Joined: Tue May 22, 2007 2:27 pm

Re: Warhammer 40k or Fantasy Wargame?

Post by Mathemagician »

Malekith wrote:currently making up a Leadership/panic check macro and come a-cropper:

Code: Select all

[h: Input(
   "Dice|1d6, 2d6, 3d6|Number of dice to roll|LIST|select=1 Value=string",
   "Mod|0|Modifier"
)]
[h: Ld= getProperty(Leadership)]
<b><u>Test Result:</u> [r: if(Dice<=Ld+Mod, "eval(Dice), Passed!", "eval(Dice), Failed")]</b>
currently I'm getting this error:
net.rptools.parser.function.ParameterException: Illegal argument type java.lang.String, expecting java.math.BigDecimal error executing expression: if(Dice=Ld+Mod, "eval(Dice), Passed!", "eval(Dice), Failed")
anyone around have a clue?

The input is working cos I used the code in another macro and replaced everything after the input with [r: eval(Dice)] and it chucks up the roll nicely. So I'm stumped how cani get it to work?

Mal

EDIT: just a thought but i was wondering if i should use some macros on a Lib token to accomplish this then call them and compare. wouldn't have thought i'd need to but may end up being neater...
I replaced your code with this, and it seems to work:

Code: Select all

[h: Input(
   "Dice|1d6, 2d6, 3d6|Number of dice to roll|LIST|select=1 Value=string",
   "Mod|0|Modifier"
)]
[h: Ld= getProperty(Leadership)]
[h: theRoll=eval(Dice)]
<b><u>Test Result:</u> [r: if(theRoll<=Ld+Mod,theRoll+", Passed!",theRoll+ ", Failed")]</b>

The issue was that Dice is a string, while Ld+Mod is a number. It doesn't make too much sense to ask the question, "Is 'hello' <= 17?" so what I did was converted Dice to a number (ie, execute the roll) and store it in theRoll, then used all that for output.

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by Malekith »

Yeah I realised that. Thanks for looking.
wasn't sure if i could get it to roll in the if statement or if it had to be before.
sorted that out and edited it above.
:D

Mal

EDIT, copied your macro into a new macro on mine and it didn't work -_-
Mal

User avatar
Jshock
Dragon
Posts: 311
Joined: Sat Jan 26, 2008 8:55 pm
Location: West Warwick, RI
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by Jshock »

Try the if as a code block:

Code: Select all

[h: Input(
   "Dice|1d6, 2d6, 3d6|Number of dice to roll|LIST|select=1 Value=string",
   "Mod|0|Modifier"
)]
[H: Ld=GetProperty("Leadership")]
[H: dieroll=Eval(Dice)]<br>
<b><u>Test result:</b></u> [if(dieroll<=Ld+Mod), Code: {[dieroll], Pass!}; {[dieroll], Fail!}]
It didn't know what "Leadership" was, but it worked if I set Ld to a number, so I think it's sound.

Edit: NM, posted before reading... Only know what I read about GetProperty, but it sounds like the selected token doesn't actually have a Leadership in it.

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by Malekith »

But it does and the getProperty calls it porperly, just for some reason it wont carry through so the macro can manipulate it. x(

Well I swapped x= getProperty(Leadership) to just call the property x= Leadership and stuck it on my token and it works well :D but only problem is that i cant get the campaign macro to work. may have to set up a few campaign macros to set up the tokens and use them instead :D

Mal
Mal

Humble Apostle
Cave Troll
Posts: 63
Joined: Sun Nov 23, 2008 10:13 pm

Re: Warhammer 40k or Fantasy Wargame?

Post by Humble Apostle »

Wow, I'm glad this project is starting to get off the ground. I know next to nothing about coding and 40k, but if you need a guinea pig for yer macroes I'm your man!
"A Knight is sworn to Valour"
"His Heart knows only Virtue"
"His Blade defends the Helpless"
"His Might upholds the Weak"
"His Words speak only Truth"
"His Wrath undoes the Wicked"

User avatar
EvilSqueegee
Cave Troll
Posts: 81
Joined: Wed Dec 05, 2007 4:53 pm

Re: Warhammer 40k or Fantasy Wargame?

Post by EvilSqueegee »

Barebones, but it works.

http://i3.photobucket.com/albums/y74/Ev ... kFight.jpg

Screenshot of a battle underway. I'm not sure what the memory allotment is (standard for everyone involved, I believe). The game you're seeing is a four-player game, involving 2 teams of 2 players. Each player has a 2,000 point army, and my army consists of orks (hee, swarmlings.)

Everything seems to run smoothly. Albeit, our map isn't made of a graphicsgasm, but hey. Each unit on the board is a PC with vision, we've set up visionblocking to handle LOS. the text labels on the map (shootsing the guards and MIND BULLETS) are the tyranid player's way of remembering what has yet to be resolved before his turn was over (one of our players had to bail for the night, so we paused.)

We only use two macros: the Die Roller and the Scatterdice macro. Our Scatterdice macro had to be a bit of a compromise (generating one of 8 directions in N, S, E, W, NE, NW, SW, and SE) and it's only VERY lazily slapped together, but I'm about to sit down and rewrite it with a table for cleaner output.

The die roller:

Code: Select all

[h:Dieroll = 0]
[h: TotalOnes = 0]
[h: TotalTwos = 0]
[h: TotalThrees = 0]
[h: TotalFours = 0]
[h: TotalFives = 0]
[h: TotalSixes = 0]

[h: input(
"Dicepool|1|How many dice to roll? (max 30)"
)]
[r: Dicepool] Dice: [count(Dicepool), CODE:
{
   [Rawroll = 1d6]
   [h: Ones = IF(Rawroll == 1, 1, 0)]
   [h: Twos = IF(Rawroll == 2, 1, 0)]
   [h: Threes = IF(Rawroll == 3, 1, 0)]
   [h: Fours = IF(Rawroll == 4, 1, 0)]
   [h: Fives = IF(Rawroll == 5, 1, 0)]
   [h: Sixes = IF(Rawroll == 6, 1, 0)]
   [h: TotalOnes = TotalOnes + Ones]
   [h: TotalTwos = TotalTwos + Twos]
   [h: TotalThrees = TotalThrees + Threes]
   [h: TotalFours = TotalFours + Fours]
   [h: TotalFives = TotalFives + Fives]
   [h: TotalSixes = TotalSixes + Sixes]
}]

<br>Ones: [r: TotalOnes]
<br>Twos: [r: TotalTwos]
<br>Threes: [r: TotalThrees]
<br>Fours: [r: TotalFours]
<br>Fives: [r: TotalFives]
<br>Sixes: [r: TotalSixes]
And the scatterdie macro:

Code: Select all

[h: Direction = 1d12]
Scatterdice result: [r: Direction]<br>
9, 10, 11, 12 = hit<br>
1: North<br>
2: Northeast<br>
3: East<br>
4: Southeast<br>
5: South<br>
6: Southwest<br>
7: West<br>
8: Northwest<br>
1d6 roll: [1d6]<br>
2d6 roll: [2d6]
Fortunately we haven't had to use/find a Blast Template or Flamer Template yet, though that can't be too difficult to pull off.

Again, this is really overly simple, and not entirely automated. But it gets the job done. Just, uh, take my advice - when you give your tokens vision for LOS checking? Don't set vision to Day or Night. leave Vision "off" - otherwise it's calculating 500+ token's vision and that, uh, really lagged it up. XD

edit: Not entirely sure why, but the die roller macro only rolls 30 dice at a time. If you feed it more than 30 dice at once, it reduces that number to 30 and then rolls that. So, in the case of my Waaagh!ing Ork Boyz (2 base attacks, +1 dual wielding, +1 charging, +1 from the wierdboy Warpath power) which come in units of 30, I need to use the roll macro 5 times.

Albeit, that's 150 dice, but still. :P
"Always Make New Mistakes."

User avatar
aku
Dragon
Posts: 856
Joined: Wed Nov 15, 2006 9:03 am
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by aku »

wow, this would be kinda cool, i played warhammer a couple of times, with a friend in college, and enjoyed the game itself, but i SUCK at painting the figurines, so i avoided it, this could be all the fun, without the hassle! (and if you make me, i might even be able to "paint" tokens better than i could standing figurines heh)

User avatar
EvilSqueegee
Cave Troll
Posts: 81
Joined: Wed Dec 05, 2007 4:53 pm

Re: Warhammer 40k or Fantasy Wargame?

Post by EvilSqueegee »

aku wrote:wow, this would be kinda cool, i played warhammer a couple of times, with a friend in college, and enjoyed the game itself, but i SUCK at painting the figurines, so i avoided it, this could be all the fun, without the hassle! (and if you make me, i might even be able to "paint" tokens better than i could standing figurines heh)
We use tokens for the normal figures with circular bases. The vehicles we've spent a whole day searching for top-down photo's to shop up into tokens... you'd be suprised how hard it is to find top-downs of stuff (I spent hours upon hours just looking for an ork warbike.)

All in all we're having a blast. I'm playing W40k with a few friends from Canada and I haven't spent a dime yet. :D
"Always Make New Mistakes."

User avatar
aku
Dragon
Posts: 856
Joined: Wed Nov 15, 2006 9:03 am
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by aku »

i would need to buy the books, as i dont know the rules but other than that there wouldnt be much money to be spent

User avatar
EvilSqueegee
Cave Troll
Posts: 81
Joined: Wed Dec 05, 2007 4:53 pm

Re: Warhammer 40k or Fantasy Wargame?

Post by EvilSqueegee »

aku wrote:i would need to buy the books, as i dont know the rules but other than that there wouldnt be much money to be spent
No, just sweat blood and tears as you realise sticking your face in a meatgrinder is more appealing than trying to find a half-decent top-down view of an Ork Trukk. XD
"Always Make New Mistakes."

User avatar
aku
Dragon
Posts: 856
Joined: Wed Nov 15, 2006 9:03 am
Contact:

Re: Warhammer 40k or Fantasy Wargame?

Post by aku »

yea, and artistic rendering, either 2d or 3d, is not in my skillset :D

Post Reply

Return to “General Discussion”