dnd 5e – can a Familiar allow you to avoid verbal and somatic components?

The final section of the Find Familiar spell says:

Finally, when you Cast a Spell with a range of touch, your familiar can deliver the spell as if it had cast the spell. Your familiar must be within 100 feet of you, and it must use its Reaction to deliver the spell when you cast it. If the spell requires an Attack roll, you use your Attack modifier for the roll.

The only thing mentioned here us using the familiar to deliver the touch component of the spell, for which you use your attack modifier.

There is nothing in the spell description that alters any of the other aspects of casting a spell i.e. you still need the components or a focus, you have to make the somatic gestures and speak the verbal component.

You can still be seen casting the spell if you are in visual range and not hidden and if you are visible and in range then you can be Counterspelled as normal.

c++ – Why would I add components in code?

Watching a Unreal Course, and the instructor is creating a default pawn c++ class. He is adding all the components with code, but this seems really inefficient to me. Why can’t you add components in the engine like you can with blueprint classes? Also, I know you can convert c++ classes to Blueprint classes and still code using attached c++ components, is there a downside to doing this?

my main questions are these:

What is better about adding components in code?

What is the difference between creating a blueprint class and creating a c++ class but converting it into a blueprint?

What are the benefits of each? thnx.

dnd 5e – What’s the cheapest way for an Eldritch Knight to be able to wield two weapons while still being able to cast spells with somatic/material components?

For the purpose of this question, assume “two weapons” to include “a one-handed weapon and a shield”.

Compared to other spellcasters, Eldritch Knights are sort of at a disadvantage when it comes to achieving dual-wielding and the like, as they generally cannot use spellcasting foci (except when using magic items such as a Ruby of the War Mage). Thus, they normally seem to require a free hand for casting spells with components other than verbal ones. For comparison, a wizard could wield a Staff of Power, which – due to being a staff – counts as an arcane focus and thus solves the issue of noncostly material components, but it can also be used as a +2 quarterstaff.

For an EK trying to trivialize somatic components, Warcaster is the obvious choice (no difference to other spellcasters in this regard), and the requirement of a free hand for material components (without a GP cost) can be avoided with a Ruby of the War Mage. However, the former requires spending a feat (even though Warcaster is a pretty good feat for EKs anyway, especially considering that fighters get more ASIs than the average class), and the latter blocks an attunement slot and doesn’t work for costly material components. Plus, if you happen to die in a battle, your attunements end, even if you get Revivified right away (although that’s probably a very rare or even legendary problem ^^).

Is there a cheaper way to get around the issue? For the purpose of defining “expensive”, please consider this order (the higher up on the list, the more expensive):

  1. Multiclassing (and requiring three multiclass levels is obviously worse than requiring one)
  2. Requiring additional actions
  3. Feats
  4. Attunement Slots
  5. Requiring additional bonus actions
  6. Choosing specific (sub-)class options, such as a Fighting Style.
  7. Magic Items without attunement
  8. Ingame time (e.g. downtime training)
  9. Requiring your object interaction
  10. Money

I’m aware of other questions on almost the same topic, namely this one (warlock-focused or at best generic), this one (technically answers the issue, but some GMs might consider dropping and picking your weapon up cheesy, plus there are downsides and it only works with Sage Advice rulings), as well as this one (answers claim it’s not an issue, which is not true IMHO – for example, Booming Blade or Green Flame Blade, both great melee cantrips for an EK, have material components).

What is the best icon to show full size / mini-size of 2 components

thank you for approaching my question.

I have the following side bar that contains two components:

enter image description here

When you toggle one of the components using the top-right icon, it will set the state of the component to closed, and make the second one full height:

enter image description here

The issue

I don’t really know what type of an icon I can use there to tell the user that if you close this, the other one will go full height. I don’t think that I can even use the minus symbol because I am already using it in one of the components at top-left.

design – OOP Vanilla JavaScript: loading components dependent on current page

I’m building an app in vanilla JavaScript, trying to keep it Object Oriented.
I’ve split it into many component classes, each roughly “wrapping” the logic for one DOM element, e.g. a form or table.
Components are recycled across multiple pages, which becomes a pain when trying to determine which components to load and getting them to talk to each other indirectly through mediators.

My pseudocode:

// Classes split across many files
class UsersSmartTableWrapper {
     
