Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

A Name Script

Page: 1 of 1
 ForeverNight
03-29-2008, 8:39 PM
#1
I was wondering if it was possible to create a script that would check to see what the PC's name is?

Let's say that I wanted to create a total conversion (Not that I can! lol) And I wanted it to trigger if and only if my character's name was "x".

Would such a thing be possible with scripting, or would I just have to have another install of the game if I wanted to also keep my original install?

Thanks!
 stoffe
03-30-2008, 9:05 AM
#2
I was wondering if it was possible to create a script that would check to see what the PC's name is?


You should be able to use the GetName() function for this. Like:


void main () {
if (GetName(GetFirstPC()) == "John Doe") {
// Do something...
}
}
 Pavlos
03-30-2008, 9:06 AM
#3
I was wondering if it was possible to create a script that would check to see what the PC's name is?

Let's say that I wanted to create a total conversion (Not that I can! lol) And I wanted it to trigger if and only if my character's name was "x".

I suppose you could insert a script in the OnEnter of the beginning module to transport the player to your new area.

void main()
{
if (GetName(GetFirstPC()) == "X")
{
StartNewModule("MyModule");
}
else
{
// Do other stuff
}
}

Edit: the stoffe beat me to it... :p
 Angelus6
03-30-2008, 5:56 PM
#4
although, a "getname" script would probly be a bit pointless surely.

would it not be better to use "getisPC" (get is Player charecter)
then you'd be able to move the PC/party to your new module rather than the script being dependant on player name, it'll trigger because your the Player.
im saying this because realisticlly how many ppl will use the same player name. unless you wanted somthing special to happen if the players name was "Revan" or "Exile" or something else related ^^
 ForeverNight
03-31-2008, 6:51 PM
#5
Honestly?

I had just had the thought and figured, hey I'll include it in the read me if I ever can build such a thing... Not that it's really likely! But, I saw one of the TC's on here (Can't remember what it was now) And had thought that it would be nice if it only triggered if the name was "x" (Just a stand in) and for all the other names you would be able to play the rest of the game.

Foolish? Maybe, but I didn't know if anybody else had had the idea and figured, what the heck? Can't hurt to ask.

And thank you Stoffe and Pavlos for your help satisfying my curiosity.
Page: 1 of 1