Setting up MT for Savage Worlds

Doc requests, organization, and submissions

Moderators: dorpond, trevor, Azhrei

User avatar
DrVesuvius
Giant
Posts: 199
Joined: Wed Jun 18, 2008 2:07 pm

Re: Setting up MT for Savage Worlds

Post by DrVesuvius »

RPTroll wrote:Well, its off to read up on Macro links.


Later:

Ok, I've played with the macrolink a bit. Currently the initiative call counts on the players token being selected before they draw a card. How do you handle this with a link? Would you whisper a link to each player in the init panel?

Currently I uses the following code
[h:CurrentPlayer = findToken(token.name) ]
[h:PlayerName = token.name]

How would these work when the link is called? What if they had multiple tokens selected. What if some were not owned by the player?

Here's the latest GetInit screenshot. Gar has the Quick edge (which allows for the redraw of any card under 5) and Level Headed (which allows for two card draws). In this case his final init value is 26.
I think you've got the logic wrong on combining Quick and Level Headed. p22 of the SW Explorers Edition says...
"Level Headed Characters draw their additional card and take the best before using their Quick Edge"
...which after a bit of debating our group interpreted as meaning (in rough pseudocode)

Draws 1st Initiative card
Draws 2nd Initiative card
Pick the best card of the two
While initiative Card <= 5
Draw another initiative Card
WhileEnd

It would give the same overall result in your example, but with fewer card draws, and has a slightly lower average initiative since you're not always picking the best of two cards that are both more than 5.

Coding for Quick is the one thing I haven't done yet, so you're ahead of me on that count! I haven't quite decided yet how I'm going to handle it.

As for non-core rules that affect initiative draws, there's a Slow (Major) Hindrance in Tour Of Darkness which actually works as the opposite of the Level Headed Edge (i.e. Draw two cards and pick the worst result). Buying Level Headed cancels it out, while Improved Level Headed lets you draw two cards and pick the best (like normal Level Headed). That's the only one I know about.

Dr V

User avatar
Amaril
Great Wyrm
Posts: 1058
Joined: Sun Nov 26, 2006 11:44 am
Location: Atlanta, GA
Contact:

Re: Setting up MT for Savage Worlds

Post by Amaril »

DrVesuvius wrote:I've just got my Adventure & Initiative deck draws working for b48
I'd love to get a copy of your code for the Adventure Deck.
Kristian

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Setting up MT for Savage Worlds

Post by RPTroll »

Dr. V, I bow to your group's debated analysis. I'll change the code. It will make for fewer card draws which is a good thing.

One thing I'm dieing for at present is the ability to get a tokens initiative index. I can get the value all day long but I would love to be able to get the index as well so I can notify the user the tokens received init.

I'm still working on the macrolink. I think, from what I've read, you can force the macro to call as soon as it hits the clients chat screen and that those macros will actually run on the server so the synchronization issues go away.

I'm bringing my server up for a while for anyone that want's to help test my cra... er stuff.

Server: RPTroll's Savage World
password: maptool


Later:

Ok, code changed so it does the Level Headed then Quick. Coding for the slow draw card will be interesting. :-)

I think an init dialog might be in order. You can use a macro link as part of a dialog as the action for a form. It should probably show the card drawn.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Setting up MT for Savage Worlds

Post by RPTroll »

Latest Campaign file

http://rptroll.com/SWv3B49Base.cmpgn

You select Lib:InitDeck for most of the GM init stuff. Each of the tokens should have the GetInit macro. Check out the four tokens for examples.

Next up is the rewriting of the Trait test macros along Dr. Vs dialog select.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Amaril
Great Wyrm
Posts: 1058
Joined: Sun Nov 26, 2006 11:44 am
Location: Atlanta, GA
Contact:

Re: Setting up MT for Savage Worlds

Post by Amaril »

RPTroll wrote:Latest Campaign file

http://rptroll.com/SWv3B49Base.cmpgn

You select Lib:InitDeck for most of the GM init stuff. Each of the tokens should have the GetInit macro. Check out the four tokens for examples.

Next up is the rewriting of the Trait test macros along Dr. Vs dialog select.
Does this include the sortinit hold until everyone has drawn?

By the way, for everyone else who's interested, I got to see this first hand, and it's awesome work. There's a lot of great checks throughout the code that keep the game running smoothly!
Kristian

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Setting up MT for Savage Worlds

Post by RPTroll »

Not as yet. I'll have to add the check to make sure no one is at init=0.

Working on character sheet now. Next up, the card sheet to show adventure deck cards and init cards.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Amaril
Great Wyrm
Posts: 1058
Joined: Sun Nov 26, 2006 11:44 am
Location: Atlanta, GA
Contact:

Re: Setting up MT for Savage Worlds

Post by Amaril »

RPTroll wrote:Working on character sheet now.
Ooh, include Bennies using the Smiling Jack image!
Kristian

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Setting up MT for Savage Worlds

