Can't extract token error?


#1

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?]


#2

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


#3

@Reaperoa

can’t believe I missed that! thanks!


#4

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?


#5

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


#6

@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.


#7

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?


#8

@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.


#9

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

#10

*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).


#11

@Vendetta

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


#12

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

Easily done. :smiley:


#13

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