Aller au contenu

Photo

Simple question (I hope) about making a custom token


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Skhroll

Skhroll
  • Members
  • 6 messages
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 .


#2
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
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.

#3
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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'

#4
Skhroll

Skhroll
  • Members
  • 6 messages
 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. :(
So, if you could post a script I would be sincerely thankful.

#5
Skhroll

Skhroll
  • Members
  • 6 messages
 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 :)

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

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


#6
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
You did put it in the "TextAppearsWhen" and not the "ActionsTaken"?

#7
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
:D



You are welcome, anytime.