(Possibly) Simplified World Building Concepts
Re: (Possibly) Simplified World Building Concepts
Can we get a list of variables (is that the right word?) for things like "putcharactersnamehere" or "putNPCsnamehere?" I'm trying to make this generic Tursh guard script, and his name is hardcoded in : StartConversation(conversation, 'Guard Winston says, "What are you looking for?"')
I tried " .. GetName(Npc) .. " and " .. GetName(NPC) .. " but I guess they aren't the right things.
Edit: I found this but it's the same thing I tried. Xinux is looking into it now for me. http://eq2emulator.net/wiki/index.php/LUA:GetName
I tried " .. GetName(Npc) .. " and " .. GetName(NPC) .. " but I guess they aren't the right things.
Edit: I found this but it's the same thing I tried. Xinux is looking into it now for me. http://eq2emulator.net/wiki/index.php/LUA:GetName

- John Adams
- Retired
- Posts: 4583
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: (Possibly) Simplified World Building Concepts
Yeah the first round of Lua Functions were kinda thrown together before the full Lua system was available.
GetName(any-damn-thing) should work, for everything and anyone. We should not need a separate GetNpcName() which is what I suspect is coming
GetName(any-damn-thing) should work, for everything and anyone. We should not need a separate GetNpcName() which is what I suspect is coming
Re: (Possibly) Simplified World Building Concepts
We have it it's GetTarget(Npc) just like it is in EQ2.
- John Adams
- Retired
- Posts: 4583
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: (Possibly) Simplified World Building Concepts
GetTarget returns an NPCs name who you are hailing? That's not intuitive. GetName kinda is.
Re: (Possibly) Simplified World Building Concepts
So I'm looking at the Fawns in Tursh, who used to follow the Doe's in front of them. Do we have a function for that yet? I saw this on the EQ one, but not in our lua list, so I assume we don't have it yet: http://eq2emulator.net/wiki/index.php/L ... llowTarget
I was messing around with it a bit, but couldn't figure out how to get it to follow the specific doe in front if it.
I might be wrong about the fawns.
I was messing around with it a bit, but couldn't figure out how to get it to follow the specific doe in front if it.
I might be wrong about the fawns.

- John Adams
- Retired
- Posts: 4583
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: (Possibly) Simplified World Building Concepts
Nope, barely any EQ2 functions are in our code (see above excuse), except of course the low hanging fruit Xinux was able to knock out the first week
Add your requested functions in this thread, and one of us will try getting to it asap. Meanwhile, anything more than basic movement or Hail is likely beyond the scope of week-1 scripting. Just keep a list because a lot of functionality will be needed.
fwiw, I began looking into this because of the sets of guards that patrol the zones, and clusters of NPCs (gnolls in Halgarad) so I'm certain you are correct.
Add your requested functions in this thread, and one of us will try getting to it asap. Meanwhile, anything more than basic movement or Hail is likely beyond the scope of week-1 scripting. Just keep a list because a lot of functionality will be needed.
fwiw, I began looking into this because of the sets of guards that patrol the zones, and clusters of NPCs (gnolls in Halgarad) so I'm certain you are correct.
Re: (Possibly) Simplified World Building Concepts
Okay, another stupid question™!
I've got an NPC here: Farmhand Lightwater, who has 5 dialogue options. The example only shows how to do 2. How do we set him up so he goes through his whole dialogue options?
I've already set up the dialogue functions (Greeting, Greeting1, Greeting2, etc). I just don't know how to get him to say anything other than the first two.
I very obviously want to get this done, you might have underestimated my eagerness to get this game back up and running >.>
Edit: For my own notes for when I know how to do this: Add Farmer Bryce to the list of more than 2 dialogue responses.
I've got an NPC here: Farmhand Lightwater, who has 5 dialogue options. The example only shows how to do 2. How do we set him up so he goes through his whole dialogue options?
I've already set up the dialogue functions (Greeting, Greeting1, Greeting2, etc). I just don't know how to get him to say anything other than the first two.
I very obviously want to get this done, you might have underestimated my eagerness to get this game back up and running >.>
Edit: For my own notes for when I know how to do this: Add Farmer Bryce to the list of more than 2 dialogue responses.

