What spell targets count for Gravity Well?

The gravity well feature from the Graviturgy Magic arcane tradition triggers "whenever you cast a spell on a creature", and has an effect "if the target is willing to move, the spell hits it with an attack, or it fails a saving throw against the spell." It’s not clear to me what kinds of spells can actually trigger this feature.

Based on the singular phrasing of "on a creature" and the later use of the word target, I would normally read this as only applying to spells that explicitly target creatures (and perhaps only those with a single target, in contrast to the phrasing of the Sculpt Spells feature of the evocation wizard, for example). However, spells that target a location can use the word target in a different sense (see What counts as a target for a spell?).

What’s actually going on here? Does this feature only work on targeted spells, or does it function for area of effect spells as well, or is this just an ambiguous phrasing that will rely on DM’s ruling?

Get all Gravity Form entry IDs for current user and display the highest value

I have a Gravity Form with a user registration plugin installed, so every time someone completes the form, they are added as a user and the submitted form is assigned an entry ID which is linked to that user. But whenever a user re-submits the form a new entry ID is created – there is a column in the "wp_gf_entry" table called "created_by" which contains the user ID for who submitted the form. So I figured I need to find currently logged in user ID, match it against the "created_by" column then find the highest value entry ID for that user, which I will then need to display in a shortcode.

I have figured out how to find the initial entry ID which is linked to the users meta details and display that inside the shortcode, see below.

  $  user_id = get_current_user_id();   $  key = 'entry_id';   $  single = true;   $  gform = get_user_meta( $  user_id, $  key, $  single );     echo do_shortcode('[gravitypdf id="5ffc7508269e7" entry="' . $  gform . '" text="Download"]'); 

This would work great if the entry ID got updated every time the user re-submits the form, as the entry ID would always stay the same, but a new entry ID gets created for every form submission.

So…

That led me to searching for another solution which would update the same entry every time the user re-submitted the form, but I was at a lose and could only find the following gform_entry_id_pre_save_lead which after testing wouldn’t work for me and a new entry was created each time.

Ideally I would prefer the first solution, just in case the user needs to access an older entry. Although its not essential so all suggestions and possible solutions are welcome.

I’m relatively new to PHP, but feel like the solution Is not far away and feel like the use of the foreach loop and the max() function will help with looping through the array of entry IDs for current user and finding the max value in that array…I just can’t figure out how to get there with code!

Any help would be appreciated.

Need help with gravity simulation in 2D game engine

I’m writing a 2D game engine using C++ and SDL2 and started implementing a rigidbody component similar to that of unity to my gameobjects. I have a method in the rigidbody class called AddForce which takes a 2D vector force as a parameter and calculates the velocity vector using F = M*A, I use this function to move the character left and right using the keyboard arrows. Now my question is, how do I manage the gravity with this and how do I calculate the resultant force of the gravity and the force applied when pressing either keyboard arrows. Here is the rigidbody class.

#ifndef RIGIDBODY_H #define RIGIDBODY_H  //Game engine libraries #include "gameEngine/Game.h" #include "gameEngine/GameObject.h" #include "gameEngine/Component.h" #include "gameEngine/components/Transform.h"  //GlM library #include "glm/glm.hpp"  class RigidBody : public Component { private:     Transform* m_transfrom; private:     float m_mass;     float m_acceleration;     glm::vec2 m_forceApplied;     glm::vec2 m_velocity; private:     float m_deltaTime;  public:     RigidBody(float mass)     {         m_name = "RigidBody";         m_mass = mass;         m_acceleration = 0;         m_forceApplied = glm::vec2(0,0);         m_velocity = glm::vec2(0,0);      } public:      void AddForce(glm::vec2 force, float deltaTime)      {            float forceMagnitude;         m_deltaTime = deltaTime;         m_forceApplied = force;          forceMagnitude = glm::length(force);         m_acceleration = forceMagnitude / m_mass;       }      private:      glm::vec2 CalculateVelocity()      {          float velocityMagnitude;          static glm::vec2 newVelocity = glm::vec2(0,0);           velocityMagnitude = m_acceleration * m_deltaTime;           if(m_forceApplied.x != 0 || m_forceApplied.y != 0)              newVelocity = glm::normalize(m_forceApplied);          else            newVelocity = glm::vec2(0,0);           newVelocity = newVelocity * velocityMagnitude;           return newVelocity;       }   public:     void Initialize() override     {         m_transfrom = m_owner->GetComponent<Transform>("Transform");     }     void Update(Game instance, float deltaTime) override     {         m_velocity += CalculateVelocity();         m_transfrom->position.x += m_velocity.x * deltaTime;         m_transfrom->position.y += m_velocity.y * deltaTime;     }     void Render() override     {      }  };   #endif 

