RigidBody player is moving through floor upon MovePosition

Movement Code:

public class PlayerMovement : MonoBehaviour {     public float speed;     public Rigidbody rb;       void Start()     {              }      void Update()     {         bool w = Input.GetKey(KeyCode.W);          if (w)         {             Vector3 move = new Vector3(0, 0, 1) * speed * Time.deltaTime;             rb.MovePosition(move);             Debug.Log("Moved using w key");          }      } } 

I set the Rigidbody and Capsule Collider on the empty "Player" GameObject, which the mesh is a child of.

I have "Use Gravity" checked on Rigidbody and XYZ Freeze Rotation constraints, with Discrete collision detection.

Player stands on a Plane which has just a box collider.

Any ideas what is causing the player to just jitter and sink through the floor when W is pressed? Thank you!

Unity + Steamworks.NET: GetLaunchCommandLine() does not include “+connect_lobby” when launching through an invite

The title describes the problem. I am trying to launch the game through an invite from a friend. When I accept the invite, it launches the game just fine. But when I try to then read the Command line through SteamApps.GetLaunchCommandLine() it does not contain the "+connect_lobby" that the documentation describes. There is very little I can find on this online.

What situations could cause the game to not start up with that line when it should? Is there an alternative?

I read the command line as intended, like this:

string steamCommandLine = ""; Steamworks.SteamApps.GetLaunchCommandLine(out steamCommandLine, 260); 

Note that the OnGameRichPresenceJoinRequested callback works perfectly as intended.

Edit: Almost forgot to add that we have a custom parameter that does go through. Would it be possible that this parameter overwrites the rest of the command line?

Edit 2: I did a bit more research, and in the steam console (with spew level 4 4) I found that steam executes a url: ExecuteSteamURL: "steam://rungame/<appID>/<steamID64>/GuideHouse". That steamID is exactly what I want, but I am not able to retrieve it in code…

Creating archive like functionality through birectional relationships

I could use some guidance in something where I may have developed myself into a corner. Here is the situation I have:

  • CPT: Communities
  • CPT: Innovators
  • CPT: Success Stories

Any Innovator or Success story needs to be tied to a Community. I’ve attempted to do this through a ACF Bidirectional relationship field. I did this instead of a taxonomy because I didn’t want them to have to manage a community taxonomy and a community post type every time a new one was added. It also makes listing associated innovators and success stories on a community page relatively simple. The problem is now that I am doing it that way, I can’t use the archive system.

What I need to be able to do is list the communities, and have them link to a list of their associated innovators or success stories depending on the intent. Ideally the titles of these listing pages can be dynamic as well. There is an old plugin called CPT-onomies that converts a CPT into a taxonomy for another but I am hesitant to use it since it has been 2 years from last update. Is there an elegant and dynamic solution to this or should I just make taxonomies?

For a visual representation, here is the design. Slides 4 and 5 are good example.

Many thanks.

Iterate through a list of strings In SQL scriipt

I’m trying to create a sql file that iterates through a list and get me the information from a group of servers and save it on CSV file. The DB is Oracle, just in case :S.
I’m running the file using sqlplus in a playbook, so I’m able to change the query.

So far, I was able to do the following:

set markup csv on spool 'playbook-dir/roles/instances_db/files/servers.csv'  SELECT * FROM   (<some_internal_query>) WHERE  ROWNUM <= 600000 + 1 ORDER  BY server_name;    spool off 

This query will bring all 5000 servers and I just need 100 or so. I tried to add an array and loop around it Something like this:

DECLARE    arrayvalues sys.odcivarchar2list; BEGIN   arrayvalues := sys.odcivarchar2list('Matt','Joanne','Robert');   FOR x IN ( SELECT m.column_value m_value                FROM table(arrayvalues) m )   LOOP     SELECT *     FROM   (<some_internal_query>)     WHERE  ROWNUM <= 600000 + 1     ORDER  BY server_name;     END LOOP; END; 

But I got this error:

Error report - ORA-06550: line 7, column 1: PLS-00428: an INTO clause is expected in this SELECT statement 06550. 00000 -  "line %s, column %s:\n%s" *Cause:    Usually a PL/SQL compilation error. *Action: 

I’m not entirely sure if I’m doing the LOOP correctly.
Any help will be appreciated.

