Copy component features to Instantiate object?

I’m trying to add component to Instantiate object. This new component is audioSource. Now I added the audio to the Instantiate but I want to copy all features from "_sound" to the new component.

 public AudioSource _sound;  public float targetCompass;  public GameObject ebullet;    Void Start() {       _sound = GetComponent<AudioSource>();     }   Void Update() {  if (targetCompass <= 5 )      {       GameObject bullets = Instantiate(ebullet) as GameObject;       bullets.AddComponent<AudioSource>();       bullets.GetComponent<AudioSource>() = _sound;      } 

}

Does Locate Object work on polymorphed equipment?

The spell Locate Object says:

You sense the direction to the object’s location, as long as that object is within 1,000 feet of you.

The spell Polymorph says:

The target’s gear melds into the new form. The creature can’t activate, use, wield, or otherwise benefit from any of its equipment.

If the object targeted by Locate Object has been "melded into the new form" of a polymorphed person will Locate Object succeed?

On one hand you could say the item, eg a spear, temporarily doesn’t exist and so cannot be located.

On the other hand spells only do what they say they do and Polymorph does not say is hides items from being detected.

What subfields in computer sciences may one study without learning Object Oriented Programming?

What subfields in computer sciences may one study without learning Object Oriented Programming or is there some kind of degree in Computer Science without the OOP knowledge requirement?

Is there a language without OOP?

Does one need to know OOP to simulate a CPU?

I wanted to earn a CS degree without ever learning OOP. Is there a name for that?

My guess what that Computer science without OOP is simply applied Statistics or Machine Learning using SKlearn and packages.

What happens when a caster targets an object that looks like a creature with a spell that targets only creatures?

There are many spells which explicitly target creatures:

Choose one creature within range

The target creature is normally supposed to make a saving throw in this case.

What happens when the caster chooses a creature, that is actually an object? For instance, a scarecrow, a mannequin, an illusion, or a corpse.

Examples:

  • An evil mage is hiding in the bushes. He casts an illusion of himself on the road, using the Silent Image spell. A PC sorcerer walks down the road, sees the illusion and casts Magic Missile on it.

  • A cleric is standing near a pile of dead bodies. He has suspicions that a few corpses are actually undead creatures. He casts Sacred Flame on every corpse, see which if them succeed, hence, reveals the undead.

  • A wizard casts Acid Splash on a mannequin, trying to damage it with acid.

Possible outcomes I can think of are:

  1. The caster cannot even try to cast the spell, regardless of their information about what the target actually is.
  2. The caster tries to cast the spell, the casting fails, not expending the spell slot.
  3. The caster casts the spell, it expends the spell slot, then fails.
  4. The caster casts the spell, but it hits the original and not the illusion.
  5. The caster casts the spell, it flies to the target illusion but deals no damage to it (passes through it).

References in the rules and Sage advice

I was trying to investigate, but it didn’t make things clearer:

  • Does magic missile hit silent image's illusory creature? has an answer, that Magic Missile won’t hit. It says nothing about if it can be targeted at all, it leaves it up to the DM.

  • Magic Missile automatically finds the original, even when the caster targets an illusion. At least when the illusion was created by the Mirror Image spell. Now confirmed by Jeremy Crawford. This supports the counter-intuitive option 4.

on the other hand

  • Casters don’t automatically know when a spell fails, if there were no perceivable effects (let’s say you can try to cast the Command spell on an illusion). That assumes that casters can waste their spells on illusion, which means they at least can target it. This supports options 3 and 5.

How to deploy a dynamic object using CloudDeploy

I want to deploy a dynamic object by CloudDeploy,which can update by the time interval, i check the help doc and find the method: enter image description here So i try this method but it seems not work as expected,the displayed result is fixed when i open the link,here is the code:

CloudDeploy[Dynamic[RandomReal[],UpdateInterval -> 1], Permissions -> "Public"] # CloudObject["https://www.wolframcloud.com/obj/b67a721a-25b2-449f-add3-\d257ecbbaa4b"] 

Is there anybody can help me?thanks.

‘Silence’ spell cast on a PC or object?

