Xlithan Posted March 11, 2016 Author Share Posted March 11, 2016 **COPY & PASTE NPC's****–** A tutorial by Xlithan –Just thought I'd contribute this small piece of code to the community. It makes adding NPCs much easier with just a few clicks of a button.Anybody who has made large maps with a lot of NPCs knows the frustration of going through each list item one by one.This tutorial will work for any version of Eclipse Origins, and any source code that uses a similar map properties design (Which as far as I remember,is pretty much every version dating back to Mirage Source).**Open up your Map Properties form. You will need to create the following items:**![](http://i.snag.gy/i2XSo.jpg)cmdPaste (CommandButton)cmdClear (CommandButton)cmdClearAll (CommandButton)2 Labels (Name doesn't matter)txtStart (TextBox)txtEnd (TextBox)cmdBatchPaste (CommandButton)cmdCopy (CommandButton)**Place the items next to your NPC listbox like so:**![](http://i.snag.gy/91HXU.jpg)**Now you need to add the following code to each item (Code may vary for different sources. This was written for SkyWyre Primitive):****_At the very top of the form, add:_**```Private CopyIndex As LongPrivate PasteIndex As Long```**_cmdPaste_**```Private Sub btnPaste_Click() cmbNpc.ListIndex = CopyIndexEnd Sub```**_cmdClear_**```Private Sub btnClear_Click() cmbNpc.ListIndex = 0End Sub```**_cmdClearAll_**```Private Sub btnClearAll_Click()Dim I As Long For I = 0 To MAX_MAP_NPCS - 1 lstNpcs.ListIndex = I cmbNpc.ListIndex = 0 Next IEnd Sub```**_cmdBatchPaste_**```Private Sub btnBatchPaste_Click()Dim I As LongDim s As LongDim e As Long s = txtStart.text - 1 e = txtEnd.text - 1 For I = s To e lstNpcs.ListIndex = I cmbNpc.ListIndex = CopyIndex Next IEnd Sub```**_cmdCopy_**```Private Sub btnCopy_Click() CopyIndex = cmbNpc.ListIndexEnd Sub```**And that's all!**![](http://i.snag.gy/DCfAb.jpg) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now