- John Adams
- Retired
- Posts: 4583
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: (Possibly) Simplified World Building Concepts
If you read the text carefully, you can see Lightwater actually only has 2 dialogs; the others are incorrectly added by the Generator (that thing I mentioned I have to fix)
[quote]--[[ raw_dialog_headers
ID: 17571, Text: Gobon says, "We haven't seen any pumpkin horrors yet on this road, but that's not to say we'll never see them.", Log: 422
ID: 19466, Text: Lightwater says, "Rindol Field couldn't be a worse place right now. I'm glad the humans hired me to work their fields.", Log: 437
ID: 34594, Text: Gobon says, "Good, an adventurer."\n\n\n\n"Maybe with you around, I won't get attacked by any redcaps.", Log: 718
ID: 47878, Text: Loggin says, "I've heard wild tales about the gnomes. They live in a faraway city called Mek-Qalia, and use glowing crystals instead of fire.", Log: 1128
ID: 84057, Text: Lightwater says, "We dalefolk have always helped the humans farm their fields." Under his breath, he adds, "They can't really farm on their own, anyway.", Log: 2127
ID: 84063, Text: Redstalk says, "I remember sixty years ago, when the orcs and goblins burnt Tursh to the ground. The fields rebounded afterwards, and we had some of our best harvests.", Log: 2127
--]][/quote]
So in short, you still only need a math.random(0,1)
But for future reference, math.random is merely low, high. So if you have 5 dialogs to random, it's math.random(0,4) because 0 counts as the 1st one, etc.
[quote]--[[ raw_dialog_headers
ID: 17571, Text: Gobon says, "We haven't seen any pumpkin horrors yet on this road, but that's not to say we'll never see them.", Log: 422
ID: 19466, Text: Lightwater says, "Rindol Field couldn't be a worse place right now. I'm glad the humans hired me to work their fields.", Log: 437
ID: 34594, Text: Gobon says, "Good, an adventurer."\n\n\n\n"Maybe with you around, I won't get attacked by any redcaps.", Log: 718
ID: 47878, Text: Loggin says, "I've heard wild tales about the gnomes. They live in a faraway city called Mek-Qalia, and use glowing crystals instead of fire.", Log: 1128
ID: 84057, Text: Lightwater says, "We dalefolk have always helped the humans farm their fields." Under his breath, he adds, "They can't really farm on their own, anyway.", Log: 2127
ID: 84063, Text: Redstalk says, "I remember sixty years ago, when the orcs and goblins burnt Tursh to the ground. The fields rebounded afterwards, and we had some of our best harvests.", Log: 2127
--]][/quote]
So in short, you still only need a math.random(0,1)
But for future reference, math.random is merely low, high. So if you have 5 dialogs to random, it's math.random(0,4) because 0 counts as the 1st one, etc.
Re: (Possibly) Simplified World Building Concepts
Okay, but for future reference, I tried this on Lightwater's script with all the entries:
It's the two "Greeting(Npc, Player)" and "Greeting1(Npc, Player)" thing that I'm wondering about. Let's say, for example's sake, he does have 4 randomly generated things to say. How do I add in "Greeting2(Npc, Player)? Would it look like...
From what very little I know of coding, that doesn't make any sense. Cuz I realize it's saying, "If it's 0, say this first one, otherwise, say the second one." But I don't know how to tell it to say the others
Code: Select all
function hailed(Npc, Player)
FaceTarget(Npc, Player)
if math.random(0, 4) == 0 then
Greeting(Npc, Player)
else
Greeting1(Npc, Player)
end
endCode: Select all
function hailed(Npc, Player)
FaceTarget(Npc, Player)
if math.random(0, 4) == 0 then
Greeting(Npc, Player)
else
Greeting1(Npc, Player)
else
Greeting2(Npc, Player)
else
Greeting3(Npc, Player)
end
end
Re: (Possibly) Simplified World Building Concepts
You would do something like this.
Code: Select all
choice = math.random(0,2)
-- Variable response
if choice == 0 then
StartConversation(conversation, "I do not believe I have seen you around before. What brings you here?")
elseif choice == 1 then
StartConversation(conversation, "I do not believe I have seen you around before. What brings you here?")
elseif choice == 2 then
StartConversation(conversation, "I do not believe I have seen you around before. What brings you here?")
else
StartConversation(conversation, "If you are here to take some fish for yourself, you will regret that in short order!")
end