Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

How do I?

1460833062
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Help I need to set up a math function where a number is multiplied by two raised to the power of X
What's your usecase?
1460835078
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Usecase??? I have no idea what that is.....I am a beginner at some of this stuff.
1460835512
Pat S.
Forum Champion
Sheet Author
He is asking what do you need it for and how would you use it, basically he is asking for an example.
1460835882
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Ok heres the problem. GURPS Enhanced Move calls for one doubling per level of enhancement. Thus a lvl3 enhancement would be x8 or 2 to the third power Example Speedy has a Basic Move of 10 he gets Enhanced Move Ground 4 which doubles his move 4 times or 2x2x2x2 for a total of 160
1460835998
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Addtionally acceleration with Enhanced move is calculated at Move x level of enhancement per second. in the above example Speedy accelerates at 40 yards per second
1460837096

Edited 1460838395
Unfortunately, Roll20 doesn't have an exponent operator for use with basic rolls. Regardless, without the assistance of an API Script, here's how I might handle your use case: Enhanced Move Level @{EnhancedMove} - Basic Speed: @{BasicMove} yd/s - Enhanced Speed: [[ @{BasicMove} * [[({@{EnhancedMove} + d0}>1 + 1) * ({@{EnhancedMove} + d0}>2 + 1) * ({@{EnhancedMove} + d0}>3 + 1) * ({@{EnhancedMove} + d0}>4 + 1) * ({@{EnhancedMove} + d0}>5 + 1) * ({@{EnhancedMove} + d0}>6 + 1) * ({@{EnhancedMove} + d0}>7 + 1) * ({@{EnhancedMove} + d0}>8 + 1)]] ]] yd/s - Enhanced Acceleration: [[ @{BasicMove} * @{EnhancedMove} ]] yd/s^2 You'd need to expand the Enhanced Speed portion of the macro if you plan to have @{EnhancedMove} above 8.
1460839276
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
How would that work here <div> <div> Ground </div> <div> <input type="text" name="attr_ground_move_max" value="((@{basic_move_base})*((@{ground_move_enhance})))" disabled="disabled" /> </div> <div> <input type="text" name="attr_ground_accel" value="@{basic_move})*((@{ground_move_enhance)/2))" disabled="disabled" /> </div> <div> <select name="attr_ground_move_enhance" value="0" /> <option value="1" selected="selected">0</option> <option value="2">1</option> <option value="4">2</option> <option value="8">3</option> <option value="16">4</option> <option value="32">5</option> <option value="64">6</option> <option value="128">7</option> <option value="256">8</option> <option value="512">9</option> <option value="1024">10</option> </select> </div> <div> <input type="text" name="attr_ground_move_mode_notes" /> </div> </div> <!-- .sheet-row --> Again I apologize but I don't know HTML, CSS that well but I am learning.
1460839486

Edited 1460839499
I moved this thread to the Character Sheets forum.
1460844847
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
So here is what I have and I still cannot seem to convert your macro into HTML <div> <div> Ground </div> <div> <input type="text" name="attr_ground_move" value="@{basic_move_base} + @{basic_move_mod}" disabled="disabled" data-formula="@{basic_move_base} + @{basic_move_mod}" /> </div> <div> <input type="text" name="attr_ground_move_max" value="(( @{ground_move} * ((({@{enhanced_ground_move} + d0}>1 + 1) * ({@{enhanced_ground_move} + d0}>2 + 1) * ({@{enhanced_ground_move} + d0}>3 + 1) * ({@{enhanced_ground_move} + d0}>4 + 1) * ({@{enhanced_ground_move} + d0}>5 + 1) * ({@{enhanced_ground_move} + d0}>6 + 1) * ({@{enhanced_ground_move} + d0}>7 + 1) * ({@{enhanced_ground_move} + d0}>8 + 1))) ))" disabled="disabled" /> </div> <div> <input type="text" name="attr_ground_accel" value="Accel" disabled="disabled" /> </div> <div> <input type="text" name="attr_enhanced_ground_move" value="0" /> </div> </div> <!-- .sheet-row -->
1460854234

Edited 1460854246
Lithl
Pro
Sheet Author
API Scripter
Crazy Master Gamer said: How would that work here <div> <div> Ground </div> <div> <input type="text" name="attr_ground_move_max" value="((@{basic_move_base})*((@{ground_move_enhance})))" disabled="disabled" /> </div> <div> <input type="text" name="attr_ground_accel" value="@{basic_move})*((@{ground_move_enhance)/2))" disabled="disabled" /> </div> <div> <select name="attr_ground_move_enhance" value="0" /> <option value="1" selected="selected">0</option> <option value="2">1</option> <option value="4">2</option> <option value="8">3</option> <option value="16">4</option> <option value="32">5</option> <option value="64">6</option> <option value="128">7</option> <option value="256">8</option> <option value="512">9</option> <option value="1024">10</option> </select> </div> <div> <input type="text" name="attr_ground_move_mode_notes" /> </div> </div> <!-- .sheet-row --> What's not working about this? @{ground_move_enhance} has the correct values here, simply multiply it by whatever you need.
1460897726
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Well here is a screenshot
1460900033
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
So I have redone the code and still same results..... I took Silvre's sample and plugged it in even inside parenthises and no dice. See below <div> <!--<<<<<<<================GROUND MOVE ROW==================<<<<<<<<<<-----> <div> Ground </div> <div> <input type="text" name="attr_ground_move" value="@{basic_move_base} + @{basic_move_mod}" disabled="disabled" data-formula="@{basic_move_base} + @{basic_move_mod}" /> </div> <div> <input type="text" name="attr_ground_move_max" value="([[ @{ground_move} * [[({@{enhanced_ground_move} + d0}>1 + 1) * ({@{enhanced_ground_move} + d0}>2 + 1) * ({@{enhanced_ground_move} + d0}>3 + 1) * ({@{enhanced_ground_move} + d0}>4 + 1) * ({@{enhanced_ground_move} + d0}>5 + 1) * ({@{enhanced_ground_move} + d0}>6 + 1) * ({@{enhanced_ground_move} + d0}>7 + 1) * ({@{enhanced_ground_move} + d0}>8 + 1)]] ]])" disabled="disabled" /> </div> <div> <input type="text" name="attr_ground_accel" value="((@{ground_move}) * (@{enhanced_ground_move}))" disabled="disabled" /> </div> <div> <input type="text" name="attr_enhanced_ground_move" value="0" /> </div> </div> <!-- .sheet-row --> What I cannot figure out is where the "floor" keeps popping up in the results.