# Switching Stats? 

**URL:** <https://forum.choiceofgames.com/t/switching-stats/47259>\
**Category:** ChoiceScript Help\
**Created:** [December 13, 2018, 7:38pm UTC](https://forum.choiceofgames.com/t/switching-stats/47259 "2018-12-13T19:38:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mowque](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mowque](https://forum.choiceofgames.com/u/mowque)\
**Post date:** [December 13, 2018, 7:38pm UTC](https://forum.choiceofgames.com/t/switching-stats/47259/1 "2018-12-13T19:38:32Z")

</div>

Hello, beginner here.

Is there a way to have a choice replace all of one stat with another? ie, ‘spend’ all of your wealth on, say, influence and have the values of the two stats switch?

Is so, how can it be done?

---

<div class="post-metadata">

**Author:** ![MeltingPenguins](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/meltingpenguins/32/255855_2.png) [@MeltingPenguins](https://forum.choiceofgames.com/u/MeltingPenguins)\
**Post date:** [December 13, 2018, 7:49pm UTC](https://forum.choiceofgames.com/t/switching-stats/47259/2 "2018-12-13T19:49:23Z")

</div>

Hi there.

I think the way to do this is (someone correct me if I got this wrong)

```
*temp switch_a
*set switch_a wealth
*set wealth influence
*set influence switch_a

```

I think

---

<div class="post-metadata">

**Author:** ![trevers17](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/trevers17/32/127415_2.png) [@trevers17](https://forum.choiceofgames.com/u/trevers17)\
**Post date:** [December 13, 2018, 7:50pm UTC](https://forum.choiceofgames.com/t/switching-stats/47259/3 "2018-12-13T19:50:06Z")

</div>

Well, if you’re spending wealth to increase stats, it might be better to decrease the wealth stat and increase in the influence stat instead of swapping them.

But if you’re swapping, say, influence and strength, you can do what @MeltingPenguins suggested before I could. 😛

---

<div class="post-metadata">

**Author:** ![mowque](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mowque](https://forum.choiceofgames.com/u/mowque)\
**Post date:** [December 13, 2018, 8:33pm UTC](https://forum.choiceofgames.com/t/switching-stats/47259/4 "2018-12-13T20:33:50Z")

</div>

Good point.

Is there a way to decrease one stat by the same amount as you raise another one? I obviously can’t assign values since the stat may be at any number of values at this point in the game.

---

<div class="post-metadata">

**Author:** ![MeltingPenguins](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/meltingpenguins/32/255855_2.png) [@MeltingPenguins](https://forum.choiceofgames.com/u/MeltingPenguins)\
**Post date:** [December 13, 2018, 8:37pm UTC](https://forum.choiceofgames.com/t/switching-stats/47259/5 "2018-12-13T20:37:15Z")

</div>

If you do it at the same time:

```
Invest 20 into...
*fake_choice
   #charm
      *set coins -20
      *set charm +20
   #power 
      *set coins -20
      *set power +20

```

---

<div class="post-metadata">

**Author:** ![Minnow](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Minnow](https://forum.choiceofgames.com/u/Minnow)\
**Post date:** [December 13, 2018, 11:12pm UTC](https://forum.choiceofgames.com/t/switching-stats/47259/6 "2018-12-13T23:12:58Z")

</div>

> [@mowque](#):
>
> I obviously can’t assign values since the stat may be at any number of values at this point in the game.

@MeltingPenguins’ advice is still the way to go even if you’re not sure how much the stats will change by. The process will be the same, with one tiny difference: Instead of adding and subtracting a fixed value, you can add and subtract the value of another variable. Something like this:

```choicescript
Spend how much of Stat 1 to increase Stat 2?
(0 is a permissible response.)
*input_number placeholder 0 stat_1
*set stat_1 -placeholder
*set stat_2 +placeholder

```

The three variables in the above example are:

- `placeholder`, used to control how much the other two variables are changing by,
- `stat_1`, the variable being decreased, and
- `stat_2`, the variable being increased.

Note: The `0` and `stat_1` parameters that follow `*input_number placeholder` are simply there to limit what can be typed into the dialog. The first sets a minimum value, the second sets a maximum. By using `stat_1` as the maximum, it becomes impossible to spend more than is available, no matter how much or how little that may be.

---

<div class="post-metadata">

**Author:** ![mowque](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mowque](https://forum.choiceofgames.com/u/mowque)\
**Post date:** [December 14, 2018, 9:08pm UTC](https://forum.choiceofgames.com/t/switching-stats/47259/7 "2018-12-14T21:08:52Z")

</div>

Thank you, you have all been very helpful!