A PC Cleric wants to cast a ‘Silence’ on one of the two PC Fighters in their party so that the Fighters can enter a room to kill orcs without having the noise of the battle alarm orcs in other rooms. As long as the Cleric concentrates on the spell and doesn’t engage in other activities to stop the concentration is this ok? What about casting it on an object that you move around or throw into the midst of a room to eliminate the noise from activity/battle?

Could True Polymorph turn a creature like a shark into a object like a dead dragon turtle’s head?

I have a bard that has been true polymorphing into a dragon turtle and attacking coastal towns on a large island (think “Big Island” Hawaii) I am doing this so another member of my party can be true polymorphed into a bronze dragon adult and be seen “fighting” with me.

Our plan is for the fight to go into the ocean, then sometime later he as the bronze dragon will drag a part of a dragon turtle’ body out with him and declare himself their savior and new leader and/or guardian. then true polymorph on him will be dropped, he’ll say he used his dragon shapechange ability to look human. Then he will say he has to keep traveling to “right many wrongs” but that one day he will return.

Then at the end of the campaign if we are still alive, I will permanently make him an adult bronze (around 200 years old) and he will get to spend upwards of 5000 years retired and living as the king of an island nation. Also so he is a sailor background fighter so he plans to slowly reshape them into a sea fairing warrior people like the ancient Maori. He also plans to take a bride from the tribe once every generation till the whole island is full of dragon ancestry sorcerers and half-dragon humans.

We may not need the corpse head of a dragon turtle to pull this deception off we could say it died below the waves but it would help give us trick them and then for centuries the skull of a dragon turtle can adore their main village as a constant reminder of why they should follow him.

Object with many-to-many relationships with multiple tables

Here’s an example for a use-case that matches what I’m trying to better understand. Say I have 3 objects I need to deal with that are similar in many ways, such as invoice, PO, and receipt. They can all have a number, and amount, etc. They can also have many similar relationships, such as line items, images attached, etc. I can think of a number of ways of modeling this.

Option 1
Make everything separate. Have tables for invoice, invoice_line, invoice_image, then po, po_line, po_image, etc. This means strong referential integrity with foreign keys and least possible number of joins, but a ton of duplication for each table.

Option 2
Have parent document table with common fields and a type field, then have invoice, po, and receipt table have a foreign key to document_id. I can then have a single document_image table. For the lines, there are again some differences but many similarities between all, so could have a document_line table with a foreign key to document_id and invoice_line, po_line, and receipt_line tables with foreign key to document_id. Here, we have less duplication, keep referential integrity with foreign keys, but start having many more joins to get all the info we need. If I have an invoice line item and wanted to get all the info, I’d need to join invoice_line to document_line, invoice, and document.

Option 3
Use separate invoice/po/receipt tables, but for image relationship (or any other) add multiple nullable foreign keys, so image would have invoice_id, po_id, and receipt_id nullable foreign keys. With this we can still enforce referential integrity but we have some fields that will often be useless polluting things, plus we now can’t make a necessary field required because they all need to be nullable. We do cut down on duplication.

Option 4
Use separate invoice/po/receipt tables, but for image relationship (or any other) have a type field and fk_id field. This way I don’t need to have multiple many-to-many tables so it cuts down on duplication, especially if you have lots of these many-to-many, since it would always be 3 tables each time. I like this option the least because you can’t have a foreign key, I pretty much not even considering it as a valid option.

I’m leaning towards option 1 or 2, I think options 3 or 4 seem like bad design and I’d likely only consider if somebody explained that there are major performance benefits. For option 1, even though there’s duplication, you can get around it with code generation, so maybe not so big a deal. But would be interested in knowing if there’s a major advantage to breaking it down like option 2.

How To Place Object On Ground Within Radius?

I’m using Unity and I’m building an object placement system where you’ll be able to position objects around the player.

I’d like to place objects flush with the ground, parallel to world up, even on slopes, so I’ll use a raycast for that.

How would I limit the distance to maxDistance? I tried using ScreenPointToRay but the max distance on the raycast makes the movement of the object stop if the raycast doesn’t hit.

As an example, If I’m looking down in front of me, the object i’m controlling should be at that position. However, if I’m looking straight forward into Infinity, the object should only ever be maxDistance away. If I rotate, the object should follow smoothly.

Thanks!