Post by RPTroll »

Oh yes. :-)

If its a wild card it will have smiling jack on it
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Amaril
Great Wyrm
Posts: 1058
Joined: Sun Nov 26, 2006 11:44 am
Location: Atlanta, GA
Contact:

Re: Setting up MT for Savage Worlds

Post by Amaril »

I'm cleaning up some of the formatting of the output, specifically checking for inconsistencies and streamlining the presentation. I did find that the Next! macro calls the sortInitiative function. Is that necessary or redundant since SortInit has to be run independently for this macro setup to work? I assume it's leftover from the previous version.
Kristian

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Setting up MT for Savage Worlds

Post by RPTroll »

I believe you are correct. You should test it first to make sure it functions properly, however.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Amaril
Great Wyrm
Posts: 1058
Joined: Sun Nov 26, 2006 11:44 am
Location: Atlanta, GA
Contact:

Re: Setting up MT for Savage Worlds

Post by Amaril »

RPTroll wrote:Not as yet. I'll have to add the check to make sure no one is at init=0.
When you get that done, post the code and I'll drop it into my edited macros. Once I have the macros edited, I'll put the campaign file up.
Kristian

User avatar
Amaril
Great Wyrm
Posts: 1058
Joined: Sun Nov 26, 2006 11:44 am
Location: Atlanta, GA
Contact:

Re: Setting up MT for Savage Worlds

Post by Amaril »

I'm noticing that the first round seems to always be 0. I rewrote it as follows:

Code: Select all

[setInitiativeRound(if(getInitiativeRound() == -1,1,getInitiativeRound()+1))]
[h:sortInitiative()]
[h:setCurrentInitiative(-1)]
This moves the setting of the round to the beginning of the macro, first checking if it's default at -1 and setting it to 1, or bumping it up by 1 if it's already at 1 or more.
Kristian

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Setting up MT for Savage Worlds

Post by RPTroll »

Thinking on this further, we may need to leave it as is. Someone could be afk for a bit and its probably correct to leave them zero but you may want to go ahead and start the round.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
DrVesuvius
Giant
Posts: 199
Joined: Wed Jun 18, 2008 2:07 pm

Re: Setting up MT for Savage Worlds

Post by DrVesuvius »

Amaril wrote:I'd love to get a copy of your code for the Adventure Deck.
I'll dig it out later today. Of course since writing it I've thought of a few changes I'd like to make :-)

User avatar
DrVesuvius
Giant
Posts: 199
Joined: Wed Jun 18, 2008 2:07 pm

Re: Setting up MT for Savage Worlds

Post by DrVesuvius »

Dr Vesuvius's Adventure Deck Macros

Pre-requisites
(1) Lib:GM token with the following attributes

AdventureDeck:1,2,3,4,5,6,7,...,52,53,54
RequestedAdventureCard:";"
PlayedAdventureCard:";"

AdventureDeck is a list of numbers corresponding to each card number in the deck
RequestedAdventureCard is a StrProp which will temporarily hold a token name and the card they want to play
PlayedAdventureCard is another StrProp which will hold the last card played and who played it.

(2) A table called "Adventure" numbered 1-54 containing the text and image of every adventure card.

Token Macros

(1) Draw Adventure Card
This macro calls the corresponding macro from Lib:GM and adds the result it returns to the token's hand. I think the reason I put the "add to hand" code here was because the Lib:GM macro changes the active token to Lib:GM. Could work around this easily enough if you want to limit all your token macros to stubs.

Code: Select all

<!--	DrawAdventure	-->

[MACRO("DrawAdventureCard@Lib:GM"): 0]
[H: CardDrawn = macro.return]

[H: AdventureCardHand =listAppend(AdventureCardHand+"", CardDrawn+"")]
(2) View Adventure Card (see Lib:GM tokens)
This macro is a stub that just calls the corresponding macro from Lib:GM

Code: Select all

<!--	ViewAdventure	-->

[MACRO("ViewCardHand@Lib:GM"): 0 ]
[H: abort(0)]
Lib:GM Macros

(1) DrawAdventureCard
Draws a card from the Adventure deck and returns the number to the calling macro. It displays that the character has drawn a card but does not display it.

Code: Select all

<!--	DrawAdventureCard	-->

[h:CurrentPlayer = findToken(token.name) ]
[h:PlayerName = token.name]
[h:switchToken("Lib:GM")]

[H: NoOfCardsInDeck = listCount(AdventureDeck)]
[H: DrawPseudoDie = '1d'+NoOfCardsInDeck]
[H: CardRolled = eval(DrawPseudoDie)-1]
[H: CardDrawn = listGet(AdventureDeck,CardRolled)]
[H: AdventureDeck = listDelete(AdventureDeck, CardRolled)]
[H: macro.return = CardDrawn]
draws a card from the Adventure Deck
(2) ViewCardHand
This plugs into my existing character sheet frame and displays a simple list of the cards in the hand, showing picture, text and two macrolinks "Play This Card Now" or "Discard This Card Now"

