Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

When creating a macro, can I get values from others?

I'm trying to create a macro for generating NPCs on the fly. Ideally, my macro would open a pop-up window and with a first drop-down menu for selecting a race. Each race has a set value of attributes. Since I'm using GURPS it's ST, DX, IQ and HT. My idea is that these values would come from each race's basic attribute and then I would roll a random value on top of it, say ST [[10+2d3]].  The second drop-down is select the level of the NPC (i.e., grunt, corporal, captain), to increase or decrease the attributes according to "challenge rating", which I know does not exist in GURPS, but bear with me. Above captain level, I would be tailoring NPCs to suit. The third drop-down would regard where armour is worn (torso-only, torso and arms, full body, etc), please note I'm not even counting the amount of damage resistance. Yet! The fourth drop, the kind of melee weapon (say, club). The fifth, the kind and quantity of range weapons (say, short-bow and 5 arrows) Finally, the macro would generate a character and place on the map (at a given position). Is this possible?
1524146097
The Aaron
Pro
API Scripter
I think you'd be firmly in the realm of an API script (pro subscriber perk) to get all of that working suitably.  If you can get it working with macros, it would likely require many levels of html escaping.
1524146294
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm working on something similar right now, and ran into this very issue. I think the best system is to use whatever you are comfortable working with (DB program, spreadsheet, preferred programming language) and use that to formulate a macros with all of that already in place. Then run that macro via copy-paste or similar.
keithcurtis said: I'm working on something similar right now, and ran into this very issue. I think the best system is to use whatever you are comfortable working with (DB program, spreadsheet, preferred programming language) and use that to formulate a macros with all of that already in place. Then run that macro via copy-paste or similar. Hi Keith, I'm a software engineer and it would be a nice challenge. Interesting, very interesting!
1524148291
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You have my admiration (as do all professional technical computer folk). I don't know an awful lot, but I make what I do know work very hard.
1524150851
Finderski
Pro
Sheet Author
Compendium Curator
One other thing to keep in mind, and why The Aaron recommended the API...macros can not update attributes on a character sheet.  That means you'd have to output everything to chat, then transcribe it all to a character sheet. If you want to do it as a macro, for the base races, I'd recommend setting up generic character sheets with the base stats and then you could refer to those sheets to get the base stats...
Finderski said: One other thing to keep in mind, and why The Aaron recommended the API...macros can not update attributes on a character sheet.  That means you'd have to output everything to chat, then transcribe it all to a character sheet. If you want to do it as a macro, for the base races, I'd recommend setting up generic character sheets with the base stats and then you could refer to those sheets to get the base stats... Thanks, Gears (head-gears, for that matter!) are in motion to create something I could Ctrl+C & Ctrl-V into roll20.
I made a series of macros to generate SWN characters. Using 30 rollable tables and a series of macros. In the end it was more work than I thought was justified, and took at least as long as doing it the traditional way. This may be easier with SWN2E, as Kevin Crawford did a lot of the work. I did use API scripts extensively, took me weeks to get it working, then the new edition came out and I gave up on the process.
I don't suppose GURPS is bound to release a new edition anytime soon (if ever again!). For my own NPC generator I would need a computer every time I host a game, but that's not really an issue here.