Discussion and Support

Skip to content

It is currently Sat Jan 20, 2018 8:13 am 

Reply to topic  [ 3 posts ] 

Previous topic | Next topic 

  Print view

Author Message
Joined: Sun Jul 20, 2014 4:03 am
Posts: 10
 Post subject: Problems Making Macro Output Private
PostPosted: Mon Sep 18, 2017 4:28 pm 
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:
[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  Offline
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7984
Location: Bay Area
 Post subject: Re: Problems Making Macro Output Private
PostPosted: Mon Sep 18, 2017 6:00 pm 
[Hmoods "Friendly,Neutral,Hostile"]
hacky method -->
HMoodChoice listGet(moods,max(0,1d5-3))]

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

HhairColors "Black,Brown,Red,Blonde,Grey")]
HHairChoice listGet(hairColors,1d5-1)]

Hattractions "Men,Women,Men and Women"]
HAttractionChoice listGet(attractions,1d3-1)]

Hreligions "Lioewind (N),Awildianides (NG),Olobarak (LG),Taureada (CG),Nemeion (LN),Barrachus (CN)"]
HReligionChoice listGet(religions,1d6-1)]

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


Joined: Sun Jul 20, 2014 4:03 am
Posts: 10
 Post subject: Re: Problems Making Macro Output Private
PostPosted: Mon Sep 18, 2017 8:35 pm 
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

Display posts from previous:  Sort by  
Reply to topic  [ 3 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman