okay, i'm sure this question has already been answered somewhere and it's probably really simplistic but I can't find the answer
I tried searching the forums already.
how do I make the game call up a champion's name and then display it next to text in a hudPrint
I know how to do a hudPrint and put a message and i was just doing something like hudPrint ("party: I have a bad feeling about this")
but what if I wanted to have the game pull the name of the champion in the first slot so that it a text pops up saying something
and then another message pops up with another party member's name like they are having a conversation
so it looks like this
Femaiden : I have a bad feeling about this
Jenni : you always say that
Femaiden : that's because i'm always right
(that's just a made up example, I probably won't use those exact words lol)
but then if someone else is playing and they name their champions like Bob and Susan or something then it will substitute those names instead.
I know it has to do with the getChampion and getName commands but I keep getting crashes because i'm not using proper syntax maybe? I dunno.
I pulled this from another post and tried it
hudPrint(party.party:getChampion(1):getName()"hello")
and i have an error message says "attempt to call a string value X"
hudPrints from specific party members
Re: hudPrints from specific party members
You were close...
But therfore a champion could be not alive I prefer this:
Code: Select all
hudPrint(" "..party.party:getChampion(1):getName().." important message")if party.party:getChampion(1):isAlive() then
hudPrint(" "..party.party:getChampion(1):getName().." important message")
else
hudPrint("important message")
end
Re: hudPrints from specific party members
so you have to put those double periods before party and after getName? I kind of thought those were just the person overusing ellipses...THOM wrote:You were close...But therfore a champion could be not alive I prefer this:Code: Select all
hudPrint(" "..party.party:getChampion(1):getName().." important message")
if party.party:getChampion(1):isAlive() then
hudPrint(" "..party.party:getChampion(1):getName().." important message")
else
hudPrint("important message")
end
Re: hudPrints from specific party members
.. is the operator to concatenate strings in Lua.
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.