I used bool parameter in my animator controller setting it to true by script but where should I set it back to false and when?

using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI;  public class FireEffect : MonoBehaviour {     public Transform player;     public Transform target;      private float timeElapsed = 0;     private float lerpDuration = 3;     private float startValue = 1;     private float endValue = 0;     private float valueToLerp = 0;      private Animator playerAnimator;     private bool prevFacing = false;     private bool stopped = false;     private bool move = true;     private bool rot = false;     private Vector3 currPos;      private void Start()     {         playerAnimator = player.GetComponent<Animator>();     }      private void Update()     {         var currFacing = IsFacing(target);         if (currFacing != prevFacing)         {             timeElapsed = 0;         }         prevFacing = currFacing;          var distance = Vector3.Distance(player.position, target.position);          if (IsFacing(target))         {             if (distance < 10 && move)             {                 if (timeElapsed < lerpDuration)                 {                     valueToLerp = Mathf.Lerp(startValue, endValue, timeElapsed / lerpDuration);                     playerAnimator.SetFloat("Forward", valueToLerp);                     timeElapsed += Time.deltaTime;                 }                 playerAnimator.SetFloat("Forward", valueToLerp);                 stopped = true;                 valueToLerp = 0;             }              if (move == false)             {                 playerAnimator.SetFloat("Forward", 0);             }              if (playerAnimator.GetFloat("Forward") == 0 && stopped)             {                 move = false;                 rot = true;                 currPos = player.position;                 stopped = false;                 Debug.Log("Player current position when valueToLerp value is 0 : " + currPos);             }         }                  if(rot)         {             playerAnimator.SetBool("Walk Back", true);              rot = false;         }          if (playerAnimator.GetCurrentAnimatorStateInfo(0).IsName("Walk Back"))         {             playerAnimator.SetBool("Walk Back", false);         }     }      private bool IsFacing(Transform target)     {         Vector3 forward = player.TransformDirection(Vector3.forward);         Vector3 toTarget = target.position - player.position;         return Vector3.Dot(forward, toTarget) > 0;     }      public IEnumerator ScaleOverSeconds(Vector3 scaleTo, Vector3 rotateTo, Vector3 moveTo, float seconds)     {         float elapsedTime = 0;         Vector3 startingScale = player.localScale;         Vector3 startingRotation = player.localEulerAngles;         Vector3 startingPosition = player.localPosition;          while (elapsedTime < seconds)         {             player.localScale = Vector3.Lerp(startingScale, scaleTo, (elapsedTime / seconds));             player.localEulerAngles = Vector3.Lerp(startingRotation, rotateTo, (elapsedTime / seconds));             player.localPosition = Vector3.Lerp(startingPosition, moveTo, (elapsedTime / seconds));              elapsedTime += Time.deltaTime;              yield return null;         }         player.localScale = scaleTo;         player.localEulerAngles = rotateTo;         player.localPosition = moveTo;     } } 

At this part, I’m setting the bool to true once and it’s playing the "Walk Back".

if(rot)             {                 playerAnimator.SetBool("Walk Back", true);                      rot = false;             }                  if (playerAnimator.GetCurrentAnimatorStateInfo(0).IsName("Walk Back"))             {                 playerAnimator.SetBool("Walk Back", false);             } 

After that, I’m setting the trigger to false when it’s finishing playing it because if I will not set it to false it will keep playing the "Walk Back" nonstop.

I want that it will play it once but also when rot is true again then play it again once. but because I’m setting it false it’s not playing it again even if rot is true again.

animator controller

I created a transition from the Grounded blend tree to the Walk Back with the bool condition in the screenshot.

The Walk Back is working fine smooth as I wanted the problem is now how to make it play once only each time rot is true?

The way or the place in the script I’m setting the bool back to false make it that it will not play the Move Back ever again even if rot is true.

Guidelines for setting haggle test difficulty when using the tracking money option?

I have been running a game of WFRP 4e and my players haven’t really been enjoying tracking money much so I was thinking of switching to the optional tracking money rule on page 290 of the rule book.

Where some groups like to track every penny closely, perhaps even using chits or fantasy coins to represent in-game coins, others prefer to ignore all fiscal book-keeping. The game rules assume you are counting every coin, but if you wish to simplify money, you can do so using your Status. If an item costs less than your Status level — so if you have a Status of Silver 2, any item costing 2 silver shillings or less — you are assumed to be able to buy as much as needed of that item. Beyond that, you can buy a maximum of one item a day that costs more with a Haggle Test, with the difficulty set by the GM according to the cost of the item and the local markets.

