# Can't extract token error?

**URL:** <https://forum.choiceofgames.com/t/cant-extract-token-error/667>\
**Category:** Game Development\
**Created:** [August 3, 2012, 3:49pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667 "2012-08-03T15:49:22Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [August 3, 2012, 3:49pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/1 "2012-08-03T15:49:22Z")

</div>

Does anyone know what the ‘cannot extract token’ error is?

\*set hisher1: “his” [The error is this line but can’t see an issue with it?]

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [August 3, 2012, 3:57pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/2 "2012-08-03T15:57:17Z")

</div>

The colon may be causing it. It shouldn’t be there.

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [August 3, 2012, 3:58pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/3 "2012-08-03T15:58:07Z")

</div>

@Reaperoa

can’t believe I missed that! thanks!

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [December 11, 2012, 2:47pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/4 "2012-12-11T14:47:50Z")

</div>

I’m having another token related error. this is the piece of code that is having the issue.

```
*fake_choice
  *if (friend_status >1)
    #${friend}.
      *set partner "${friend}"
      *set himher1 "${himher}"
      *set heshe1 "${heshe}"
      *set hisher1 "${hisher}"
      *set rapport 50

  *if (victor_status >1)  
    #Victor.
      *set partner "Victor"
      *set himher1 "him"
      *set heshe1 "he"
      *set hisher1 "his"
      *set rapport 15

  *if (ashley_status >1)  
    #Ashley.
      *set partner "Ashley"
      *set himher1 "her"
      *set heshe1 "she"
      *set hisher1 "her"
      *if (ashley_rep > 2)
        *set rapport 50
      *else
        *set rapport 25

  *if (anthony_status >1)  
    #Anthony.
      *set partner "Anthony"
      *set himher1 "him"
      *set heshe1 "he"
      *set hisher1 "his"
      *set rapport 25
                    
  *if (austin_status >0)  
    #Austin.
      *set partner "Austin"
      *set himher1 "him"
      *set heshe1 "he"
      *set hisher1 "his"
      *set rapport 25

  *if (lakota_status >0)  
    #Lakota.
      *set partner "Lakota"
      *set himher1 "him"
      *set heshe1 "he"
      *set hisher1 "his"
      *set rapport 25

```

The error says can’t extract the token #Anthony.

Can anyone see where its going wrong because I can’t?

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [December 11, 2012, 2:53pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/5 "2012-12-11T14:53:47Z")

</div>

You can’t “fall out” of an \*else statement, you need a \*goto, if I remember correctly.

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [December 11, 2012, 3:09pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/6 "2012-12-11T15:09:02Z")

</div>

@CJW

It worked fine in one case but I got the error in another.

I’ve been having trouble since I decided to start using \*gosubs so I’m currently going back to my old way because this issue has given me a headache.

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [December 11, 2012, 3:18pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/7 "2012-12-11T15:18:53Z")

</div>

There’s nothing wrong with \*gosub, or more to the point, this has nothing to do with \*gosub.

I always write my if statements under choices like so:

```
 *if (condition) #Choice 

```

Try that?

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [December 11, 2012, 3:21pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/8 "2012-12-11T15:21:00Z")

</div>

@CJW

I started using gosub which started causing the game to loop, I’ve been trying to fix the loop and caused this error thats what I mean.

EDIT: I’ve just got rid of the gosubs and the token error wasn’t there anymore so I honestly have NO idea whats going on!

EDIT: I did that originally but the game looped so i did it like my example above and got the error.

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [December 11, 2012, 5:15pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/9 "2012-12-11T17:15:28Z")

</div>

Okay another token error.

Can anyone spot the error this time, another weird one.

If the player’s awareness is 0 the code goes through fine.  
If the player’s awareness is 2 or more the code goes through fine.  
BUT if the players awareness is 1, the only option is shoot the kid (which is the correct) but when you click it you get a token error about tackle the kid?

```
*if (awareness > 0)
  You spot the glint of metal in the man's hand. You've only got moments to react...
  *temp shot
  *rand shot 1 2
  *choice
    #Shoot the kid.
      *if ((firearms) and (mental > 35))
        *choice
          #Aim to kill.
            The bullet hits the man in the chest and he is knocked back in a spray of blood.
            *set bullets -1
            *set wolf "Marcus"
            *set wolf_status 0
            *goto alpha5a

          #Aim to wound.
            The bullet clips one of the man's legs, he stumbles and that gives David time to knock him out.
            *set bullets -1
            *set wolf "Jack"
            *set wolf_status 1
            *goto alpha5b

      *elseif (mental > 45)
        *if (shot = 1)
          The bullet clips one of the man's legs, he stumbles and that gives David time to knock him out.
          *set bullets -1
          *set wolf "Jack"
          *set wolf_status 1
          *goto alpha5b

        *if (shot = 2)
          The bullet hits the man in the chest and he is knocked back in a spray of blood.
          *set bullets -1
          *set wolf "Marcus"
          *set wolf_status 0
          *goto alpha5a
          
        *else
          *if (shot = 1)
            The bullet clips one of the man's legs, he stumbles and that gives David time to knock him out.
            *set bullets -1
            *set wolf "Jack"
            *set wolf_status 1
            *goto alpha5b

          *if (shot = 2)
            The bullet hits the man in the chest and he is knocked back in a spray of blood.
            *set bullets -1
            *set wolf "Marcus"
            *set wolf_status 0
            *goto alpha5a

   *if (awareness > 1) #Tackle the kid.
     *if (hand_to_hand)
       You tackle the kid moments before he is able to plunge a dagger into David. A swift punch knocks him out.
       *set wolf "Jack"
       *goto alpha5b

     *else
       You tackle the kid and you struggle on the floor. You are able to knock him out, but not before you feel the sharp bite of his dagger in your thigh.
       *set condition -1
       *set wolf "Jack"
       *goto alpha5b

*else
  The young man reaches David and pushes him. It was only a slight push but you're confused as a crimson smear blossoms over David's shirt.
  He looks down at his chest in confusion and you see the dagger sticking in his chest. Before anyone else can react you hear a loud bang
  as Victor empties both barrels of his sawn-off into the young man.
  *set david_status 0
  *set wolf "Marcus"
  *set wolf_status 0
  *goto alpha5c

```

---

<div class="post-metadata">

**Author:** ![Vendetta](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/vendetta/32/533_2.png) [@Vendetta](https://forum.choiceofgames.com/u/Vendetta)\
**Post date:** [December 11, 2012, 6:34pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/10 "2012-12-11T18:34:01Z")

</div>

\*if ((firearms) and (mental \> 35))  
and  
\*elseif (mental \> 45)

You don’t actually have a final \*else to that from what I can see, so either you need one or the  
\*elseif (mental \> 45)  
line needs changing to \*else (and lose the condition).

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [December 11, 2012, 6:38pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/11 "2012-12-11T18:38:07Z")

</div>

@Vendetta

there was an else it just got moved out of line during my many edits! Thanks

---

<div class="post-metadata">

**Author:** ![Vendetta](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/vendetta/32/533_2.png) [@Vendetta](https://forum.choiceofgames.com/u/Vendetta)\
**Post date:** [December 11, 2012, 6:40pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/12 "2012-12-11T18:40:35Z")

</div>

Ah, yes, I see it now - the one with the two \*ifs, just before the tackle.

Easily done. 😃

---

<div class="post-metadata">

**Author:** ![Trywm](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@Trywm](https://forum.choiceofgames.com/u/Trywm)\
**Post date:** [December 11, 2012, 6:41pm UTC](https://forum.choiceofgames.com/t/cant-extract-token-error/667/13 "2012-12-11T18:41:45Z")

</div>

EDIT: Grr, people answering before I get to posting.
