#Okay I think me being syntax stupid is

1 messages · Page 1 of 1 (latest)

regal trout
#

Are you familiar enough with coding to understand the difference between a string and a variable? (just gauging how much you know so I know how much to answer)

true sage
#

I understand the concept, yes. I don't know the syntax to distinguish them in this case.

regal trout
#

Ok, so you're trying to use a variable in the string. But you're not doing anything to actually tell the string that it's a variable. So it's just directly using the <stuff you typed in> as though it's a string.

Do a quick readup on javascript string interpolation.

Short answer
You're doing

`variable1 variable2`

What you want is

`${variable1} ${variable2}`

(Though I suggest adding a colon or dash or something between them for readability, assuming that works fine with whatever text-to-speech program your player is using)

#

A slightly more detailed example

you're doing

`Your variable1 skill is +variable2`

And you want

`Your ${variable1} skill is +${variable2}`

(obviously this assumes positive modifiers, but it's just an example)

true sage
#

That's exactly what I was missing! And that's a really good idea, definitely. I've been trying to get some basics in place for the game but haven't had time to start trying to really understand JavaScript yet.

#

I don't suppose there's an easy way to pass a string from the /macro chat command into the macro itself, so I can have one macro that would list every skill? (Like: /macro skill TEXT where TEXT could be "acr" or whatever.)

regal trout
#

I don't believe you can do that by default. There might be a mod that allows that, but generally those mods aren't needed for PF1 because pf1 already has special use-cases for macro when abilities are used that covers most of the use cases those other mods are for. Give me a minute to double check a couple different mods I know of and I'll let you know

true sage
#

Thank you!

regal trout
true sage
#

Awesome, thanks!

regal trout
#

I don't know if it overrides anything that pf1 is doing to provide its own additional functionality for macros, though

true sage
#

If I end up having to write separate macros for each skill, it's not that big a deal. But I'll see what this can do!

#

Thanks very much for your help. 🙂

regal trout
#

You might be able to do something like "write a macro that shows a dialog, the dialog has a select dropdown with all of the choices, the player picks one of the choices, then that one macro rolls the selected choice"

That might be a bit much if he just wants to double check his modifier, though

#

But yeah if that mod works that sounds like it'll be the easiest for your use case

true sage
#

Yeah, the less he has to deal with dialog windows the better. They're hard for him to navigate.