NPC added

quanzhou

Loyal Member
Loyal Member
Aug 21, 2017
16
12
15
I use lua to programming all these NPCs, it looks pretty verbose, comparing to the legacy mir2 script.
It's just easier for me to maintain, since I am the only one developer on it.
npc.png

Lua is a language can be picked up in 10 minutes.
Anyone interested can help to port all NPC scripts, it's a huge mount of labor.
 
Last edited:
  • Like
Reactions: zedina

zedina

Mir3 Dev
Legendary
Dec 22, 2005
3,168
1
1,017
340
Hello sir,

Do your map editor is using original wemade map format?
Also database is flat file type?

Nice approach with LUA scripting 💪
 

quanzhou

Loyal Member
Loyal Member
Aug 21, 2017
16
12
15
Hi zedina,

Yes the mapeditor loads wemade map format, but I save it into another format to load in the game.
It's prettry same, 1 2x2 grid uses 1 block, and then compress with zip, to get smaller size. there are utility to convert back and forth.

Database is using flat file type, keep a table of file offset.
I didn't bring any magic new to the database/map format, it works pretty good till now.
Post automatically merged:

Imported all Mon_Def/xxx.gen files, converted to lua table.
I found some monster gen script in Mon_Def contains invalid rectangle which is trying to add monster outside of the map.

import.PNG screencapture-raw-githubusercontent-etorth-mir2x-master-server-script-map-7-D717-lua-2021-07-1...png
 
Last edited: