• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ i have a few questions regarding implementing a new npc

izaakbuwalda

New Member
Joined
Mar 7, 2020
Messages
19
Reaction score
4
i want to implement a new npctype into the source of the server, (unpc) universal npc
im checking how i can intergrate it into the server with the correct steps,
i made the Unpc.cpp and .h now if i add all the code into those i have to add them to #include "otpch.h"
but also i must add allot of stuff to the game.cpp , players.cpp , creature.cpp and monster.cpp?

let me do a small explanation. im creating a non hostile npc , but he is attackable by players , once hes being attacked he wil engange in pvp. normaly the npc just wanders the map hunting monsters to gain experience. {thats kinda my idea}

i just would like to know where i have to add the things so i dont get errors when i add the npc.
because right now the game dousnt spawn my npc.
 
I think its a bit overthinking, i would keep npc structure instead of add new object.
i would add a flag to npc "attackable", then i would edit the funcs that check "if npc then return not attackable,"
 
I think its a bit overthinking, i would keep npc structure instead of add new object.
i would add a flag to npc "attackable", then i would edit the funcs that check "if npc then return not attackable,
Post automatically merged:

If i manage to create the result i am hoping for with the npc , i wil contribute it to the website , its allot of coding. And im not a good scripter. But i wont quit intil i get it right. The npcs have no way of taking damage and none of the engine calculations. However i am able to attack the npc now so im making great progress. I came to the realization thag i have to use the build in calculations to make it work with the rest of the creatures. I had already its own way of recieving damage and dealing damage but that dousnt get allong with the rest of the crestures, also monsters cant inflict damage to the npc if im not using the implemented damage codes , so i wil learn how all of that works first.
 
Last edited:
Back
Top