> For the complete documentation index, see [llms.txt](https://infinitypbr.gitbook.io/magic-pig-games/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitypbr.gitbook.io/magic-pig-games/juicy-actions/deterministic-random.md).

# Deterministic Random

{% embed url="<https://www.youtube.com/watch?v=6rUoqSzPwWY>" %}

The <mark style="color:yellow;">Deterministic Random</mark> feature provides a robust randomization with predicatable results using global and local seeds. Each <mark style="color:yellow;">Action Executor</mark> can set the type of random it will use in the Inspector.

<figure><img src="/files/gyAhew0k6aYXWxDNjstm" alt="" width="563"><figcaption></figcaption></figure>

You can ensure actions result in the same target selections using the *Action Random String* value, detailed below.

## Random Types

### Random Seed

This is essentially the same as the normal "random" value you're used to — results will appear entirely random.

### Deterministic Global

This uses the global seed set in the [Juicy Actions Settings](/magic-pig-games/juicy-actions/juicy-actions-settings.md) file.

{% hint style="warning" %}
You will get the same result every time the `ActionExecutor` is executed!
{% endhint %}

### Deterministic Global Varied

This uses the global seed set in the [Juicy Actions Settings](/magic-pig-games/juicy-actions/juicy-actions-settings.md) file, but changes each time the `ActionExecutor` is executed, so that each execution will have a different result, but the pattern of results will be the same every time, based on the global seed.

### Deterministic Local

This uses the local seed set in the <mark style="color:yellow;">Action Executor</mark> Inspector.

{% hint style="warning" %}
You will get the same result every time the `ActionExecutor` is executed!
{% endhint %}

### Deterministic Local Varied

This uses the local seed set in the <mark style="color:yellow;">Action Executor</mark> Inspector, but changes each time the `ActionExecutor` is executed, so that each execution will have a different result, but the pattern of results will be the same every time, based on the local seed you provide.

## Action Seed Variations

Each <mark style="color:yellow;">Action</mark> in the list will have it's own unique result based on the UID of the <mark style="color:yellow;">Action</mark>. This ensures that two of the same type of <mark style="color:yellow;">Action</mark> will have potentially different results.

You can overwrite this value in the Inspector by providing a unique *Action Random String* value.

<figure><img src="/files/U8TEkyHcuy5TjWyqzB5z" alt="" width="563"><figcaption></figcaption></figure>

In this example, the `MoveAction`, `ScaleAction`, and `SpinAction`, all have the same *Action Random String*, so the target(s) selected upon execution will be the same for each, so that the effects will apply to the same target(s) each time it runs.

{% hint style="success" %}
Each <mark style="color:yellow;">Action</mark> with the same *Action Random String* must have the same list of *Targets* in the same order, *Selection Mode*, and *Target Count*.
{% endhint %}
