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

Solving For Kinetic Energy

Hi folks, I'm trying to make a macro that tells a player whether their character has the power level to alter the velocity of a given object. I thought he macro might work something like this- There's a dropdown query that asks the player to choose the power level of the character. Each power level in the dropdown has an energy level associated with it- ?{Skill Title|Untrained, 0|Novice, 100|Apprentice, 1000|Journeyman, 100000|Master, 10000000|Grandmaster, 10000000000} Then a 2nd query asks the player to enter the mass (in kg) of the object. Then a 3rd query asks the player to enter the desired new velocity of the object. A Novice chr would only be able to impart a velocity change of up to 100 jules. If the resulting math shows that the object is able to attain that velocity change with less than 100 jules, the attempt is successful. No roll. (this is not a rolling macro, just a math one) Does anyone know how this might be accomplished?
1520176554
The Aaron
Pro
API Scripter
Probably easiest to just write an API script to do that.  You could do the calculation and divide it by the power level, then take anything less than 1 to be success.  You could probably build some sort of formula using either grouping with keep low, or with d1 rolls and have cs<0cf>1.
1520423980

Edited 1520424897
Here are some macros that should help: The required amount of energy to impart a change in velocity of ?{Change in velocity|2} m/s on a ?{Mass|60} kg object traveling at an initial velocity of ?{Initial velocity|0} m/s is [[ 0.5 * ?{Mass} * abs((?{Initial velocity} + ?{Change in velocity})**2 - ?{Initial velocity}**2) ]] J At power level [[ ?{Skill Title|Untrained,0|Novice,1e2|Apprentice,1e3|Journeyman,1e5|Master,1e7|Grandmaster,1e10} ]], the maximum change in velocity that can be imparted on a ?{Mass|60} kg object traveling at an initial velocity of ?{Initial velocity|0} m/s is [[ (?{Skill Title} / (0.5 * ?{Mass}) + ?{Initial velocity}**2)**0.5 - ?{Initial velocity} ]] m/s /em the ?{Skill Title|Untrained, [Untrained](0)|Novice, [Novice](1e2)|Apprentice, [Apprentice](1e3)|Journeyman, [Journeyman](1e5)|Master, [Master](1e7)|Grandmaster, [Grandmaster](1e10)} attempts to impart a change in velocity of ?{Change in velocity|2} m/s on a ?{Mass|60} kg object traveling at an initial velocity of ?{Initial velocity|0} m/s: /r {0,[[ ?{Skill Title} + {0} ]]}>[[0.5 * ?{Mass} * abs((?{Initial velocity} + ?{Change in velocity})**2 - ?{Initial velocity}**2)]]
Damn Silvyre, Those are exactly perfectly what I was trying (and failing hard) to do. How can I thank you?
I'm just happy I got to revisit some rusty physics skills! Happy rolling!