PDA

View Full Version : setValue question



Andeee
January 29th, 2009, 15:19
If I want to use setValue to perform an operation and return a whole number rounded up, is this possible? Specificly with

function onSourceUpdate()
setValue(calculateSources() / 2);
end

cheers
Andeee

Tenian
January 29th, 2009, 15:27
You can use math.ceil in lua

like:

setValue(math.ceil(calculateSources()/ 2))

Andeee
January 29th, 2009, 15:34
cool! thanks, that's ace. I'm working on adding a MaxHP to the CoC ruleset on the character sheet and the combat tracker. As I know nothing about xml and lua it's all a bit trial and error :D

Andeee
January 29th, 2009, 20:47
Is there a way to force a reload of the data (charactersheet_main.xml for example) without having to close and reopen the application?

would speed up my trial and error methods no end.

Oberoten
January 29th, 2009, 20:58
I usually set up F5 with /reload and F6 with /reload all

That and liberal use of /console helps you squish bugs like nobody's business.

- Obe

Andeee
January 29th, 2009, 21:02
Cool. cheers Obe