Quote:
Originally Posted by heatattack318
ok so i followed Xijesu's guide for custom npc but for some reason my guys not showing up heres what i got...its probably wrong but hey im trying...
function get_module_name()
return "BlueMoon"
end
-- Start NPC
function NPC_BlueMoon()
dlg_title( "BlueMoon" )
dlg_text( "Hello, Nice to meet you." )
dlg_menu( "Menu", 'open_market("Item Shop")')
dlg_menu( "close", '')
dlg_show()
end
any help would be awesome im sorry if im a bother thanks in advanced
|
So that is just a small portion of the .lua file that will help the game control your NPC.
You also have to utilize or make a new NPC in dbo.NPCResource that will execute that contact_script NPC_BlueMoon()
If you use an existing NPC in dbo.NPCResource you just need to set their local_flag from 0 as the guide says to choose an inactive NPC to 1 to make it an active NPC change their contact script to your NPC_BlueMoon and set their coordinates for where you want them to be.
Making them active (local_flag = 1) will make them appear in game.
Setting their contact script (NPC_BlueMoon) will let the game know which .lua to execute when you click on them.
The open_market command will let the game know which market items in dbo.MarketResource to load when you choose that menu item.
Anything you re use and give new function to that was already in the tables will work with the new function.
If you create a new NPC you will need to create a new db_NPCResource.rdb to resource in the client.
The added entries to dbo.MarketResource will cause you to need to make a new db_MarketResource.rdb for the clients resources.