PDA

View Full Version : Trying to alter VtM Character Sheet ...and I'm lost



ProfDaemon
June 5th, 2019, 00:30
Brand new to xml / lua so have no idea what I am doing. Realized the VtM uses an altered CoreRPG ruleset, so was able to alter the theme of it to be more readable, but the biggest issue I am having is with the character sheet. The layout is good however I do not want the ? and close icon to be hidden, and the dots to click on do not allow you to interact to input any stats. I think I have identified the issue, though not possible nor do I know what I would change it to be in order to fix it. Here is a screenshot of the charactersheet (The nodes are what allow no input), and the suspect line of code. Only showing the code for the Str set as its duplicated for the rest with different call tags.
27522

xml code

<genericcontrol name="physicalattributeframe">
<bounds>15,145,200,70</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>

<stringcontrol name="strength">
<anchored>
<to>physicalattributeframe</to>
<position>insidetopleft</position>
<offset>10,11</offset>
</anchored>
<center />
<font>sheettextsmall</font>
<static>Strength</static>
<tooltip>
<text>Strength</text>
</tooltip>
<script>
function onDoubleClick(x,y)
local difftmp = 0;
local valuetmp = 0;
local tableaulist = window.getDatabaseNode().getChild("strengthlist").getChildren();
for k, v in pairs(tableaulist) do
valuetmp = v.getChild("charsheet_radio_button1").getValue() + v.getChild("charsheet_radio_button2").getValue() + v.getChild("charsheet_radio_button3").getValue();
valuetmp = valuetmp + v.getChild("charsheet_radio_button4").getValue() + v.getChild("charsheet_radio_button5").getValue() + v.getChild("charsheet_radio_button6").getValue();
valuetmp = valuetmp + v.getChild("charsheet_radio_button7").getValue() + v.getChild("charsheet_radio_button8").getValue() + v.getChild("charsheet_radio_button9").getValue();
valuetmp = valuetmp + v.getChild("charsheet_radio_button10").getValue();
end
local dice = ChatManager.d10Check(valuetmp);
local rRoll = { sType = "dice", sDesc = "Strength", aDice = dice, nMod = difftmp };
if (valuetmp ~= 0) then
ActionsManager.actionDirect(nil, "dice", { rRoll });
end
end
</script>
</stringcontrol>

lua code part makes it to long to post, so will post that on next post.

ProfDaemon
June 5th, 2019, 00:32
lua code (I am suspecting this part of the code, though if needed I can post the rest.)



function onWheel(notches)
local flag = 0;
if OptionsManager.isOption("MWHL", "on") then
flag = 1;
elseif (Input.isControlPressed() == true) then
flag = 1;
end

if (flag==1) then
local button10 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button10").getValue();
local button9 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button9").getValue();
local button8 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button8").getValue();
local button7 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button7").getValue();
local button6 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button6").getValue();
local button5 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button5").getValue();
local button4 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button4").getValue();
local button3 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button3").getValue();
local button2 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button2").getValue();
local button1 = getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button1").getValue();
local total = 1;

if (notches >= 1) then
if (button1 == 0 and button2 == 0 and button3 == 0 and button4 == 0 and button5 == 0 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button1").setValue(1);
total = 1;
elseif (button1 == 1 and button2 == 0 and button3 == 0 and button4 == 0 and button5 == 0 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button2").setValue(1);
total = 2;
elseif (button1 == 1 and button2 == 1 and button3 == 0 and button4 == 0 and button5 == 0 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button3").setValue(1);
total = 3;
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 0 and button5 == 0 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button4").setValue(1);
total = 4;
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 0 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button5").setValue(1);
total = 5;
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button6").setValue(1);
total = 6;
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 1 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button7").setValue(1);
total = 7;
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 1 and button7 == 1 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button8").setValue(1);
total = 8;
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 1 and button7 == 1 and button8 == 1 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button9").setValue(1);
total = 9;
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 1 and button7 == 1 and button8 == 1 and button9 == 1 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button10").setValue(1);
total = 10;
end
elseif (notches <= 0) then
if (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 1 and button7 == 1 and button8 == 1 and button9 == 1 and button10 == 1) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button10").setValue(0);
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 1 and button7 == 1 and button8 == 1 and button9 == 1 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button9").setValue(0);
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 1 and button7 == 1 and button8 == 1 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button8").setValue(0);
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 1 and button7 == 1 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button7").setValue(0);
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 1 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button6").setValue(0);
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 1 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button5").setValue(0);
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 1 and button5 == 0 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button4").setValue(0);
elseif (button1 == 1 and button2 == 1 and button3 == 1 and button4 == 0 and button5 == 0 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button3").setValue(0);
elseif (button1 == 1 and button2 == 1 and button3 == 0 and button4 == 0 and button5 == 0 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button2").setValue(0);
elseif (button1 == 1 and button2 == 0 and button3 == 0 and button4 == 0 and button5 == 0 and button6 == 0 and button7 == 0 and button8 == 0 and button9 == 0 and button10 == 0) then
getWindows()[1].getDatabaseNode().getChild("charsheet_radio_button1").setValue(0);
end
end
end
end

damned
June 5th, 2019, 00:58
I believe that the dots are changed by mousewheel and or ctrl+mousewheel.

ProfDaemon
June 5th, 2019, 01:05
Control + mousewheel did the trick, thanks! Also what would I search the file for to make the close option shown and not hidden?
(edited as it did not show on mouseover either)

damned
June 5th, 2019, 01:14
The ? icon probably never got implemented in this ruleset. It was written before ? became a thing in CoreRPG (afaik).
Have a look at record_char.xml in CoreRPG and look for <close_charsheet />
Then search the rest of the ruleset for close_charsheet and see what you find...

ProfDaemon
June 5th, 2019, 05:23
Figured it out, all set :)

damned
June 5th, 2019, 07:38
Alright tried editing the file then I realized its not just the character sheet. Nothing shows the close box icon.


Figured it out, all set :)

Possibly the close template was missing or that hadnt been implemented at all.
It is the same basic process - you will see close or close_variant templates throughout CoreRPG