Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] How to remove a NPC through code?


Zetasis
 Share

Recommended Posts

Okay so I am simply needing to know how to remove an npc from the map editor properties through code. I have a summoning system in my engine but when a pet is summoned it sets the npc slot on the map properties to the petnpc. My idea is to remove the npc from the map properties after summoning a pet and just skipping the first slot for npcs on maps. Anyways, any and all ideas would be great. Thanks.
Link to comment
Share on other sites

When maps are loaded, the NPC's are loaded from the Map.NPC Array - eg: Map(MapNum).NPC(MapNpcNum) but they are stored in a temporary MapNpc(x) array. Meaning if you want it to be only a temporary change (until the NPC respawns), you'd only want to change the MapNpc(MapNum).Npc(MapNpcNum). If you wanted to permanently delete the NPC from the Map (so that it didn't appear in the Map Properties -> NPC listbox, then you'd change the Map(MapNum).NPC(MapNPCNum).

So for example; (these are server side functions)
MapNpc(MapNum).NPC(MapNpcNum) = 0
Map(MapNum).NPC(MapNpcNum) = 0
Link to comment
Share on other sites

Just create another index for pet and don't use NPC

Advantage:
- You don't have to mess with the NPC System

Disadvantage:
- It will loop the Pet System on ServerLoop which decrease CPS on Server, But if you manage to make it normal like what i did on my Real Action Pokemon Battle System, It would work fine
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...