Frictional Games Forum
Full Conversion: How to get Player Name? - Printable Version

+- Frictional Games Forum (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Full Conversion: How to get Player Name? (/thread-21013.html)

Pages: 1 2


Full Conversion: How to get Player Name? - ehovda321 - 04-01-2013

Do you think it is possible to get the user to input his/her name, and use that in the english.lang file? Any ideas? Thanks!


RE: Full Conversion: How to get Player Name? - Rapture - 04-01-2013

Dunno, if the LANG can call variables than you should be able to do it.


RE: Full Conversion: How to get Player Name? - Statyk - 04-02-2013

No, that's not possible.


RE: Full Conversion: How to get Player Name? - DeAngelo - 04-02-2013

This would perhaps break the immersion a bit, but you could at the beginning of your CS (or in a readme file but most people don't look at those) ask the player to go into your lang file and press CTRL+H (Which is the command for Replace in most notepads I've used) and in the "Find What" field put PLAYERNAME (which you would put in your lang anywhere you want their name to be) and in the "Replace With" field put their name.

A little roundabout but would accomplish what you're trying.


RE: Full Conversion: How to get Player Name? - PutraenusAlivius - 04-02-2013

If .lang files can do variables, then you could do it.


RE: Full Conversion: How to get Player Name? - xxxxxxxxxxxxxxxx - 04-02-2013

Isn't a .lang file basically just a .txt file with another ending? I don't think you can change it from within the game. Maybe you could code some sort of custom launcher instead that comes with your FC. It would ask for the player's name, automatically open, edit and save the .lang file and then start your Full Conversion...(or Amnesia, if you're making a CS instead) I'm a complete coding noob, though...maybe a batch file would work?


RE: Full Conversion: How to get Player Name? - Akos115 - 04-03-2013

Sorry for my bad English, and I'm sure you won't understand it but...
It is possible (and will take a lots of time) , but only if you set the maximum amount of letters the player can use.
In your first map, create a letter selection thingy- a long corridor with for example 3 "slots".
In the corridor display every letter using billboards, and create examin. areas around them. Then add a setentityplayerinteract callback for all of them. With variables you can make player enter his/her name by interacting with the areas. This will give you 3 variables (var1, var2, var3) with 3 values.

If you want to use the players name in a note, it's really hard to do it.You need to make a VERY long script. You have to place as many notes in the map as the amount of the player possibility names are (in this case number of letters multiplied by number of letters multiplied by number of letters), and set all of them inactive. In the lang file you need to make a note with all different possibilities ( For example "Welcome aaa", "Welcome aab"...) When the player enters the map, you need to check all your 3 variables for their amounts, and set the matching note active.

For example the player enters ABE.
This will set var1 to 1 (var1 - the first letter, 1- the 1st letter "A"), var2 to 2, var3 to 5.
In the note map, you have to check all possibilities- if var1 is 1, then what var2 be?, if var1 is 2, then what var2 be?... same with var3.
After that just use setentityactive, and you are done Big Grin


RE: Full Conversion: How to get Player Name? - Daemian - 04-04-2013

actually if you check the file base_english.lang
it uses variables


<Entry Name="RunHint">To run, hold down $ButRun while moving.</Entry>



This message (on "Messages" category)
<Entry Name="zxc">Your argument is invalid $ButInteract .</Entry>


says ingame: Your argument is invalid LeftMouse .

it's something xD


RE: Full Conversion: How to get Player Name? - PutraenusAlivius - 04-04-2013

(04-04-2013, 07:07 AM)Amn Wrote: actually if you check the file base_english.lang
it uses variables


<Entry Name="RunHint">To run, hold down $ButRun while moving.</Entry>



This message (on "Messages" category)
<Entry Name="zxc">Your argument is invalid $ButInteract .</Entry>


says ingame: Your argument is invalid LeftMouse .

it's something xD
TBH, it's not a variable, if I'm correct. The "Shift" key was assigned to $ButRun. So, the game checks what key is assigned in $ButRun and when it finds it, it will show that specific key instead of $ButRun.


RE: Full Conversion: How to get Player Name? - xxxxxxxxxxxxxxxx - 04-04-2013

Yeah, it's something... but I wouldn't be surprised if those button thingies are one of those things that can't be changed. Just like you can't make custom controls for actions that are not in the original game. But who knows? It might work with other stuff, too. If it doesn't, I still think some sort of external script/batch file/ whatever is the easiest solution. (Okay, not exactly "easy" since you need to make it edit a .txt file...which is probably very hard to do Wink )You need a batch file anyway for the full conversion, so why not put some extra stuff in there or make it run another script before the line that starts amnesia with your custom .cfg?