How to filter and get specific keys from JSON objects array

I have a JSONB field containing a value in this structure:

[     {         "type": "small",         "name": "Josh",         "greeting": "Hello buddy!",         "hobby": "billiards",         "place": "Barcelona"     },     {         "type": "big",         "name": "Aziz",         "greeting": "Hey man!",         "hobby": "tennis",         "place": "Montpellier"     } ] 

I want to include this output if type is equal to "big":

{     "greeting": "Hey man! How're you doing Aziz?",     "place": "Montpellier" } 
  1. In the first row, I combined two values into one with some additional words.
  2. I don’t want my whole output to be empty if there isn’t type value equal to "big". Instead, output values of type value equal to "small" as a fallback.
  3. If there is not a fallback with type equal to "small", then output an empty string or NULL value but without Nulling the whole query result. Or preferably, not include these keys if no value is present.

I know I can combine values into one by using CONCAT but don’t know how to build this query and integrate it. I can’t loop through the array and output the values of the object that matches my filter. Tried CASE but still wasn’t able to get the result I want.

I use PostgreSQL 13.

Read actor instance’s text variable for widget when triggered on different objects

What I’m trying to do: (a ‘long story version’ is linked in comment below)

(and another user example is hyperlinked in comment below – i couldn’t post over 8 images and/or links in this first comment*) (there are other similar user questions elsewhere I know)

Short story: I’m trying to make a widget that is triggered by an actor blueprint, and I want the widget to display different text that reflects the public-variable-text edits I make in the editor.

My latest progress includes actors that are titled somewhat according to the hyperlinked user case above so, I have a "door_trigger" and a "doorWidget". I have altered the pin connections so much that I am just going to copy and paste all my screen shots below.

I got to change text asset DoorName by making a public variable called "name," as you’ll see. I can make the trigger show this text on screen and have it disappear when the user leaves the trigger actor, BUT EVERY INSTANCE ALSO SHOWS THIS TEXT VALUE, EVEN THOUGH I CHANGE IT

In the screenshots (some in comment following too) you’ll see the text "3" appear on screen, and it does this for all three of the dummy boxes I made; notice how the second box is supposed to show "dd" (I was just typing random filler content).

ALL HELP SO APPRECIATED!!!!! Thank you!!!

alt text alt text alt text alt text alt text

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

enter image description here enter image description here

Unity – using Colliders with custom objects

Hi so I’m quite new to Unity and currently experiencing issues with colliders, a quick summary of what I have.

Player >

Object = Capsule ( Directly created through Unity ) Components = CharacterController, CapsuleCollider & a PlayerController script 

Basic Tile >

Object = Rectangle ( Imported from blender ) Components = BoxCollider 

this combination works well, no issues. However when I get to slightly more complex objects, such as elevated terrain I can’t apply a box collider because the surface isn’t flat. So my next thought was to add a Mesh Collider but unfortunately it doesn’t seem to do anything effective ( my player falls through ) I don’t know whether that’s because Mesh Colliders are only relevant to RigidBodies? Unfortunately though I can’t switch from a CharacterController to a RigidBody.

So I’m not sure what to do, maybe MeshColliders are reponsive to a CharacterController and my settings aren’t adjusted correctly?

What is the initiative of the objects animated by the Animate Objects spell?

The Animate Objects spell indicates that the objects act on their turn, but it doesn’t explicitly state what their initiative is. Are they supposed to roll initiative using their Dex modifiers (either individually or with their size class)? This would be as in the Find Familiar spell:

In combat, it rolls its own initiative and acts on its own turn.

Or do they act immediately after the caster? This would be as in the Summon Beast spell:

In combat, the creature shares your initiative count, but it takes its turn immediately after yours.

Or does this simply require a decision by the DM?

Damaging inanimate objects in battles to indirectly gain advantage in battles

  1. I was thinking of using Spell damage to knockdown a dead Tree trunk in order for it to land on two/three skeletons and therefore pinning them effectively in place.

  2. Assuming having 1 Torch lit only with an all-human party (and I am Chaotic Evil), I was thinking of aiming my spell on the Torch effectively putting it out and make my quick getaway.

