PDA

View Full Version : Crap need help.



Visvalor
July 20th, 2010, 22:50
So I dusted off the ole'FG again and am playing, got a problem though. Whenever a character loads one of the pages on my ruleset, it causes some sort of issue with the db.xml and it will reset with a fresh db.xml next time I run the program

It's a pretty elaborate page too... actually it's 10 elaborate windows with roughly 3200 lines on each one. The db.xml goes from 5kb to 76kb with a single character opening the pages.

Is it because of my size or is there an error? I thought it was possibly because I used [] brackets in the dice descriptions but I changed them to () to no avail.

Any help?

Visvalor
July 20th, 2010, 23:00
Also if it helps, here is a copy of one of those 10 pages.

https://download345.mediafire.com/a3gbqseegwkg/6nzht6yybft0n2q/skillsheet_weapon_dagger.xml

Visvalor
July 20th, 2010, 23:19
Ok, found what causes the error but I have no idea why.

The diescores (There are a lot of them) If I remove all of them, I no longer have db.xml corruption issues.

What is wrong with this code?

<!--Main Strike Dice-->
<diescore name="Unarmed Strike [sm -1]">
<anchored>
<to>Unarmed</to>
<position>insidetopleft</position>
<offset>270,45</offset>
<size>
<width>40</width>
<height>165</height>
</size>
</anchored>
</diescore>

<modbox name="Unarmed Strike [sm -1]Mod">
<sourcename>Test</sourcename>
<bounds>165,164,19,15</bounds>
<description>
<text>Unarmed Hitrate Modifier</text>
</description>
<script>
function update()
UnarmedProf = source.getValue()
UnarmedMastery = source1.getValue()
UnarmedGrandMastery = source2.getValue()
UnarmedDexterity = source3.getValue()
UnarmedProfBonusHit = source4.getValue()
UnarmedMasteryBonusHit = source5.getValue()
UnarmedGrandMasteryBonusHit = source6.getValue()
BasicUnarmedBonus = (UnarmedGrandMasteryBonusHit + UnarmedMasteryBonusHit + UnarmedProfBonusHit)
BasicUnarmedOverall = ((UnarmedDexterity))
setValue(math.ceil(BasicUnarmedOverall + BasicUnarmedBonus))
end
function onInit()
setVisible(false);
source = window.getDatabaseNode().getChild("UnarmedProfLevel")
source1 = window.getDatabaseNode().getChild("UnarmedMasteryLevel")
source2 = window.getDatabaseNode().getChild("UnarmedGrandMasteryLevel")
source3 = window.getDatabaseNode().getChild("stats.dexterity")
source4 = window.getDatabaseNode().getChild("UnarmedProfBonusHit")
source5 = window.getDatabaseNode().getChild("UnarmedMasteryBonusHit")
source6 = window.getDatabaseNode().getChild("UnarmedGrandMasteryBonusHit")
source.onUpdate = update
source1.onUpdate = update
source2.onUpdate = update
source3.onUpdate = update
source4.onUpdate = update
source5.onUpdate = update
source6.onUpdate = update
update()
end
</script>
</modbox>

Visvalor
July 20th, 2010, 23:25
Oh GODDAMMIT :P

I removed all the [] completely and didn't replace it with () and it works fine. Anyone know if I can use any form of brackets? I want it to state [sm -1] or whatever when it rolls! :PPP

drahkar
July 21st, 2010, 01:25
I'm not sure if you need to escape out the [] characters. Might try it thought. Those characters are considered special characters in programming. Try putting them back in with a \[ and \] and see if it helps. Can't know for sure, but it is a thought.

Moon Wizard
July 21st, 2010, 02:39
I would store that information separately and not use it in the tags.

Most programming languages are fairly picky about what characters can be used in variable names, and all the controls are converted into variables for LUA support.

* A variable name has to start either with a letter (character) or an underscore.
* Only characters, numbers an underscores are allowed in variable names.
* Reserved words are not allowed for using as name for a variable.

Cheers,
JPG

Visvalor
July 21st, 2010, 06:07
Yea it's all fixed and good to go now :P but I'd have liked to keep the brackets. No worries.

Doswelk
July 28th, 2010, 18:28
Yea it's all fixed and good to go now :P but I'd have liked to keep the brackets. No worries.

When I am creating libraries and I want to force a preceding space into the title of an entry I use #160;

Could you not use #40; and #41; ?

Not tried it myself but might work.