My problem is that according to the rules only a gold tier character can reasonably afford a main gauche let alone other weapons so my players will need to make haggling tests however I couldn’t find a guideline for haggle tests when using this system.(And the regular haggle rules woul not be appropriate on the grounds that the most you can negotiate is a %50 off) So what I wish to ask is Are there any guidelines somewhere for setting haggle difficulty and if not what are the rules you use on your table?

AWS Postgres setting pg_trgm.word_similarity_threshold

Trying to set pg_trgm.word_similarity_threshold on an RDS postgres instance (postgres 12 if it matters):

ALTER SYSTEM SET pg_trgm.word_similarity_threshold = 0.3; 

I get the error: must be superuser to execute ALTER SYSTEM command

I don’t see this in the parameter groups even though pg_trgm is a supported extension. Is there something I’m missing?

How to create a clickable static call us button that links to a new setting in general

I recently had an admin setting created on my website that allows me to input a contact number to display on the front end via a shortcode.

Now I am now trying to use this field to also create a clickable and static call button for mobile devices only that appears on the bottom of their screens.

There are plugins like WP Call Button that achieve this, but I am trying to keep my website as light as possible. Any help would be much appreciated!

I think I may need another 2 admin fields created that act as a text label as well as the hyperlink function? e.g. tel:035555555?

enter image description here

Here’s the code that was created (thanks again Walter) for my general settings:

/**  * Class for adding a new field to the options-general.php page  */ class Add_Settings_Field {      /**      * Class constructor      */     public function __construct() {         add_action( 'admin_init' , array( $  this , 'register_fields' ) );     }      /**      * Add new fields to wp-admin/options-general.php page      */     public function register_fields() {         register_setting( 'general', 'phone_number_custom', 'esc_attr' );         add_settings_field(             'custom_phone_number',             '<label for="custom_phone_number">' . __( 'Phone Number' , 'phone_number_custom' ) . '</label>',             array( $  this, 'fields_html' ),             'general'         );     }      /**      * HTML for extra settings      */     public function fields_html() {         $  value = get_option( 'phone_number_custom', '' );         echo '<input type="text" id="custom_phone_number" name="phone_number_custom" value="' . esc_attr( $  value ) . '" />';     }  } new Add_Settings_Field(); 

How to create shortcodes that pull custom field data from general settings

Overcoming setting complexity paralysis as a GM

The problem

What are the best practices to overcome that certain “complexity paralysis” that may strike a GM when trying to learn and immerse himself in a setting that has a lot of intricate background information?

An example

For example, let’s say you’re a GM who decides to give a try to running Shadowrun for the first time in your life (no matter how experienced you are in other games and/or settings.) You settle on an edition — only to realize that the game has been around for decades, and it has so much background info it could fill half the Encyclopædia Britannica (well, not literally, obviously, but you get the point).

Hesitatingly, you decide to get some focus, cut away a huge chunk of the looming material, and set your story in Redmond, Seattle. Sure, you get an official handbook for Seattle, and read through it (quickly, because gaming night is upon you) — but in doing so, you discover that there are tons of relevant, related sourcebooks (like… on magic, critters, the matrix, cyberware, etc.).

Sure, you can ignore the sourcebooks and go for a minimal approach… but even so, when you start designing your adventure (already feeling out of touch with the world of Shadowrun simply because of knowing how much you don’t know), you realize that besides the setting info, there are tons of in-game factors to consider, think through, and work into even the simplest campaign. Corporate politics and workings, magical aspects and relationships, shadow politics, gang politics and workings, the nuances of running the shadows, and so on. Of course, without reading as much as possible of the official sourcebooks, you’ll have no idea about the existence of a ton of factors — as if the sketchy stuff you learned from the core rulebook and the city sourcebook weren’t complicated enough.

And, by this time, you’re gripped by the title’s setting complexity paralysis. You’d love to run the game, but you feel you have no real idea how stuff should work, and no time (let alone a reliable entry point) into the hypercomplicated, cross-referenced lore. And with that, you return to running something you know, be it a world you’ve been following since its inception or one that you’ve built yourself. You skip running Shadowrun.

Mind you, I’m definitely not looking for answers focused on Shadowrun. It’s just an example. (Sure, it’s okay if you use it as an example for general suggestions.) I could practically have brought up quite a number of other worlds. Star Wars EU. WoD & nWoD. The Forgotten Realms. Warhammer FRP. And so on, and so on.


What I’m looking for is methods that help you, the GM, through this “setting complexity paralysis”, this disheartening and disappointing block that hits you when you face a huge amount of background material without which your game won’t feel authentic, just a bad copy, an alternate universe of an alternate universe.