Code: Select all

<--	ViewCardHand	-->

[Frame("CharSheet"): { 
  <html>
    <head> 
      <title>[R: TokenViewed = getImpersonatedName() ] Adventure Card Hand</title> 
    </head> 
    <body>
      <table>
        [foreach(Card, AdventureCardHand, ""), code: {
          [H: Callback = "PlayAdventureCard@" + getMacroLocation()]	  
           <tr>
            <td>
              <image src='[R: tableImage("Adventure",Card)]' ></image>
            </td>
            <td width = "400">
              <table>
                <tr>
                  <td>
                    [R: table("Adventure",Card)]
                  </td>
                </tr>
                <tr>
                  <td>
                    [R: macroLink("Play This Card Now", "PlayAdventureCard@" + getMacroLocation(), "gm", Card,"selected")]
	<br>
                    [R: macroLink("Discard This Card Now", "DiscardAdventureCard@" + getMacroLocation(), "gm", Card,"selected")]
                  </td>
                </tr>
              </table>
	    </td>
          </tr>
	}] 
      </table>
    </body> 
  </html>
}
]
(3) PlayAdventureCard
Because of the restriction in b48, macrolinks were only able to display direct to the GM or the player themselves, not to all players. To get around this, instead of simply playing the card and announcing it to everyone, this macro sends the card to the GM who must then approve it separately announcing it to all players. With hindsight, I think this is probably the best approach to take anyway, since players have a tendency to suggest pretty tenuous/munchkiny/outright incorrect uses for Adventure cards at times, and I often find I have to veto them, like "No you can't use the Romance card to find treasure, no matter how much you love gold." :) This does not remove the card from the player's hand until the GM approves the card's use.

Code: Select all

<!--	PlayAdventureCard	-->

<br>
[H: CardPlayed = macro.args ]
[R: PlayerName=token.name]
would like to play an Adventure Card! <br>
<img src='[R: tableImage("Adventure",CardPlayed)]'></image>
<br>
[R: table("Adventure",CardPlayed)]

[H, token("Lib:GM"): RequestedAdventureCard = "Player = "+PlayerName+"; CardPlayed = "+CardPlayed]
(4) DiscardAdventureCard
Self explanatory

Code: Select all

<!--	DiscardAdventureCard	-->

<br>
[H: CardPlayed = macro.args ]
[R: PlayerName=token.name]
discards an Adventure Card! <br>

[H: CardToRemove = listFind(AdventureCardHand+"", CardPlayed+"")]
[H: AdventureCardHand = listDelete(AdventureCardHand+"", CardToRemove)]
(5) ApproveCard
This is the macro used by the GM to approve the use of a proposed Adventure Card. It removes it from the player's hand and announces it to all players.

Code: Select all

<!--	ApproveCard	-->

[H, token("Lib:GM"): PlayerName = getStrProp(RequestedAdventureCard, "Player")] 
[H, token("Lib:GM"): CardPlayed = getStrProp(RequestedAdventureCard, "CardPlayed")] 

[R: PlayerName] has played an Adventure Card! <br>
<img src='[R: tableImage("Adventure",CardPlayed)]'></image>
<br>
[R: table("Adventure",CardPlayed)]

[H, token(PlayerName): CardToRemove = listFind(AdventureCardHand+"", CardPlayed+"")]
[H, token(PlayerName): AdventureCardHand = listDelete(AdventureCardHand+"", CardToRemove)]

[H, token("Lib:GM"): PlayedAdventureCard = RequestedAdventureCard]
[H, token("Lib:GM"): RequestedAdventureCard = ";"]
(6) LastCardPlayed
In case the GM needs to check who played the last Adventure Card

Code: Select all

<!--	LastCardPlayed	-->

[H, token("Lib:GM"): PlayerName = getStrProp(PlayedAdventureCard, "Player")] 
[H, token("Lib:GM"): CardPlayed = getStrProp(PlayedAdventureCard, "CardPlayed")] 

[R: PlayerName] played the last Adventure Card! <br>
<img src='[R: tableImage("Adventure",CardPlayed)]'></image>
<br>
[R: table("Adventure",CardPlayed)]
(7) ShuffleAdventure
This just resets to the default value of the Adventure deck. In theory this might mean it's possible to have duplicate cards in play. In practice this would only be done at the start of a session when player's adventure hands should be emptied anyway.

Code: Select all

<!--	ShuffleAdventure	-->
[h:switchToken("Lib:GM")]
[H: AdventureDeck = getPropertyDefault('AdventureDeck')]
The Adventure Deck has been Shuffled.
And here's what it looks like. You can probably see one drawback already - the player must refresh their adventure hand view when the GM approves the card they've played. Not sure if it's possible to get this to update automatically.

Image

Hope this is of some use to someone.

Post Reply

Return to “Documentation Requests/Discussion”