     editButtons = (//Array of button HTML elements which allow edits  );
     constructor() {
          this.tableElement = document.getElementByID('TableID')
          this.editButtons = ...;
          this.editButtons.forEach(b => // add click event listeners)
     }
}

class EditUserFormWrapper {

     onSubmit(event) {
          // Prevent page reload, build custom API data structure and POST request etc
          // and once done
          this.formElement.dispatchEvent(new Event('UsersUpdated')) 
     }
     
     constructor(apiWrapperService) {
         this.formElement = document.getElementByID('EditUsersForm');
         this.apiWrapperService = apiWrapperService;
     }
}

class EditUsersFormSmartTableMediator() {
     
     onUsersUpdated() {
          // Update table
     }
     
     onDataTableButtonEditRequest() {
          //Open form and bind user data to it to edit
     }
     
     constructor(editUserFormWrapper, usersSmartTableWrapper ) {
          this.editUserFormWrapper = editUserFormWrapper;
          this.usersSmartTableWrapper  =  UsersSmartTableWrapper ;

          //Add event listeners to child components here
     }

}


class AnotherMediatorWithEvenMoreElements {
     constructor() {
          
     }
}
... many other componenets

My solution in the entry point looks something like this:

//main.js
window.addEventListener('load', ()=>{
     let href = window.location.href;

     // This one is easy to bring out of the big if else, as it is not dependent on a DOM element 
     // that may/ may not be present.
     let apiWrapper = new ApiWrapper();
     
     if (href.startsWith('Users/Details')) {
          
          let editUserForm = new EditUserFormWrapper(apiWrapper)
     } else if (href.startsWith('Users/Datatable')) {
          let dataTable = new UsersSmartTableWrapper();
          


          // I have to do this / for _every_ page that has the EditUserForm element.
          // which isn't all pages!
          let editUserForm = new EditUserFormWrapper(apiWrapper)


          let mediator = EditUsersFormSmartTableMediator(editUserForm, dataTable );


     } else if (href.startsWith('Users/AnotherPage')) {
          new AnotherMediatorWithEvenMoreElements(... dependencies go here) // etc etc...
     }
})

To me, this solution feels “hacky”. It results in repeatedly writing “new Component” at multiple points in the if/ else to build DOM dependent components. This goes against DRY and gets worse as more components are added to the app.

I know that this is the argument for Single Page Apps like Angular but for this project that isn’t an option.

Is there a design pattern for OOP JavaScript that can build components dependent on the current page in situations like this? Is depending on the href like this good practice?

design – When components of an event-driven program require specific responses to specific events, is event-driven still the correct approach?

I’m working on a multi-threaded program that interfaces with external USB/serial devices via user-space device drivers.

Early in the design stage, I made the decision to split the program into three components: A, B and C.

  • Component A would possess full responsibility of communication with external devices (this is where the user-space device drivers would run). It would run on a dedicated thread.
  • Component B would serve an API off of a TCP/IP socket to third-party clients that needed access to the external devices. This component would also run on a dedicated thread.
  • Component C would provide a GUI for the user, allowing them to view and manipulate data from the external devices. Again, this would be on a dedicated thread.

So components B and C both require access to the external devices, which component A would provide.

I needed a way for the three components to interface with each other, and at the time I thought making the program event-driven would be appropriate. With this approach, components would emit an event and other components would handle those events. I always knew that some events would require responses, in the form of subsequent events. For example, if component C wanted to pull some data from the external device, to present to the user in the GUI, it would emit an event to request the data from component A, and component A would handle that event, and return the requested data in a subsequent event, which component C would be waiting for.

Since defining the above approach, I’ve realised that, in some cases, a component may require a specific response to a specific event. So building off of the example above, if component C and component B requested different data from component A, component C should be able to wait for the correct response event (that is, the response to the event emitted by component C).

So I’m considering implementing the ability for a component to wait for an event that is a direct response to the previously emitted event. I would do this via event IDs, where each event would carry an ID, and an optional response ID. The response ID would be the ID of the event that the current event is in response to.

But I feel like I’m on the wrong path. Is this really an appropriate use of event-driven design? Is it OK for events to serve as requests for data, and subsequent events as responses? Would you do it differently? If so, how?

EDIT/UPDATE:

I’ve just come across this video by Mark Richards, which seems to describe my approach with event IDs and response IDs (which he calls “correlation IDs”). So maybe I’m not on the wrong path – he seems to think using events for request/response is fine. Would still appreciate your thoughts.

c# – How do you structure components to objects so they are more decoupled and non dependant?

I want to setup my objects to be composed of components that can be added and removed so I have more flexibility in how I set them up.

A simple example would be some object that can have components attached such as:

MoveComponent //lets the object move around
HealthComponent //allows the object to take damage and be destroyed

So say i have some object like Player and i want to impact damage to it, how do i first check it can take damage by checking it has a HealthComponent and then also call a method in the HealthComponent to apply the damage.

My first thought was have each component register the to the Player object and store them in a HashSet<IComponent> but if I use an interface for the polymorphic benefits to add them to a collection theres not really much else in common with them and I would have to loop through the hash set every time to check if for example the HealthComponent exists and then if it does, cast it from the interface to the type required and call the Damage() function.

Such as:

public bool CanTakeDamange()
{
   foreach(var component in components)
   {
      if(component is HealthComponent) return true; 
   }
}
public void ApplyDamange(float damageValue)
{
   if(!CanTakeDamange)return;
   foreach(var component in components)
   {
      if(component is HealthComponent) 
      { 
         ((HealthComponent)component).ApplyDamage(damageValue);
         return;
      } 
   }
}

This does not seem like a smart approach to me, lots of loops every single time, as well as type checking and casting. Is this actually how people do component based systems to allow for a more decoupled setup?

Or is there a smarter way more streamlined way to do this?

dnd 5e – How do the material components of Heat Metal work?

The manufactured metal object is the target of the spell.

Heat metal says:

Choose a manufactured metal object, such as a metal weapon or a suit of heavy or medium metal armor, that you can see within range. You cause the object to glow red-hot.

So we are choosing a piece of manufactured metal we can see, and we are targeting it with the spell.

The iron and flame can be replaced by a component pouch or spellcasting focus.

A piece of iron and a flame are the components of the spell (and separate from the metal target of the spell). You need these two things to cast it. But they can be provided by a component pouch or spellcasting focus. The component pouch description says:

A component pouch is a small, watertight leather belt pouch that has compartments to hold all the material components and other special items you need to cast your spells, except for those components that have a specific cost (as indicated in a spell’s description).

So whatever you need to produce the flame required for heat metal is in there, and it’s probable a piece of flint to strike on the iron.

The rules also permit a focus to be used instead:

Casting some spells requires particular objects, specified in parentheses in the component entry. A character can use a component pouch or a spellcasting focus (found in “Equipment”) in place of the components specified for a spell.

If you don’t have a focus or component pouch, the rules aren’t crystal clear, but the rules for material components require a free hand, so “within reach” seems like the most reasonable ruling.

dnd 5e – Heat Metal – Questions about the components

I’m a rookie DM with an even more rookie group of players. I have some questions about Heat Metal (2nd level transmutation).

It says you need a piece of iron and a flame. It also says the target of the spell is a manufactured metal object.

  • The piece of iron and the manufactured metal object are two separate objects, right? The caster needs to be in possession of the piece of iron, and the enemy would optimally be touching the manufactured metal (any metal – not just iron) object. Is that right?
  • Does the flame need to be close enough to the caster to touch (for example, if the caster would need to hold the piece of iron into the flame), or simply in the range of the spell? Intuitively I would have opted for the latter, as I’d imagine the caster would be drawing energy from nearby flames.
  • If there is no environmental fire nearby, would they have to use one action to light a fire with their tinderbox first? The PHB says “Don’t bother to keep track of material components with negligible cost. Assume you have all you need as long as you have your spell component pouch.” Does that apply here? Obviously the flame doesn’t have a cost, so can I just assume the caster.. uhm.. has a flame in their pouch? Or can we say lighting a small piece of tinder is part of the spell action?

I guess some/all of these could be answered with “DM-fiat”, but in that case I’d be interested in how seasoned DMs rule it 🙂

Thanks!

statistics – Find principal components of $(X_1,X_2,X_1+X_2)$

I need to find the principal components of $(X_1,X_2,X_1+X_2)$ and the proportion of variance the first principal component explain. No information about the distribution or independence of the $X_i$ is given.
If we denote $v_1= Var(X_1)$, $v_2=Var(X_2)$ and $c=Cov(X_1,X_2)$, then the variance-covariance matrix is given by
begin{pmatrix}
v_1&c& v_1+c\ c & v_2 & v_2 +c \ v_1+c & v_2 +c & v_1+v_2+2c
end{pmatrix}

Calculating the eigenvalues and eigenvectors of this matrix takes some effort. Is there a smarter way to calculate the principal components?
Thanks in advance