Retaining Character Name?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Morse
Posts: 8
Joined: Sun Mar 29, 2015 1:10 pm

Retaining Character Name?

Post by Morse »

Komag wrote:Post on-screen text with a character's name:

Code: Select all

local name1 = party:getChampion(1):getName()
hudPrint("You know "..name1..", you are an incredibly effective adventurer!")
This code works fine, but if you move the first character between the 4 slots, it takes the name of another character or a blank position (so it'll show up as New Character). How do you keep it consistent and keep the character's name even if you move it from slot to slot?
minmay
Posts: 2789
Joined: Mon Sep 23, 2013 2:24 am

Re: Retaining Character Name?

Post by minmay »

Iterate through all 4 champions and use Champion:getOrdinal() until you find the one with ordinal number 1.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Morse
Posts: 8
Joined: Sun Mar 29, 2015 1:10 pm

Re: Retaining Character Name?

Post by Morse »

minmay wrote:Iterate through all 4 champions and use Champion:getOrdinal() until you find the one with ordinal number 1.
Thanks - but does this also allow me to do easter eggs based on names the player entered? Or is that even possible?

Edit: NVM, I found a way.
Post Reply