Page 1 of 1

Lua Functions to Set and Retrieve the Look of NPCs

Posted: Wed Feb 11, 2015 10:32 pm
by Joe
I would like to implement the quests "A Discerning Eye" for each of the three starting nations and need a Lua function that would allow me to set the look of an NPC prior to making that NPC appear and also a function to retrieve the current look of an NPC for comparisons. Given that I'm not very familiar with the source to the map server and C++ has never been one of my strong suits I'd appreciate any help I can get from anyone able to assist. Thanks.

Re: Lua Functions to Set and Retrieve the Look of NPCs

Posted: Wed Feb 11, 2015 10:46 pm
by whasf
You're probably better off playing around and looking in the source how things work than us trying to explain stuff to you..
Start with basic stuff like:
Example: Look how a spell is learned
Example: How a weaponskill is done
Then look at a gate guard and read the script on how a player starts the first mission. Follow it along on the ffxiclopedia and see how each NPC works and interacts with the player

Re: Lua Functions to Set and Retrieve the Look of NPCs

Posted: Wed Feb 11, 2015 11:24 pm
by Joe
I have all of that pretty well figured out. I even have a good idea about how I want to implement the quest. I don't think my original post was as clear as it could have been. What I need is one or two functions that I can call in a Lua script to set the look of an npc and also to retrieve the look of an npc. I'm pretty sure that something like that has not been implemented yet. And my not being totally familiar with C++ and the map server source is going to slow me down if I try to implement it myself, which I do intend to do after finishing tweaking the strange apparatus stuff I've been working on. It would be great if anyone more familiar would be able to either implement those functions or to suggest a starting point for me. I plan to spend quite a bit of time this weekend familiarizing myself with c++ syntax and the map source so I may not need to much help in the end... Figured it wouldn't hurt to ask if anyone out there is bored and looking for something to do. :)

Re: Lua Functions to Set and Retrieve the Look of NPCs

Posted: Wed Feb 11, 2015 11:53 pm
by atom0s
If you ever need to see what is/isn't exposed to Lua, you can reference the following files:
https://github.com/DarkstarProject/dark ... rc/map/lua

For entity specific stuff, see:
https://github.com/DarkstarProject/dark ... seentity.h

Re: Lua Functions to Set and Retrieve the Look of NPCs

Posted: Thu Feb 12, 2015 8:32 pm
by kjLotus
they're there, i just forget the name of them

setskin maybe

Re: Lua Functions to Set and Retrieve the Look of NPCs

Posted: Thu Feb 12, 2015 10:13 pm
by Joe
Thanks for the info guys. I appreciate it.

Re: Lua Functions to Set and Retrieve the Look of NPCs

Posted: Thu Feb 12, 2015 10:18 pm
by kjLotus
ah, it was setModelId and getModelId

Re: Lua Functions to Set and Retrieve the Look of NPCs

Posted: Sat Feb 14, 2015 8:20 pm
by Joe
Thanks for pointing me towards those functions , but after looking at the source in lua_baseentity.cpp it appears that they only work with mobs. Is there a similar function for NPCs?

Re: Lua Functions to Set and Retrieve the Look of NPCs

Posted: Sat Feb 14, 2015 8:55 pm
by kjLotus
there's not, since their look data is like 10 16 bit numbers instead of one (one for each equip slot)