Upload Gravity Form files to OneDrive [closed]

I’ve been looking for an away of upload files from Gravity Form direct to the cloud on OneDrive. And so far, I found some codes that could be useful:

 add_filter( 'gform_upload_path', function ( $  path_info, $  form_id ) {         GFCommon::log_debug( "log_upload_path(): path_info for form #{$  form_id} => " . print_r( $  path_info, true ) );               return $  path_info;     }, 1, 2 );       add_filter( 'gform_upload_path', 'change_upload_path', 10, 2 ); function change_upload_path( $  path_info, $  form_id ) {    $  path_info['path'] = '/home/public_html/yourdomainfolder/new/path/';    $  path_info['url'] = 'http://yourdomainhere.com/new/path/';    return $  path_info; }    <?php require_once 'functions.inc.php'; $  token = skydrive_tokenstore::acquire_token(); // Call this function to grab a current access_token, or false if none is available.  if (!$  token) { // If no token, prompt to login. Call skydrive_auth::build_oauth_url() to get the redirect URL.        echo "<div>";        echo "<img src='statics/key-icon.png'>&nbsp";        echo "<a href='" . skydrive_auth::build_oauth_url() . "'>Login with SkyDrive</a></span>";        echo "</div>"; } else {        $  sd = new skydrive($  token);        try {            $  response = $  sd->put_file($  _GET['folderid'], '/file/to/put');            // File was uploaded, return metadata.            print_r($  response);        } catch (Exception $  e) {            // An error occured, print HTTP status code and description.            echo "Error: ".$  e->getMessage();            exit;        } } 

Source: https://docs.gravityforms.com/gform_upload_path/
https://stackoverrun.com/fr/q/8253794

Instead of my domain path I would like to point it to one folder on Onedrive and if possible, generate a new folder for each upload containing the current WooCommerce order number. I don’t have much experience with PHP so any useful help will be great!

2d gravity simulator – smaller object orbiting towards center of bigger object

In my libgdx test game, I have initially created 2 circle objects (stellar) about which I will say more in details below. However, my goal is to simulate gravity in 2d, where smaller object orbits towards center of bigger object (just like earth orbits sun) but closer and closer to the center of bigger.

So, I have created the following:

  • stellar1: smaller, 10px radius, 10 mass, dynamic (can move), initial position -160×90, velocity (0,0), accelerator (0,0)
  • stellar2: bigger, 30px radius, 30 mass, static (cannot move), initial position 0x0, velocity (0,0), accelerator (0,0)

Here is also a screenshot, just to have a picture: enter image description here

I will give the full code below of what I did so far, before that I want to mention I have 2 approaches, StellarTest1 and StellarTest2.

First StellarTest1, I’ve tried to add some extra values like 1000f to both x and y just to see something in action like:

velocity.x += 1000f * acceleration.x * deltaTime; velocity.y += 1000f * acceleration.x * deltaTime; 

Resulting in – smaller object gets towards the center of the bigger object, but once it reaches the center of bigger, the smaller object gets evicted to the opposite side. Not to mention how 1000f is not the correct value in the size of this coordinate system, but I am concerned about following computation:

acceleration.x = gravityForce * (diffX / distance) acceleration.y = gravityForce * (diffY / distance) 

Code StellarTest1:

public class StellarTest1 extends AbstractTest {      private Stellar stellar2, stellar1;      public StellarTest1(Game game) {         super(game);     }      @Override     public void create() {         game.getCartesianGrid().setEnabled(true);          // smaller  stellar         float startX = -160;         float startY = 90;         float radius = 10;         float mass = 10;         stellar1 = new Stellar(                 startX, startY,                 radius, mass,                 new Color(102, 188, 217, 100f)         );          // bigger stellar         startX = 0;         startY = 0;         radius = 30;         mass = 30;         stellar2 = new Stellar(                 startX, startY,                 radius, mass,                 new Color(252, 236, 3, 100f)         );         stellar2.updatable = false; // bigger object will not update, in other words no motion          stellar2.setOther(stellar1);         stellar1.setOther(stellar2);     }      @Override     public void update(float deltaTime) {         if (!updatable) {             return;         }         stellar2.update(deltaTime);         stellar1.update(deltaTime);     }      @Override     public void draw() {         if (!drawable) {             return;         }         stellar2.draw();         stellar1.draw();     }      private class Stellar {          Circle circle;         Vector2 velocity;         Vector2 direction;         Vector2 acceleration;         float mass, radius;         boolean updatable;         Stellar other;          public Stellar(                 float startX, float startY,                 float radius, float mass,                 Color color) {             this.radius = radius;             this.velocity = new Vector2(0, 0);             this.acceleration = new Vector2(0, 0);             this.mass = mass;             this.radius = radius;              circle = new Circle(game,                     color,                     startX, startY,                     radius);              this.updatable = true;         }          public void update(float deltaTime) {             if (!updatable) {                 return;             }             float diffX = other.circle.x - circle.x;             float diffY = other.circle.y - circle.y;              float G = 2f;             float mass = G * (other.mass - this.mass);             float distance = (float) Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2));             float gravityForce = (float) (mass / Math.pow(distance, 2));              acceleration.x = gravityForce * (diffX / distance);             acceleration.y = gravityForce * (diffY / distance);              velocity.x += 1000f * acceleration.x * deltaTime;             velocity.y += 1000f * acceleration.y * deltaTime;              circle.x += velocity.x * deltaTime;             circle.y += velocity.y * deltaTime;         }          public void draw() {             game.getShapeRenderer().begin(ShapeRenderer.ShapeType.Filled);             circle.draw();             game.getShapeRenderer().end();         }          public void setOther(Stellar other) {             this.other = other;         }     }  } 

Second StellarTest2, in this example, you will see same code, except I am using here angle in degrees:

float angleInDegrees = MathUtils.atan2(diffY, diffX) * MathUtils.radiansToDegrees; ... acceleration.x = gravityForce * MathUtils.cos(angleInDegrees * deltaTime); acceleration.y = gravityForce * MathUtils.sin(angleInDegrees * deltaTime); 

In this test, I did not have to add some extra velocity to move smaller object. Also I achieved that smaller object will make a solid curve, but will not get dragger in the center. Instead, after some time it will evict out. However, still I face the issue that smaller object keeps curving in and out and towards center. Yet, I am curious if cos and sin is necessary here, and perhaps StellarTest1 is right approach.

Code StellarTest2:

public class Stellar2Test extends AbstractTest {      private Stellar stellar1, stellar2;      public Stellar2Test(Game game) {         super(game);     }      @Override     public void create() {         game.getCartesianGrid().setEnabled(true);          float startX = -160;         float startY = -90;         float radius = 10;         float mass = 30;         stellar2 = new Stellar(                 startX, startY,                 radius, mass,                 new Color(102, 188, 217, 100f)         );          startX = 0;         startY = 0;         radius = 30;         mass = 30;         stellar1 = new Stellar(                 startX, startY,                 radius, mass,                 new Color(252, 236, 3, 100f)         );         stellar1.updatable = false;          stellar1.setOther(stellar2);         stellar2.setOther(stellar1);     }      @Override     public void update(float deltaTime) {         if (!updatable) {             return;         }         stellar1.update(deltaTime);         stellar2.update(deltaTime);     }      @Override     public void draw() {         if (!drawable) {             return;         }         stellar1.draw();         stellar2.draw();     }      private class Stellar {          Circle circle;         Vector2 velocity;         Vector2 acceleration;         float mass, radius;         boolean updatable;         Stellar other;          public Stellar(                 float startX, float startY,                 float radius, float mass,                 Color color) {             this.radius = radius;             this.velocity = new Vector2(0, 0);             this.acceleration = new Vector2(0, 0);             this.mass = mass;             this.radius = radius;              circle = new Circle(game,                     color,                     startX, startY,                     radius);              this.updatable = true;         }          public void update(float deltaTime) {             if (!updatable) {                 return;             }             float diffX = other.circle.x - circle.x;             float diffY = other.circle.y - circle.y;             float angleInDegrees = MathUtils.atan2(diffY, diffX) * MathUtils.radiansToDegrees;              float G = 2;             float mass = (G * (other.mass * this.mass));             float distance = (float) Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2));             float gravityForce = mass / distance;              acceleration.x = gravityForce * MathUtils.cos(angleInDegrees * deltaTime);             acceleration.y = gravityForce * MathUtils.sin(angleInDegrees * deltaTime);              velocity.x += acceleration.x * deltaTime;             velocity.y += acceleration.y * deltaTime;              circle.x += velocity.x * deltaTime;             circle.y += velocity.y * deltaTime;         }          public void draw() {             game.getShapeRenderer().begin(ShapeRenderer.ShapeType.Filled);             circle.draw();             game.getShapeRenderer().end();         }          public void setOther(Stellar other) {             this.other = other;         }     }  } 