How to get count of an object, through 3 different tables in postgres with ID’s stored in each table

I’m currently using Postgres 9.6.16.

I am currently using 3 different tables to store a hypothetical users details.

The first table, called contact, this contains:

ID, Preferred_Contact_Method 

The second table, called orders, This contains:

ID, UserID, Contact_ID (the id of a row, in the contact table that relates to this order) 

The Third Table, Called order_details

ID, Orders_ID (the id in the orders table that relates to this order details) 

The tables contain other data as well, but for minimal reproduction, these are the columns that are relevant to this question.

I am trying to return some data so that i can generate a graph, in this hypothetical store, There’s only three ways we can contact a user: Email, SMS, or Physical Mail.

The graph is supposed to be 3 numbers, how many mails, emails, and SMS we’ve sent to the user; since in this hypothetical store whenever you purchase something you get notified of the successful shipment, these methods are 1:1 to the order_details, so if there’s 10 order_detail rows for the same user, then we sent 10 tracking numbers, and since there can be multiple order_details (each item has a different row in order_details) in an order, we can get the count by counting the total rows of order details belonging to a single user/contact, then attributing to what kind of contact method that user preferred at the time of making that order.

To represent this better: If a new user makes a new order, and orders 1 apple, 1 banana, and 1 orange. For the apple, the user set preferred tracking number delivery as SMS, for the banana, they set it to EMAIL, for the orange, they thought it would be funny to set the tracking number delivery via MAIL. Now, i want to generate a graph to this users preferred delivery method. So i’d like to query all those rows and obtain:

SMS, 1 EMAIL, 1 MAIL, 1 

Here’s a SQL Fiddle link with the schema and test data: http://sqlfiddle.com/#!17/eb8c0

the response with the above dataset should look like this:

method | count SMS,     4 EMAIL,   4 MAIL,    4 

Why does my stencil buffer allow pixels through?

I’m rendering a scene using OpenGL. The scene consists of a grassy environment and a small lake (visible as two surfaces). To achieve water surface transparency, I’m using a stencil buffer to render water surfaces separately from other geometry. For context, here’s a screenshot of the scene without water surfaces:

Scene without water surfaces rendered.

Here’s the same scene, but with water surfaces stenciled out (the black portions of the screen):

Water surfaces stenciled out, but not rendered.

Here’s the fragment shader I’m using (where fSource is fullscreen UV coordinates). As you can see, it simply samples from a previously-used frame buffer and outputs the pixel directly to the screen. With stenciling enabled, only pixels not covered by a water surface are rendered.

#version 440 core  in vec2 fSource;  out vec4 outColor;  uniform sampler2D image;  void main() {     outColor = texture(image, fSource); } 

Here’s the problem. When I change this fragment shader to output a solid color, those underwater pixels are suddenly visible (the stencil buffer and stencil settings have not changed). What I’d expect here is non-submerged pixels to be purple, but the water surface pixels (previously black) to remain black (since they should still be rejected through stenciling). Instead, everything is purple, including the water surface.

#version 440 core  out vec4 outColor;  void main() {     outColor = vec4(1, 0, 1, 1); } 

Direct color output (purple) causing pixels to not be rejected through stenciling.

As an additional test, I tried rendering only pixels under the water surfaces with a solid color. These pixels should be rejected via stenciling (appearing black, just like before), but for some reason, they’re visible.

#version 440 core  in vec2 fSource;  out vec4 outColor;  uniform sampler2D image; uniform sampler2D positions;  void main() {     vec3 position = texture(positions, fSource).xyz;      // The water surfaces happen to sit at Y value 7.85.     if (p.y < 7.85)     {         outColor = vec4(1, 1, 0, 1);     }     else     {         outColor = texture(image, fSource);     } } 

Submerged pixels showing up, seemingly ignoring the stencil buffer.

I confirmed the problem by instead sampling with shifted UV coordinates (rather than outputting solid yellow). Again, pixels are showing up on the water surfaces, seemingly ignoring the stencil buffer.

#version 440 core  in vec2 fSource;  out vec4 outColor;  uniform sampler2D image; uniform sampler2D positions;  void main() {     vec3 position = texture(positions, fSource).xyz;      // The water surfaces happen to sit at Y value 7.85.     if (p.y < 7.85)     {         outColor = texture(image, fSource + vec2(0.1, 0));     }     else     {         outColor = texture(image, fSource);     } } 

