Fenloh
October 12th, 2008, 10:27
That is the code:
<script>
function onUpdate()
local bodycheckvalue= window.bodycheck.getValue();
local pdamvalue = 0 ;
pdamvalue = (bodycheckvalue/2) + 8;
window.stat.pdam.score.setValue(pdamvalue);
end
</script>
I want to calculate half of the body attribute and add 8 to a local Variable and then out the value to the correct field.
the bodycheck does not have a source, i access it directly
the pdam has the source stat.pdam.score
1. Is the code correct so far?
2. how can i round a Variable (round roundup rounddown) within the script
3. is there some way to echo a variable to the console, so i can actually see if it is filled or not? or is there a debugger?
Thanks again for even looking into the code.
Fenloh
<script>
function onUpdate()
local bodycheckvalue= window.bodycheck.getValue();
local pdamvalue = 0 ;
pdamvalue = (bodycheckvalue/2) + 8;
window.stat.pdam.score.setValue(pdamvalue);
end
</script>
I want to calculate half of the body attribute and add 8 to a local Variable and then out the value to the correct field.
the bodycheck does not have a source, i access it directly
the pdam has the source stat.pdam.score
1. Is the code correct so far?
2. how can i round a Variable (round roundup rounddown) within the script
3. is there some way to echo a variable to the console, so i can actually see if it is filled or not? or is there a debugger?
Thanks again for even looking into the code.
Fenloh