Author Topic: Simple question (I hope) about making a custom token  (Read 429 times)

Legacy_Skhroll

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Simple question (I hope) about making a custom token
« on: September 01, 2010, 01:31:28 am »


               Hi everyone, I'm not what you can call a "script person", and I wanted to make something that I suspect it's rather simple, but I just can't figure it out.

What I want is to make a custom token, like those that you can put in conversations like, <class> or <race> but that tells the age a player chose for his character...

Quick example:

NPC- How old are you, exactly?
PC- I'm X years old

Is it possible? Any help is greatly appreciated '^_^'
               
               

               


                     Modifié par Skhroll, 01 septembre 2010 - 12:33 .
                     
                  


            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Simple question (I hope) about making a custom token
« Reply #1 on: September 01, 2010, 01:44:24 am »


               use the following commands (i'll attach a script to this thread later - if you'd rather wait a hour or two until I get back)...



GetAge(object oCreature)  ... is what you use to get the age of the PC



SetCustomToken(int nCustomTokenNumber, string sTokenValue) ... is what you use to set a token.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Simple question (I hope) about making a custom token
« Reply #2 on: September 01, 2010, 03:12:14 am »


               Try placing something like this in the text appears when spot for the "im x years old line'

int StartingConditional()
{
    SetCustomToken(987,IntToString(GetAge(GetPCSpeaker())));
    return TRUE;
}


Then you would use < CUSTOM987>   for the x in your convo. 

im < CUSTOM987> years old line'
               
               

               
            

Legacy_Skhroll

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Simple question (I hope) about making a custom token
« Reply #3 on: September 01, 2010, 03:13:29 am »


                Hey there man '^_^'

First of all, thank you for your time and help.

Now, I've been trying those commands that you provided but I just can't seem to make it work. '<img'>
So, if you could post a script I would be sincerely thankful.
               
               

               
            

Legacy_Skhroll

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Simple question (I hope) about making a custom token
« Reply #4 on: September 01, 2010, 03:19:50 am »


                hello Lightfoot8 I've done what you said, but when I try to compile the script it says:
"pc_age_test.nss(3): ERROR: PARSING VARIABLE LIST"   line 3 is the "int StartingConditional()"
What does this error mean?

Eitherway, thank you for helping out '<img'>

EDIT: nevermind, fixed it. Thank you so much for your help.
 ehye Khandee too, thank you.
               
               

               


                     Modifié par Skhroll, 01 septembre 2010 - 02:28 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Simple question (I hope) about making a custom token
« Reply #5 on: September 01, 2010, 03:22:47 am »


               You did put it in the "TextAppearsWhen" and not the "ActionsTaken"?
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Simple question (I hope) about making a custom token
« Reply #6 on: September 01, 2010, 04:05:28 am »


               '<img'>



You are welcome, anytime.