Is there a way to create a random list in maptools, possibly using the table function. Effectivley I want to have a fixed list of descriptions and place them in a random order when I execute the macro.
In game terms for pathfinder what I want to do is be able to randomly list the things a character discovers about a creature when they identify it. e.g. special attacks, defences, resistances, immunities. however I want to randomise the order they are listed, as depending on their identify roll they may discover 1 or many of the creatures abilities.
I was hoping to put them in a table and then list the whole table when executing the macro, but have it displayed in a random order.
Thanks for your help in advance
Grant
Creating a random list
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Creating a random list
Raileth
Re: Creating a random list
Many ways you could do this, but simply by entering the data into a table, the table will take care of randomising the result every time you call it.
However if you want to avoid duplicates, you are going to have to do a bit more coding
I would be inclined to have a field on each monster of "detectable attributes" and store the things as a Listof a JSON array. Then you could have one function that could be called on all monsters. If you wanted to get really advanced, you could make it callable from the players and then targeted on a monster
The nice thing about JSON arrays is the shuffle command. So if you had all the items in a JSON, you could shuffle, determine how many items the player had discovered and then reveal the first X items from the JSON.
Let us know how you get on
However if you want to avoid duplicates, you are going to have to do a bit more coding
I would be inclined to have a field on each monster of "detectable attributes" and store the things as a Listof a JSON array. Then you could have one function that could be called on all monsters. If you wanted to get really advanced, you could make it callable from the players and then targeted on a monster
The nice thing about JSON arrays is the shuffle command. So if you had all the items in a JSON, you could shuffle, determine how many items the player had discovered and then reveal the first X items from the JSON.
Let us know how you get on
Re: Creating a random list
Do you want to randomize the categories or that actual attributes to be revealed? I would make a json array of what you want randomized and use json.shuffle then reveal the listed items starting at the 0 index of the array. I was actually thinking of doing this myself. Perhaps have a list of property names, shuffle the list and based on the success reveal the property values.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Creating a random list
I was only looking at the categories, as im not planning on entering all of the individual creatures infor, effectively I wanted to list the categories the player had discovered, the reason for wanting the full list was if the forst category e.g. resistances, was not something the creature had, then id just move down the list to the next category.
I'll have a play with the json.shuffle command as that sounds like the solution.
Thanks for the super quick replies
Grant
I'll have a play with the json.shuffle command as that sounds like the solution.
Thanks for the super quick replies
Grant
Raileth