Is it possible to lift things multiple times with different castings of reverse gravity?

My players came up with an interesting idea using reverse gravity recently which at the time I let them do because it made sense and I like to keep things flowing but wondered about the actual mechanics of it.

Reverse Gravity lifts everything centered on a point in a 50ft circle 100ft up. 2 of the players in the party had taken it, in player ones turn he cast it at ground level to lift a group of enemies the full 100 feet, the 2nd player then cast the spell a second time centering at the top of the previous spell and lifting the enemies another 100 feet. In player ones turn he stopped his version of the spell meaning player 2 could then drop them 200 feet. As there was nothing to grab hold of on the second casting there was no saving throw

At the time I was unsure if the initial casting of the spell would lock them in at 100 feet but decided to go with it. My players have also asked me if one of them could cast it repeatedly turn after turn. Effectively cancelling it as they cast it a second time lifting people multiples of 100 feet into the air before then dropping them.

Is this a DM decide situation, which I am fine with, or are there any rules stated anywhere for this situation?

Reverse Gravity: dropping concentration mid fall

When you cast the spell Reverse Gravity, creatures start falling upwards into the air. Assuming that there is nothing in their way the spell must somehow halt their momentum when they reach the top of it, as the spell says "If an object or creature reaches the top of the area without striking anything, it remains there, oscillating slightly, for the duration." If it didn’t halt their momentum somehow, they would fall up into normal gravity for another 100 feet or so, and then almost all the way back to the ground (with real world physics anyway; air resistance would be the only thing that slowed them down, and that would only remove about 5 feet worth of momentum per 100ft fall- I did the math).

Because of this I’m assuming that the spell stops momentum when the creatures hit the top of the spell area somehow.

But what happens if you drop concentration on the spell while they are falling upwards? The condition "If an object or creature reaches the top of the area without striking anything" no longer applies, as the spell isn’t in effect anymore. Physics tells us that the creature falling upwards 100 feet in a reversed gravity field would then have enough momentum to ‘fly’ another 100 feet upwards beyond that until slowing to a stop and falling back down (discounting air resistance). So lets say you dropped concentration just before they reached the top of the spell area; would they then fly up to a height of 200ft off the ground before then falling to the ground for 20d6 damage?

I know you can drop concentration as a free action anytime, but this spell doesn’t seem to indicate how it works exactly regarding the momentum gathered while falling upwards. I’m wondering if the above interpretation is reasonable.

Gravity Forms: How to add PHP function to confirmation conditional shortcode?

In Gravity Forms, I have a confirmation set up with various conditional shortcodes. Example:

[gravityforms action="conditional" merge_tag="{:3:value}" condition="contains" value="E"]*** GET A CATEGORY ***[/gravityforms] 

Additionally, I have a PHP function that gets all posts by category, and I would like to use this function inside the conditional shortcode. I’m not figuring out a way to do this, so any help would be appreciated.

My function: useful_tools_list(array( 'type' => 'documents', desc => 'true' ))

I also made it into a shortcode: [useful-tools type="documents" desc="true"]

I tried using <?php ?>, but I realized I can’t embed PHP into the editor. The conditional shortcode doesn’t support nesting other shortcodes inside of it, so that doesn’t work.

I’m wondering if there is a way to manipulate the GF conditional shortcode to allow nesting? Or another way of calling the function that I’m not aware of?