PDA

View Full Version : Setting up fields for drag and drop



Ranzarok
July 20th, 2019, 21:35
I have my item window set up the way I want (except for hiding certain fields based on "Type" selected with the cycler while window is unlocked). I was looking through the CoreRPG ruleset record_char_inventory.xml, template_char.xml, template_common.xml and ItemManager(manager_item.lua) in order to figure out how to set up my Attack window to accept drag and drop and grab the correct data to populate it.

My Attack frame will already accept drag/drop but right now it displays name and reference link.

record_char_more.xml

<string_labeled name="weaponlabels" >
<anchored to="weaponframe" position="insidetopleft" offset="15,20" width="590" />
<labelres>char_label_weaponlabels</labelres>
</string_labeled>

<list_text name="testthis">

<anchored to="weaponframe">
<left offset="15" />
<top offset="45" />
<right offset="-20" />
<bottom offset="-5" />
</anchored>

<newfocus>name</newfocus>
<datasource>.testlist</datasource>
<class>char_test</class>
<acceptdrop>
<class>referencetext</class>
<class>referencetextwide</class>
<field>*</field>
</acceptdrop>
</list_text>

I would also like to attach MoreCore's sCMD "crom" as a dice roller after dragging it into the frame (based on the "Damage [CD]" field of the item), but I'll tackle that after I get this working.

Any advice on the most efficient way to achieve this? Thanks for any input.

https://i.imgur.com/ohvOiqB.jpg

superteddy57
July 24th, 2019, 15:53
Damned covers that sort of thing in his videos. Not sure which one. I would look over them again about the Class drop, it would be the same thing in regards to what you are trying to accomplish.

damned
July 25th, 2019, 06:51
https://www.youtube.com/watch?v=c9RyzgeiQOI&list=PLsgd1zJLdiKW23yt4X2qc_9w1TWQfTPUA&index=11
https://www.youtube.com/watch?v=PPmDMxCgQRg&list=PLsgd1zJLdiKW23yt4X2qc_9w1TWQfTPUA&index=12
https://www.youtube.com/watch?v=YkWALRzhUHY&list=PLsgd1zJLdiKW23yt4X2qc_9w1TWQfTPUA&index=13
https://www.youtube.com/watch?v=jBCHdxZczXE&list=PLsgd1zJLdiKW23yt4X2qc_9w1TWQfTPUA&index=14

Ranzarok
July 25th, 2019, 23:05
Thanks for the direction, I will make sure to watch the vids.

damned, where might I find the char sheet extension that you created in the videos?

superteddy57
July 26th, 2019, 02:55
He isn't finished it but you can see some of it from this thread:
https://www.fantasygrounds.com/forums/showthread.php?46553-MoreCore-Coding-Tutorials

Ranzarok
July 26th, 2019, 06:58
Thanks superteddy

With your suggestion and damned's videos, I managed to get it done. It's not completely automated, I still have to input the qualities, reach, grip, CD and bonus manually, but you can drag and drop the item/weapon into the frame with the proper containers, it links back to the item window and the roller takes the CD value, adds the +CD value and rolls that many d6s. I know for a more advanced modder that's no biggie, but man I feel pretty good about accomplishing that.

Thanks again for the help.

https://i.imgur.com/NRaRhZ5.jpg

damned
July 26th, 2019, 07:08
Its a journey! Today you take a little step, another one tomorrow...

superteddy57
July 26th, 2019, 17:32
Baby steps. Each win is a win and that's how I see it. Some things come easier for some, but everytime I make something I give myself a pat on the back and do a little dance.

If you can crack and share how to link your weaponlist's frame to the inventory, you would figure out something I've spent the last year trying to figure out. So we each have our own little obstacles lol.

damned
July 27th, 2019, 01:36
So my example of drag and drop was for more static data like classes.
Weapons are far more customisable so you need to find an example where they pull the data from the XML record source rather than a Lua array.
The 5E and 2E and 3.5E rulesets are probably your best examples of this.