Shifted UV pixels still showing up through the stencil buffer.

My understanding of stenciling is that it prevents the fragment shader from running at all on certain portions of the screen (i.e. fragments pass or fail based on stencil settings). If that were true, then no matter what the fragment shader outputs, that pixel should remain black (in this context). Clearly, the fragment shader is still being run for pixels that should be rejected due to stenciling, which means I must be misunderstanding how the stencil buffer works.

Why is the fragment shader still running on pixels that should be rejected through stenciling?

Update 1: here are my stencil settings. No other objects (apart from water surfaces) write to the stencil buffer.

// Render water surfaces. 0x10 represents water. glEnable(GL_STENCIL_TEST); glStencilMask(0xFF); glStencilFunc(GL_ALWAYS, 0x10, 0xFF); glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);  BindWaterFrameBuffer(); BindWaterShader(); DrawWaterSurfaces();  // Render the scene. Due to the stencil settings, only non-surface pixels should be rendered. glStencilMask(0x00); glStencilFunc(GL_EQUAL, 0x00, 0xFF); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);  BindDefaultFrameBuffer(); BindSceneShader(); DrawFullscreenQuad(); 

Update 2: here’s another screenshot showing the submerged solid color test, but with a lower Y threshold (three meters below the water). What appears to be happening, then, is that pixels sampled using the GLSL texture function correctly honor the stencil buffer, while direct color outputs don’t. However, even that can’t quite be true since, as shown above, sampling pixels outside the stenciled portion of the screen still results in those pixels showing up.

#version 440 core  in vec2 fSource;  out vec4 outColor;  uniform sampler2D image; uniform sampler2D positions;  void main() {     vec3 position = texture(positions, fSource).xyz;      // The water surfaces happen to sit at Y value 7.85, but here, I'm using a threshold three meters below that.     if (p.y < 4.85)     {         outColor = vec4(1, 1, 0, 1);     }     else     {         outColor = texture(image, fSource);     } } 

Submerged pixels rendered using a solid color, but a few meters below the water surface.


Which Spheres of Might talents give a Vector attacks through Kinetic Overload?

The vector symbiat archetype, from Champions of the Spheres, has the ability Kinetic Overload, which reads, in part:

When a Brute, Scoundrel, or Wrestling talent would grant the vector an attack against a target within his telekinesis range as the result of performing a maneuver [emphasis mine], he may choose to make a ranged attack roll to pummel his target in place of the attack, dealing 1d6 + his casting ability modifier bludgeoning damage. This damage increases by 1d6 at 3rd level and every two levels thereafter and counts as magic.

My question is which martial talents from these three spheres actually grant these attacks? Some seem to obviously grant the attack (Scoundrel’s Mug, Wrestling’s Chink in the Armor), and others probably not (Wrestling’s Slip and Strike), but what about an ability such as Wrestling’s Piledriver?

When you successfully maintain a grapple against a creature you have already pinned, instead of one of the options normally available when you maintain a grapple, you may lift them over your head and smash them into the ground, automatically threatening a critical hit with your unarmed strike and rolling to confirm as normal. If the critical threat confirms successfully, the creature must make a successful Fortitude save or be staggered for 1 round. Use of this talent breaks your grapple on the creature. At +10 base attack bonus, the target is dazed for 1 round instead.

Does this fulfill the twin parts of Kinetic Overload, namely, "making an attack" (it’s automatically threatening a critical hit; no attack roll is being made, but a confirmation roll is called for), and "as the result of performing a maneuver" (it’s an option upon maintaining a grapple)? Does Kinetic Overload’s option to make the attack with telekinetic force override Piledriver’s requirement that the attack be made with an unarmed strike?

Piledriver’s the most confusing example I’ve found in my readings, but I’d like to see either a specific set of tests (does it have to be an attack roll, does it have to allow any weapon to be used with it, etc.) or a full list of all talents that grant an attack that Kinetic Overload can replace this way (probably no more than a dozen unless it’s a lot more generally applicable than I’m understanding it to be). I’m also working under the understanding that the attacks made as part of shove, marked target, and snag do not qualify, since they’re handled in their own paragraph of Kinetic Overload.