Are these possible scenarios?

This is for the Table Top game Dungeons and Dragons (DnD-e5). (sorry about that)

How much XP does a monster created by Animate Objects add to an encounter?

I am making a boss fight. The boss can cast animate objects, a spell that can animate statues.

The spell gives information for, eg., 1 Large Construct:

Large – HP: 50, AC: 10, Attack: +6 to hit, 2d10 + 2 damage, Str: 14, Dex: 10

How much XP should I award for this Large construct?

I’m estimating CR1 (200XP) each.

Detect collisions for each instantiated objects

I want to instantiate cube at a random position when I click mouse and do something (change color or freeze position ..) for each cube when detect collision on the plane.

I tried first few steps:

public Rigidbody cube;  void OnCollisionEnter(Collision collision) {     if (collision.gameObject.name == "Plane")     {         //Do somthing for each cube         cube.constraints = RigidbodyConstraints.FreezePositionY;     } }  void Update() {     Vector3 position = new Vector3(Random.Range(-5f, 5f), 8,Random.Range(-5, 5));      if (Input.GetMouseButtonDown(0))     {         Rigidbody clone;         clone = Instantiate(cube,position, Quaternion.identity);     } } 

Mirror Networking; Scene’s network objects are disabled when building server separately

if one of the clients is also the server then this situation does not happen and networked scene objects are visible. But when building the server separately and then when a client is connected, all the network objects are disabled. I have read the documentation but still can’t figure it out. I am loading the level scene additively. Here is the related documantation and link :
https://mirror-networking.com/docs/Articles/Components/NetworkIdentity.html https://mirror-networking.com/docs/Articles/Guides/Visibility.html

Scene-based Network Game Objects

You can also network game objects that are saved as part of your Scene (for example, environmental props). Networking game objects makes them behave slightly differently, because you need to have them spawn across the network. When building your game, Unity disables all Scene-based game objects with Network Identity components. When a client connects to the server, the server sends spawn messages to tell the client which Scene game objects to enable and what their most up-to-date state information is. This ensures the client’s game does not contain game objects at incorrect locations when they start playing, or that Unity does not spawn and immediately destroy game objects on connection (for example, if an event removed the game object before that client connected). See Networked Scene Game Objects for more information.

Network Visibility

Multiplayer games use the concept of network visibility to determine which players can see which game objects at any given time during game play. In a game that has a moving viewpoint and moving game objects, it’s common that players cannot see everything that is happening in the game at once. If a particular player, at a certain point in time during game play, cannot see most of the other players, non-player characters, or other moving or interactive things in your game, there is usually no need for the server to send information about those things to the player’s client. This can benefit your game in two ways:

  1. It reduces the amount of data sent across the network between players. This can help improve the responsiveness of your game, and reduce bandwidth use. The bigger and more complex your multiplayer game, the more important this issue is.
  2. It also helps prevent some cheating. Since a player client does not have information about things that can’t be seen, a hack on that player’s computer cannot reveal the information.

The idea of “visibility” in the context of networking doesn’t necessarily relate to whether game objects are directly visible on-screen. Instead, it relates to whether data should or shouldn’t be sent about the game object in question to a particular client. Put simply, if a client can’t ‘see’ an game object, it does not need to be sent information about that game object across the network. Ideally you want to limit the amount of data you are sending across the network to only what is necessary, because sending large amounts of unnecessary data across the network can cause network performance problems. However, it can be also be resource intensive or complex to determine accurately whether a game object truly visible to a given player, so it’s often a good idea to use a more simple calculation for the purposes of determining whether a player should be sent networked data about it – i.e. whether it is ‘Network Visible’. The balance you want to achieve when considering this is between the cost of the complexity of the calculation for determining the visibility, and the cost of sending more information than necessary over the network. A very simple way to calculate this is a distance (proximity) check, and Mirror provides a built-in component for this purpose.