Problems Making Macro Output Private

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
HypnoTech
Kobold
Posts: 10
Joined: Sun Jul 20, 2014 5:03 am

Problems Making Macro Output Private

Post by HypnoTech »

Hello, all...

I'm getting back into DMing, and I had an idea for making a quick NPC macro, which works just fine. However, no matter what I try (/g, /w, /self), I can't seem to make the output work as a private message. As-is, it posts the output just fine to the normal chat. However, any attempt to make it a DM-only output either posts the entire macro's contents into the chat, or only posts the text, while wanting values for the {} variables.

If anyone can help me sort this one out, I'd appreciate it.

On a side note, if anyone can help convert this into a json array based macro that doesn't require a library token or tables, feel free to do so. I know it's nicer code, but it's been a couple of years, and I'm a bit rusty. Ideally, I would also love to have it make weighted rolls within each category, too, along the lines of "Friendly, 60%; Neutral 20%, Hostile 20%". I thought about doing it as some sort of if/then ranged roll, but figured there might be an easier/faster way to handle it.

Thank you in advance for your help.

Here's the prototype I've cobbled together, so far:

Code: Select all

[Mood1 = "Friendly"]
[Mood2 = "Neutral"]
[Mood3 = "Hostile"]
[Num0 = 1d3]
[V0 = "Mood" + Num0]
[MoodChoice = eval(V0)]

[Hair1 = "Black"]
[Hair2 = "Brown"]
[Hair3 = "Red"]
[Hair4 = "Blonde"]
[Hair5 = "Grey"]
[Num1 = 1d5]
[V1 = "Hair" + Num1]
[HairChoice = eval(V1)]

[Attraction1 = "Men"]
[Attraction2 = "Women"]
[Attraction3 = "Men and Women"]
[Num2 = 1d3]
[V2 = "Attraction" + Num2]
[AttractionChoice = eval(V2)]

[Religion1 = "Lioewind (N)"]
[Religion2 = "Awildianides (NG)"]
[Religion3 = "Olobarak (LG)"]
[Religion4 = "Taureada (CG)"]
[Religion5 = "Nemeion (LN)"]
[Religion6 = "Barrachus (CN)"]
[Num3 = 1d6]
[V3 = "Religion" + Num3]
[ReligionChoice = eval(V3)]

NPC has {HairChoice} hair, a {MoodChoice} demeanor, is a follower of {ReligionChoice}, and is attracted to {AttractionChoice}.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Problems Making Macro Output Private

Post by aliasmask »

Code: Select all

[H: moods = "Friendly,Neutral,Hostile"]
<!-- hacky method -->
[H: MoodChoice = listGet(moods,max(0,1d5-3))]

<!-- OR -->
[H: choice = 1d100]
<!-- last value should almost be greater than max value -->
[H: moodWeights = "1,61,81,101"]
[H, foreach(weight,moodWeights), code: {
   [H, if(weight <= choice): result = roll.count]
}]
[H: MoodChoice = listGet(moods,choice)]


[H: hairColors = "Black,Brown,Red,Blonde,Grey")]
[H: HairChoice = listGet(hairColors,1d5-1)]

[H: attractions = "Men,Women,Men and Women"]
[H: AttractionChoice = listGet(attractions,1d3-1)]

[H: religions = "Lioewind (N),Awildianides (NG),Olobarak (LG),Taureada (CG),Nemeion (LN),Barrachus (CN)"]
[H: ReligionChoice = listGet(religions,1d6-1)]

[R: strformat("NPC has %{HairChoice} hair, a %{MoodChoice} demeanor, is a follower of %{ReligionChoice}, and is attracted to %{AttractionChoice}.")] 

HypnoTech
Kobold
Posts: 10
Joined: Sun Jul 20, 2014 5:03 am

Re: Problems Making Macro Output Private

Post by HypnoTech »

Thank you for that, aliasmask. I ended up using the "hacky" method, as the other one simply wasn't working for me. I even tried altering it a few different ways, as I had a feeling it was tied to the "weight" variable not being declared. I know it's going to be something simple, either way.

I also figured out what the problem was with why I couldn't keep everything "DM-Only", too. Namely, "Slash commands will only work correctly in a MapTool macro if they are the first text in the macro." The whole time, I was doing everything on the actual output line. lol

Post Reply

Return to “Macros”