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

[EO2]Help adding shops to NPC


SeeingBlue
 Share

Recommended Posts

I added **Shop As Long** to **NpcRec** on both the client & server. Modified the frmEditor_NPC with a combo box to populate with the currently available shops. Modified the modGameEditors. Then on the server under **CanPlayerAttackNPC** I had it check to see if the NPC is a shopkeeper & if so then **SendOpenShop**.
~~My problem lies somewhere in storing & moving the data for NPC. Everything is off, Name isn't showing up, sprite isn't showing up. The Npc has no health. I got the data offset when storing somehow & I can't figure out what I missed. Any ideas?~~

After doing further investigation, I discovered that my code works fine, but something is wrong with the first NPC slot in the NPC Editor. I created the same NPC in the second slot & everything works as intended. I tried to created a new NPC in the first slot again & it doesn't show up in the map editor under the NPC Spawn, only shows the second NPC as the first.
Link to comment
Share on other sites

@SeeingBlue:

> I added **Shop As Long** to **NpcRec** on both the client & server. Modified the frmEditor_NPC with a combo box to populate with the currently available shops.

Add a thing like this:
```
Call OpenShop(index, Npc(npcnum).shop)
```
to PlayerAttackNpc
Link to comment
Share on other sites

After doing further investigation, I discovered that my code works fine, but something is wrong with the first NPC slot in the NPC Editor. I created the same NPC in the second slot & everything works as intended. I tried to created a new NPC in the first slot again & it doesn't show up in the map editor under the NPC Spawn, only shows the second NPC as the first.
Link to comment
Share on other sites

That would delete the NPC's information, and the Map information still retains the fact that there is indeed an NPC there. I've had this happen before, from my own goofs when changing around my NPCs in the editor and not knowing I still had one out there. But in my experience when this happens you can't see the NPC at all. Its just there. In which case you go into your map options and find where you set NPCs, and it should be blank instead of having the NPC's name. Just remove that NPC and you're good to go.

Edit- I believe NPC Spawn goes by the NPC number, not the actual NPC saved in that NPC slot, so if you change or delete the NPC, the spawn will spawn the new NPC or spawn my aforementioned blank NPCs.
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...