help with writing text in a input marco

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
User avatar
Bengalelf
Dragon
Posts: 396
Joined: Tue Mar 18, 2008 3:07 pm

help with writing text in a input marco

Post by Bengalelf »

I have veggies wonderful inputinit macro for adding tokens to the initiative tracker.

Code: Select all

[H: status = input(
  "init     | " + lastInit + "       | Initiative  | TEXT | WIDTH=5",
  "initDice | +0d6, +1d6, +2d6, +3d6, +4d6, +5d6 | Init. Dice | LIST | SELECT=" + lastInitDice,
  "wounds  | Do not include, Include P & S, Include P & S & M | Use wounds | LIST | SELECT=" + lastWounds
)]
[H: abort(status)]
During playtesting I noticed I am having trouble remembering npcs initiatives. So I thought, to help me out, it would be helpful for the macro to show me the selected tokens initiative in the input field. Now I have tried putting

Code: Select all

[r:initiative
in just behind the

Code: Select all

[H: status = input(
and It does not work. Also I tired putting it in front of the Status input. That way the macro works, but it does not show me the selected tokens initiative. How do I have the property 'initiative' display on the input field?


User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: help with writing text in a input marco

Post by CoveredInFish »

If I got this right you want to show the value in that dialog?

Then you need to add a field like this to the input()-call.

Code: Select all

 "dummy     | " + getProperty("Initiative") + "       | Ini Value |TEXT|WIDTH=5",
I dont know if the right token context is established as I dont know veggies framework (at least not that well). Maybe you need to get a token ID from somewhere... (maybe Wiki: getSelected())

User avatar
Bengalelf
Dragon
Posts: 396
Joined: Tue Mar 18, 2008 3:07 pm

Re: help with writing text in a input marco

Post by Bengalelf »

That is working so far. Yeah Fishy, you are my hero. I do have a couple of questions. Here is what the box looks like.
Untitled.png
Untitled.png (28.1 KiB) Viewed 943 times
Any way to have it just print out iniValue and then the value Initiative without putting initiative in a box?

Second question why did you start the line of code with dummy?

User avatar
Bone White
Great Wyrm
Posts: 1124
Joined: Tue Aug 23, 2011 11:41 am
Location: Cornwall, UK

Re: help with writing text in a input marco

Post by Bone White »

Because an input line with the type "LABEL" does not output a value to a variable, therefore a "dummy" variable is used.

This is actually the line you want to use to just show a value without having an input box/field.

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: help with writing text in a input marco

Post by CoveredInFish »

Yeah what he said. See Wiki: input() for the label options and an example.

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: help with writing text in a input marco

Post by Irrlicht »

Bengalelf wrote: Any way to have it just print out iniValue and then the value Initiative without putting initiative in a box?
Maybe this is what you want?

Code: Select all

  "init     | " + lastInit + "       | Initiative " + getProperty("Initiative") + "  | TEXT | WIDTH=5",
Basically, add that thing not to the input field, but to the displayed text...
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

Post Reply

Return to “Macros”