Thread: Drag from character sheet
-
September 17th, 2007, 05:36 #1
Drag from character sheet
I would like to open a project for anyone who would like to take it.
My problem is that of many people; if a player is not present at a game session, it is difficult to put his/her character on the combat tracker.
We can access the character sheet trough the characters button on the top of the UI wich takes more time then to access the characters of the players that are present but still it is not that difficult.
Putting the missing players on the combat tracker is another thing altogether.
The only way is to open a client instance and load them from the portraits.
Here is the leading idea where I'd like help on.
Once on the combat tracker, any entry, be it a PC or NPC has a round link icon on it's right. Once pressed, it opens either the charsheet of the character or the personality sheet of the NPC. Can someone come up with a way to put that or more exactly the square equivalent of personality sheets on the Main character tab.
This could be dragged as the Character Portrait on the top left of the UI to give a token or to give a link if dragged in the combat tracker directly...Always keep it in perspective!
-
September 17th, 2007, 05:45 #2
In my game I've just had other players open up missing characters so the portraits are all available above the chatlog. Then I just drag 'em into the combat tracker as normal. Are you concerned about players being able to manipulate one another's sheets? Granted, all the games I play are with friends I've known for years, so this may not work for some people.
-
September 17th, 2007, 05:57 #3
Nah, I just need something I can work with while preparing the games.
That way I can prepare maps and combat tracker instancesAlways keep it in perspective!
-
September 17th, 2007, 07:55 #4
Hmm... adding the link is simply a matter of adding a referencecontrol
e.g.
Code:<windowreferencecontrol name="open"> <bounds>-30,15,20,20</bounds> <icon> <normal>button_openwindow</normal> <pressed>button_emptytarget</pressed> </icon> <class>charsheet</class> <description> <field>name</field> </description> </windowreferencecontrol>
I'll see if I can figure it out tomorrow. Have a game to get to right now...Work Less, Game More!
-
September 17th, 2007, 09:32 #5
Oh and btw, I think it would be nicer if there was a portrait instead of the little circle (or box).
That way, there'd be a portrait on the character sheet as wellAlways keep it in perspective!
-
September 17th, 2007, 21:30 #6
Add this to charsheet_toplevel.xml (just before the closing </sheetdata> tag so the portrait is drawn last and therefore is on top of all other controls)
Code:<genericcontrolname="PortraitFrame"> <bounds>-37,18,25,25</bounds> <icon>invisible_icon</icon> <scriptfile="scripts\charsheet_portrait.lua" /> </genericcontrol>
Code:local portraitwidget; function onInit() if window.getDatabaseNode() then if window.getDatabaseNode().getName() then -- small portrait portraitwidget = window.PortraitFrame.addBitmapWidget("portrait_" .. window.getDatabaseNode().getName().. "_token"); -- full-sized portrait -- portraitwidget = window.PortraitFrame.addBitmapWidget("portrait_" .. window.getDatabaseNode().getName().. "_charlist"); end end end function onDrag(button, x, y, dragdata) dragdata.setType("playercharacter"); dragdata.setDatabaseNode(window.getDatabaseNode()); dragdata.setTokenData("portrait_" .. window.getDatabaseNode().getName().. "_token"); return dragdata; end
Work Less, Game More!
-
September 18th, 2007, 07:18 #7
A very nice little script.
Two nits to pick to make it use though.
Code:<genericcontrolname="PortraitFrame"> <bounds>-37,18,25,25</bounds> <icon>invisible_icon</icon> <scriptfile="scripts\charsheet_portrait.lua" /> </genericcontrol>
Code:<genericcontrol name="PortraitFrame"> <bounds>-37,18,25,25</bounds> <icon>invisible_icon</icon> <script file="scripts\charsheet_portrait.lua" /> </genericcontrol>
-
September 18th, 2007, 11:12 #8
Thanks a bunch!
This is more then welcomed
I modified your code to:
- Be able to drag a token out of it.
You can put the token on the table or on a map. - Have also an "Add Identity" bubble like for personalities.
I think it could help when you have to speak for that character when he/she is not present at the session.
Without your help, I wouldn't have figured the way to link the database with the portrait, thanks again
p.s. Feel free to rectify my code if you see unneeded/unwanted stuff.
character_portrait.lua
Code:local portraitwidget; function onInit() if window.getDatabaseNode() then if window.getDatabaseNode().getName() then -- small portrait portraitwidget = window.PortraitFrame.addBitmapWidget("portrait_" .. window.getDatabaseNode().getName().. "_token"); -- full-sized portrait -- portraitwidget = window.PortraitFrame.addBitmapWidget("portrait_" .. window.getDatabaseNode().getName().. "_charlist"); end end end function onDrag(button, x, y, dragdata) dragdata.setType("playercharacter"); dragdata.setTokenData("portrait_" .. window.getDatabaseNode().getName().. "_token"); dragdata.setDatabaseNode(window.getDatabaseNode()); dragdata.setStringData(window.getDatabaseNode().getName()); local base = dragdata.createBaseData(); base.setType("token"); base.setTokenData("portrait_" .. window.getDatabaseNode().getName() .. "_token"); return dragdata; end
charsheet_toplevel.xml just before </sheetdata>
Code:<genericcontrol name="PortraitFrame"> <bounds>-37,18,25,25</bounds> <icon>invisible_icon</icon> <script file="scripts\charsheet_portrait.lua" /> </genericcontrol> <stringfield name="name" source="name"> <anchored> <to>PortraitFrame</to> <position>over</position> <offset>-14,-10</offset> <top> <offset>22</offset> </top> </anchored> <frame> <name>textline</name> <offset>2,0,2,0</offset> </frame> </stringfield> <buttoncontrol> <bounds>-30,50,23,22</bounds> <icon> <normal>button_identityactivate</normal> <pressed>button_identityactivate_down</pressed> </icon> <script> function onButtonPress() GmIdentityManager.addIdentity(window.name.getValue()); end </script> </buttoncontrol>
-EDIT-
One small problem; when I create a new character, the client side can see the portrait (wich is empty) right of the bat. The Host cannot see anything until the client chooses a portrait...Last edited by Tokuriku; September 18th, 2007 at 23:18.
Always keep it in perspective!
- Be able to drag a token out of it.
-
September 19th, 2007, 01:55 #9
[QUOTE =Oberoten]
Wlll need two added spaces:
[/quote]
That was weird. Cut-n pasted from my file so am not sure why the spaces got removed
Forgot to mention that the "invisible_icon" I used will need to be defined too (I used a 15x15 fully transparent png) - OR use a different image, maybe a 'blank token image' might help with your client/host issue for new players Kenshin?
I think what happens behind the scenes is that a 'prototype' (blank portrait) token is generated for a new player. Not sure exactly why the host doesn't see that but I assume that because it's just a 'prototype' FG doesn't send it to the host/other players.
EDIT - thanks for the token code too. Was a bit confused about the createBaseData till I saw how you had used itLast edited by Toadwart; September 19th, 2007 at 04:43.
Work Less, Game More!
-
September 19th, 2007, 09:04 #10
Thanks for everything
I replaced the invisible icon by the Token Icon so now at least there is something there.
You can drag it into the combat tracker but no token will come out of it of course.
Also made the "Name" stringfield invisibleAlways keep it in perspective!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks