Thread: Extension to change GM portrait
-
December 17th, 2015, 05:43 #41
Thank you Trenloe. Im sure I have asked you that before and been told that before!
One more follow up if I may.
Can I set the value of one of these strings to a database entry? Could have a string cycler in Options and then you would have to reboot to get the new settings...?
-
December 17th, 2015, 05:44 #42
I thought I might post this version up for some of you old timers.... JohnD - are you watching?
Attachment 12234
-
December 17th, 2015, 06:34 #43
Last edited by Trenloe; December 17th, 2015 at 06:40.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
December 17th, 2015, 08:28 #44"I am a Canadian, free to speak without fear, free to worship in my own way, free to stand for what I think right, free to oppose what I believe wrong, or free to choose those who shall govern my country. This heritage of freedom I pledge to uphold for myself and all mankind."
- John Diefenbaker
RIP Canada, February 21, 2022
-
December 17th, 2015, 11:43 #45
Your first response of "Nope" would have saved me a lot of time!
I was working on this till late last night - I had 6 icons and built a cycler in options but I could resolve one or more of these situations -
1. how/where to define the full path and filename for the icon? i think defining it as a string?
2. how/where to set the value of "portrait_gm_token"
i can get it from OptionsManager local sGMIcon = OptionsManager.getOption("gmicon");
or i can get it from the database
<options>
<public />
<gmicon type="string">graphics/portraits/gm-gary.png</gmicon>
</options>
-
December 17th, 2015, 15:54 #46
See post 40 as well as my response above. A "valid predefined icon resource" is defined in the ruleset or extension (as mentioned above) using the <icon> tag: https://www.fantasygrounds.com/refdoc/icon.xcp
It is the name of these icon resources that you have to use for msg.icon (as mentioned I post #40). But you'd need to change the ruleset in the places where msg.icon is set (off the top of my head, three different CoreRPG files).
You can have a string cycler that cycles around he different, valid, icon resource names, and the use that icon resource name.
You were on the right track, but you weren't looking at "valid icon resources".
So:
1) set the path to the graphics file in the static <icon> definition in the ruleset or extension. One for each icon you want to use. They will have unique <icon> names.
2) setup your string cycler to go through these <icon> names.
3) find in files for when portrait_gm_token is used as the icon name in the message data structure in the CoreRPG ruleset and replace that with the icon name from your string handler.
You could store the icon resource name in the database if you wanted, but you may as well use a string cycler in the options screen and access the value from OptionsManager.Last edited by Trenloe; December 17th, 2015 at 15:56.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
December 17th, 2015, 16:18 #47
The process is very similar to adding a custom decal: https://www.fg-con.com/wp-content/up...ecal_Class.pdf Something you, Damian, should be very familiar with!
You'll need to set the new campaign option (sounds like you've already done that), and then use the value of the icon resource name where "portrait_gm_token" is usually used to set the icon in the message data structure in the ruleset.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
December 18th, 2015, 00:51 #48"I am a Canadian, free to speak without fear, free to worship in my own way, free to stand for what I think right, free to oppose what I believe wrong, or free to choose those who shall govern my country. This heritage of freedom I pledge to uphold for myself and all mankind."
- John Diefenbaker
RIP Canada, February 21, 2022
-
December 18th, 2015, 03:54 #49
-
December 18th, 2015, 16:14 #50
Thank you damned for this extension!
"We adore chaos because we love to produce order."
M.C. Escher
"Let's face it: for some people, roleplaying is a serious challenge, a life-or-death struggle."
J. M. Caparula / Scott Haring
"It emerges that physics is basic but inessential; that is the crucial fact."
Wolfgang Smith
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks