Lua Functions to Set and Retrieve the Look of NPCs

Post Reply
Joe
Posts: 33
Joined: Sun Jan 20, 2013 4:18 pm

Lua Functions to Set and Retrieve the Look of NPCs

Post by Joe » Wed Feb 11, 2015 10:32 pm

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.

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

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

Post by whasf » Wed Feb 11, 2015 10:46 pm

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
-- Whasf

Joe
Posts: 33
Joined: Sun Jan 20, 2013 4:18 pm

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

Post by Joe » Wed Feb 11, 2015 11:24 pm

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. :)

User avatar
atom0s
Developer
Posts: 537
Joined: Thu Oct 25, 2012 9:52 am

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

Post by atom0s » Wed Feb 11, 2015 11:53 pm

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

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Thu Feb 12, 2015 8:32 pm

they're there, i just forget the name of them

setskin maybe

Joe
Posts: 33
Joined: Sun Jan 20, 2013 4:18 pm

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

Post by Joe » Thu Feb 12, 2015 10:13 pm

Thanks for the info guys. I appreciate it.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Thu Feb 12, 2015 10:18 pm

ah, it was setModelId and getModelId

Joe
Posts: 33
Joined: Sun Jan 20, 2013 4:18 pm

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

Post by Joe » Sat Feb 14, 2015 8:20 pm

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?

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Sat Feb 14, 2015 8:55 pm

there's not, since their look data is like 10 16 bit numbers instead of one (one for each equip slot)

Post Reply