leonvanilla 0 Posted August 20, 2019 Share Posted August 20, 2019 How can I make emotions work on a particular NPC, I tried in cmd_emotion the function (ch-> IsNPC () == 30122), but I got an error. Link to comment Share on other sites More sharing options...
leonvanilla 0 Posted August 20, 2019 Author Share Posted August 20, 2019 up Link to comment Share on other sites More sharing options...
displayjokes 89 Posted August 20, 2019 Share Posted August 20, 2019 Watchout for the bumping rules, @Raylee will slap you On topic, i belive you are doing this: IF character is NPC equals to 30122, do something, so try to spell it out, you will see the error, you verify if it's an NPC and you want a true or false to be a vnum/id.. I believe you must do GetRaceNum() to get a comparsion to npc vnum/id Something like: ch->IsNPC() && ch->GetRaceNum() == 30122 It's all lies Link to comment Share on other sites More sharing options...
leonvanilla 0 Posted August 20, 2019 Author Share Posted August 20, 2019 Acum 10 minute, displayjokes a spus: Watchout for the bumping rules, @Raylee will slap you On topic, i belive you are doing this: IF character is NPC equals to 30122, do something, so try to spell it out, you will see the error, you verify if it's an NPC and you want a true or false to be a vnum/id.. I believe you must do GetRaceNum() to get a comparsion to npc vnum/id Something like: ch->IsNPC() && ch->GetRaceNum() == 30122 I'll try and come back with an answer, thank you nice. Link to comment Share on other sites More sharing options...
leonvanilla 0 Posted August 20, 2019 Author Share Posted August 20, 2019 (edited) Acum 1 oră, displayjokes a spus: Watchout for the bumping rules, @Raylee will slap you On topic, i belive you are doing this: IF character is NPC equals to 30122, do something, so try to spell it out, you will see the error, you verify if it's an NPC and you want a true or false to be a vnum/id.. I believe you must do GetRaceNum() to get a comparsion to npc vnum/id Something like: ch->IsNPC() && ch->GetRaceNum() == 30122 I'm getting this error. Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
displayjokes 89 Posted August 20, 2019 Share Posted August 20, 2019 (edited) 3 minutes ago, leonvanilla said: I'm getting this error. You did not declared ch, you have it rch, change the ch-> to rch-> has it is declared on the begining Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal It's all lies Link to comment Share on other sites More sharing options...
leonvanilla 0 Posted August 20, 2019 Author Share Posted August 20, 2019 (edited) Acum 1 minut, displayjokes a spus: You did not declared ch, you have it rch, change the ch-> to rch-> has it is declared on the begining I tried and ... Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Contributor MrQuin 6409 Posted August 20, 2019 Contributor Share Posted August 20, 2019 The fuc* am i looking at here ? At least add the .gr2 emotions to the npc from the client side My only accounts are here and on M2D, Don't trust anyone else from other shitty sites. Link to comment Share on other sites More sharing options...
leonvanilla 0 Posted August 20, 2019 Author Share Posted August 20, 2019 Acum 4 minute, MrQuin a spus: The fuc* am i looking at here ? At least add the .gr2 emotions to the npc from the client side I want you to be able to provide that NPC's emotions. Link to comment Share on other sites More sharing options...
displayjokes 89 Posted August 20, 2019 Share Posted August 20, 2019 (edited) 5 minutes ago, leonvanilla said: I tried and ... I believe what you want to do can be done easier, you are only returning true in that function, on ACMD(do_emotion), find this: if (!victim->IsPC() || victim == ch) Change it to: if ( (!victim->IsPC() && victim->GetRaceNum() != 30122 ) || victim == ch) I believe it work, if not you can play around that if, this is not tested, plus what MrQuin said, you will need the animations for the NPCs. Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal It's all lies Link to comment Share on other sites More sharing options...
leonvanilla 0 Posted August 20, 2019 Author Share Posted August 20, 2019 (edited) Acum 7 minute, displayjokes a spus: I believe what you want to do can be done easier, you are only returning true in that function, on ACMD(do_emotion), find this: if (!victim->IsPC() || victim == ch) Change it to: if ( (!victim->IsPC() && victim->GetRaceNum() != 30122 ) || victim == ch) I believe it work, if not you can play around that if, this is not tested, plus what MrQuin said, you will need the animations for the NPCs. NPC is a function starter in InstanceBase.cpp. int i=0; if(c_rkCreateData.m_dwRace == 30122) { SetInstanceType(CActorInstance::TYPE_PC); SetRace(3); i=1; } Whatever I do in cmd_emotion tells me that NPC is not online.I get this error at the function given to you above. Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
displayjokes 89 Posted August 20, 2019 Share Posted August 20, 2019 (edited) 2 minutes ago, leonvanilla said: NPC is a function starter in InstanceBase.cpp. int i=0; if(c_rkCreateData.m_dwRace == 30122) { SetInstanceType(CActorInstance::TYPE_PC); SetRace(3); i=1; } Whatever I do in cmd_emotion tells me that NPC is not online.I get this error at the function given to you above. You are missing parentesis, but show me that part of the function complete, with the number of the lines please Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal It's all lies Link to comment Share on other sites More sharing options...
leonvanilla 0 Posted August 20, 2019 Author Share Posted August 20, 2019 Acum 4 minute, displayjokes a spus: You are missing parentesis, but show me that part of the function complete, with the number of the lines please What function? Link to comment Share on other sites More sharing options...
displayjokes 89 Posted August 20, 2019 Share Posted August 20, 2019 2 minutes ago, leonvanilla said: What function? The part you edited that is giving you errors, i don't see a missing ";" there, so it must be something else It's all lies Link to comment Share on other sites More sharing options...
leonvanilla 0 Posted August 20, 2019 Author Share Posted August 20, 2019 Acum 3 minute, displayjokes a spus: The part you edited that is giving you errors, i don't see a missing ";" there, so it must be something else I solved it, but it still tells me it's not online. Link to comment Share on other sites More sharing options...
displayjokes 89 Posted August 20, 2019 Share Posted August 20, 2019 3 minutes ago, leonvanilla said: I solved it, but it still tells me it's not online. Oh okay, that's different, now we need to look for that message, you can try to copy the message to notepad, search for it on translate or locale.lua, i do not remember what file, and check what's the key phrase that's giving you that message, than we can look for that key phrase in this file, because i'm not sure where it tells you the player is not offline, other options is that you can send chatpacket to see where it stops, like this: ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT(" Test 1 ")); than ahead in the functions add a couple more and add +1 to the number after Test, this is how i usually debug It's all lies Link to comment Share on other sites More sharing options...
leonvanilla 0 Posted August 20, 2019 Author Share Posted August 20, 2019 Acum 1 minut, displayjokes a spus: Oh okay, that's different, now we need to look for that message, you can try to copy the message to notepad, search for it on translate or locale.lua, i do not remember what file, and check what's the key phrase that's giving you that message, than we can look for that key phrase in this file, because i'm not sure where it tells you the player is not offline, other options is that you can send chatpacket to see where it stops, like this: ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT(" Test 1 ")); than ahead in the functions add a couple more and add +1 to the number after Test, this is how i usually debug I said try to return true on that function but it gives me segmentation error. Link to comment Share on other sites More sharing options...
displayjokes 89 Posted August 20, 2019 Share Posted August 20, 2019 23 minutes ago, leonvanilla said: I said try to return true on that function but it gives me segmentation error. I did not understand what do you mean It's all lies Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now