I was making some attempts at spawning a npc by adding to the npc_list table though adding a new number to it with status 0 and simply copying all data from a existing npc such as flags etc, they do not appear on screen even with a restart of the zone server. Also it seems really high id numbers such as taking a normal npc turning it to hex setting the most significant bits 0x1 to 0x2 then converting back to decimal gave me 33,xxx,xxx which crashes it on restart.
How do I add a npc, such as a explorer moogle? I understand that its name would become NPC if I used a custom name without editing a dat file.
INSERT INTO `npc_list` VALUES ('17064934', 'Moogle', 'Moogle', '128', '-308.00', '0', '-478.863', '1', '40', '40', '0', '0', '0', '0', '3', 0x0000520000000000000000000000000000000000, '0', 'Null');
How to spawn an npc.
Re: How to spawn an npc.
there's a difference between 'Null' and null, and that's probably the issuekasaga wrote:'Null'
Re: How to spawn an npc.
Nope that one didn't do it, I was hoping it was just me not typing null right but I tried with lower case, 0, TOAU, this was my last query and npc didnt show up when i logged in.
INSERT INTO `npc_list` VALUES ('18286721', 'Moogle', 'Moogle', '128', '-308.00', '0', '-478.863', '1', '40', '40', '0', '0', '0', '0', '3', 0x0000520000000000000000000000000000000000, '0', 'null');
Reloaded the map server still no go.
INSERT INTO `npc_list` VALUES ('18286721', 'Moogle', 'Moogle', '128', '-308.00', '0', '-478.863', '1', '40', '40', '0', '0', '0', '0', '3', 0x0000520000000000000000000000000000000000, '0', 'null');
Reloaded the map server still no go.
Re: How to spawn an npc.
there is still a difference between 'null' and null
just to be clear, it's not a string, so it shouldn't have any quotes
just to be clear, it's not a string, so it shouldn't have any quotes
Re: How to spawn an npc.
Tried it without the quotes too got nothin, im baffled here unless I input something worng.
edit: meant to type 17064934 as the id there. still no go.
edit: meant to type 17064934 as the id there. still no go.
Re: How to spawn an npc.
Are you editing the live database or the file, and if editing the file re importing it after? Are those positional coordinates where you can actually see the new NPC? Is the NPC ID valid for the zone? Are you restarting map server after change?
(There are only 1023 valid NPC "slots" per zone, out of 4095 entity "slots" per zone, the first is always a dud and beyond the 1st 1024 are non mob/npc types, such as player pets leaving you 1023 you can mess with. The ID of 17064934 tells me that should be zone 70)
tl;dr
lots of ways to get it wrong.
(There are only 1023 valid NPC "slots" per zone, out of 4095 entity "slots" per zone, the first is always a dud and beyond the 1st 1024 are non mob/npc types, such as player pets leaving you 1023 you can mess with. The ID of 17064934 tells me that should be zone 70)
tl;dr
lots of ways to get it wrong.
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
Re: How to spawn an npc.
At first I added it live, this time I tried adding it with the server shut down.
I believe my original number to be within range but i lowered it down the highest ID for 70 seems to be 206/1023 total for npcs so I picked a lower one than my first number but higher than whats listed on the master npc list xml file (id207). I changed it to 17064602.
Thanks very much, I now have a npc sitting in front of me, it works. Now i can fool with flags and stuff and see whats what.
I believe my original number to be within range but i lowered it down the highest ID for 70 seems to be 206/1023 total for npcs so I picked a lower one than my first number but higher than whats listed on the master npc list xml file (id207). I changed it to 17064602.
Thanks very much, I now have a npc sitting in front of me, it works. Now i can fool with flags and stuff and see whats what.
Re: How to spawn an npc.
Yeah you can't actually change the NPC list while its running. It only reads on startup and we don't currently have a way to make it reload all of a zones non-player entities.kasaga wrote:At first I added it live, this time I tried adding it with the server shut down.
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE