Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 18:38

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Moving an NPC to a different map

Discussion on Moving an NPC to a different map within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
KingGannon's Avatar
 
elite*gold: 0
Join Date: Oct 2005
Posts: 26
Received Thanks: 2
Moving an NPC to a different map

I'm trying to make a NPC that moves to a different map from the Player Client every time you talk to the NPC.
Yes, it sound familiar to the BlueMouse NPC.
No, it has nothing to do with the BlueMouse and nothing to do with Richard the Thief NPC.
I had made at the other post where you talk to that NPC and it moves around the map or to a different map. To which I had succeeded in making the NPC move around to a different part of the map as long as the NPC is in the same as the map as the Player.

This time I want to make make this NPC move to another map. I'm getting this NPC to move into a map that has no NPC, Spawns, Portals etc. no objects. The Player has to change maps in order to find this NPC. Unlike the BlueMouse, there is no chance this NPC will spawn in the same map as the Player.

Any help would be appreciated.
KingGannon is offline  
Old 05/31/2023, 18:11   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,214
Received Thanks: 4,116
I don't think it needs to be super complicated. If you don't want the NPC location to persist across server restarts, then you can just update it in memory. Aka. remove it from the current map and (if successful then) add it to the new map. That's assuming your map system / screen system both handle adding and removing NPCs in real-time.

If you want those locations to persist, then maybe you could have the NPC dialog script write to the database. Expose a new "UpdateSpawn" function or something. That way, you avoid having to make new tables and such for dynamic spawn locations.
Spirited is offline  
Old 06/01/2023, 02:03   #3
 
KingGannon's Avatar
 
elite*gold: 0
Join Date: Oct 2005
Posts: 26
Received Thanks: 2
All right then keeping it simple
I do the same thing as I did to move the dynamic location NPC around. The only difference this time is in order to spawn the NPC to the new map I can either use the Map Insert function by searching up the Unique MapID then NPC ID and then use the NPC ID as the object to Insert into the new map.

Otherwise, I can create a new function which I prefer to avoid doing for the whole Map class editing.
And I don't need to rewrite the database either.

Am I on the right track?
KingGannon is offline  
Old 06/01/2023, 02:22   #4
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,214
Received Thanks: 4,116
Quote:
Originally Posted by KingGannon View Post
All right then keeping it simple
I do the same thing as I did to move the dynamic location NPC around. The only difference this time is in order to spawn the NPC to the new map I can either use the Map Insert function by searching up the Unique MapID then NPC ID and then use the NPC ID as the object to Insert into the new map.

Otherwise, I can create a new function which I prefer to avoid doing for the whole Map class editing.
And I don't need to rewrite the database either.

Am I on the right track?
Adding methods is a best practice. If you have a method that's longer than 25 lines, then generally you want to split that up. If you already have a method for adding an NPC to a map using the Map class, then for sure use that. If you don't though, then this could be a good opportunity to create a method like that. Totally up to you, though - I'm not familiar with what source you're using.
Spirited is offline  
Thanks
1 User
Old 06/01/2023, 02:37   #5
 
KingGannon's Avatar
 
elite*gold: 0
Join Date: Oct 2005
Posts: 26
Received Thanks: 2
This is for Redux source and the client v5065.

Since I had written a long line of code for more than 2 NPCs by now.
I figured as much that you will tell me to create a method so I can call up that method the next time I decided to create a similar NPC.

Many thanks by the way.
If it weren't for your help I'd probably be complicating this far more than it needs to be.
KingGannon is offline  
Reply


Similar Threads Similar Threads
NPC Still moving to wrong place
10/13/2018 - Fiesta Online - 2 Replies
how to change location from that NPC here its moving to Adl Location so i need to Move to my new map how to change https://i.snag.gy/vhx2fp.jpg
[Guide]Moving Npc's on Current Map
09/15/2012 - EO PServer Guides & Releases - 2 Replies
Hello All this is my first little guide for all of you there may be others i am not entirely sure but i thought as i could not find one for myself when i wanted to move npcs i thought i would have a tinker with the cq_npc and i have figured it out so i want to share the knowledge with you Things required Access to your server through Client Navicat (or programs what do the same steps may be different) firstly log into your client so your on in this example i will be using Cronus open...
[HELP]Moving NPC
08/21/2012 - Dekaron Private Server - 2 Replies
Can anyone help me how to move Stacy NPC beside Sneak? ty.
[HELP]Moving NPC
12/20/2011 - Dekaron Private Server - 1 Replies
Hello, I need some help wen we login in game i can't see Logi only his name also Sneak. anyone can help me? and how can i move a npc?
MOVING NPC's
11/14/2006 - Conquer Online 2 - 21 Replies
Can some one answer on this question. how is posible to move NPC's. One guy comed to my server and he was moving the NPC's telling us he hacked GM panel...



All times are GMT +2. The time now is 18:38.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.