Dennys Posted July 22, 2009 Author Share Posted July 22, 2009 First of all i must let you know that Spawning a Total of 50 NPCS in a Map will be very Laggy.Have the option to have 50 npcs in a map Will not lagg, Spawning the 50 Will….Heres the Tutorial:[CLIENT SIDE]In ModTypes Module find:```Npc(1 To 15) As Integer SpawnX(1 To 15) As Byte SpawnY(1 To 15) As Byte```And Replace it With:```Npc(1 To 51) As Integer SpawnX(1 To 51) As Byte SpawnY(1 To 51) As Byte```Now Download the Attached Form and FRX Files and Add it to your Client Source Folder Replacing your Old Ones.THis is Just to Show what things were Edited in the FrmMapProperties.>! In frmMapEditor Find:``` For X = 1 To 15 cmbNpcX(X - 1).ListIndex = 0 cmbNpcY(X - 1).ListIndex = 0 Next X```And Replace it with:``` For X = 1 To 51 cmbNpcX(X - 1).ListIndex = 0 cmbNpcY(X - 1).ListIndex = 0 Next X```Next Find this a few scroll Lower in the same FORM:```For X = 1 To 15 cmbNpc(X - 1).addItem "No NPC" cmbNpcX(X - 1).addItem "Rand" cmbNpcY(X - 1).addItem "Rand" Next X>! For y = 1 To MAX_NPCS For X = 1 To 15 cmbNpc(X - 1).addItem y & ": " & Trim$(Npc(y).Name) Next X Next y>! For X = 1 To 15 cmbNpc(X - 1).ListIndex = Map(GetPlayerMap(MyIndex)).Npc(X) Next X>! For X = 1 To 15 For y = 0 To MAX_MAPX cmbNpcX(X - 1).addItem y Next y cmbNpcX(X - 1).ListIndex = Map(GetPlayerMap(MyIndex)).SpawnX(X) Next X For X = 1 To 15 For y = 0 To MAX_MAPY cmbNpcY(X - 1).addItem y Next y cmbNpcY(X - 1).ListIndex = Map(GetPlayerMap(MyIndex)).SpawnY(X) Next X```And Replace it with this:```For X = 1 To 51 cmbNpc(X - 1).addItem "No NPC" cmbNpcX(X - 1).addItem "Rand" cmbNpcY(X - 1).addItem "Rand" Next X>! For y = 1 To MAX_NPCS For X = 1 To 51 cmbNpc(X - 1).addItem y & ": " & Trim$(Npc(y).Name) Next X Next y>! For X = 1 To 51 cmbNpc(X - 1).ListIndex = Map(GetPlayerMap(MyIndex)).Npc(X) Next X>! For X = 1 To 51 For y = 0 To MAX_MAPX cmbNpcX(X - 1).addItem y Next y cmbNpcX(X - 1).ListIndex = Map(GetPlayerMap(MyIndex)).SpawnX(X) Next X For X = 1 To 51 For y = 0 To MAX_MAPY cmbNpcY(X - 1).addItem y Next y cmbNpcY(X - 1).ListIndex = Map(GetPlayerMap(MyIndex)).SpawnY(X) Next X```Next Once again a few scrolls lower Find:```For i = 1 To 15 Map(GetPlayerMap(MyIndex)).Npc(i) = cmbNpc(i - 1).ListIndex Map(GetPlayerMap(MyIndex)).SpawnX(i) = cmbNpcX(i - 1).ListIndex Map(GetPlayerMap(MyIndex)).SpawnY(i) = cmbNpcY(i - 1).ListIndex Next i```And Replace it with:```For i = 1 To 51 Map(GetPlayerMap(MyIndex)).Npc(i) = cmbNpc(i - 1).ListIndex Map(GetPlayerMap(MyIndex)).SpawnX(i) = cmbNpcX(i - 1).ListIndex Map(GetPlayerMap(MyIndex)).SpawnY(i) = cmbNpcY(i - 1).ListIndex Next i```Next Find This in ModHandleData:```For X = 1 To 15 Map(Val(parse(1))).Npc(X) = Val(parse(n)) Map(Val(parse(1))).SpawnX(X) = Val(parse(n + 1)) Map(Val(parse(1))).SpawnY(X) = Val(parse(n + 2)) n = n + 3 Next X```And Replace with:```For X = 1 To 51 Map(Val(parse(1))).Npc(X) = Val(parse(n)) Map(Val(parse(1))).SpawnX(X) = Val(parse(n + 1)) Map(Val(parse(1))).SpawnY(X) = Val(parse(n + 2)) n = n + 3 Next X```Then Find this in the same ModHandleData:```For i = 1 To 15 SaveMapNpc(i).num = Val(parse(n)) SaveMapNpc(i).X = Val(parse(n + 1)) SaveMapNpc(i).y = Val(parse(n + 2)) SaveMapNpc(i).Dir = Val(parse(n + 3)) n = n + 4 Next i```and Replace with:```For i = 1 To 51 SaveMapNpc(i).num = Val(parse(n)) SaveMapNpc(i).X = Val(parse(n + 1)) SaveMapNpc(i).y = Val(parse(n + 2)) SaveMapNpc(i).Dir = Val(parse(n + 3)) n = n + 4 Next i```Next Find this in ModConstants:```Public Const MAX_MAP_NPCS = 15```And Change it to:```Public Const MAX_MAP_NPCS = 51```[SERVER SIDE]In ModTypes Module find:```Npc(1 To 15) As Integer SpawnX(1 To 15) As Byte SpawnY(1 To 15) As Byte```And Replace it With:```Npc(1 To 51) As Integer SpawnX(1 To 51) As Byte SpawnY(1 To 51) As Byte```Next FInd in ModHandleData:```NPCIndex = 15```Replace it with:```NPCIndex = 51```And Finally Find This in ModConstants:```Public Const MAX_MAP_NPCS = 15```And Change to this:```Public Const MAX_MAP_NPCS = 51```And Thats About it.UPDATE: @DarkEdge:> Adding the code below makes it so you can't add drops to NPC's. Atleast for me. I kept it at 18 and it works fine..> > ```> NPCIndex = 51 > ``` Link to comment Share on other sites More sharing options...
Guest Posted July 22, 2009 Share Posted July 22, 2009 sweet as Link to comment Share on other sites More sharing options...
Dennys Posted July 22, 2009 Author Share Posted July 22, 2009 If anyone can Fix up the Form for me and make all of it under 1 tab instead of it showing on both lol youll see what i mean once you do it.Actually 50 Npcs in a map isint that laggy But when you add Players If you dont have a fast computer it wil lagg a bit not to mention to log in on it will be hell. Link to comment Share on other sites More sharing options...
damian666 Posted July 22, 2009 Share Posted July 22, 2009 you have done well… my young padawan XDno seriously, nice on mate :)Damian666 Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 22, 2009 Share Posted July 22, 2009 This will be perfect for Kittens Online.Considering you might have 3 or 4 NPCs following you at any given time. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 I can imagine a Female Cat being followed by 5 male cats Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 They follow the cat you choose to be the current leader.I'm not really here to explain how KO works…Ask your questions on the WIP board, or forum. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 i was joking. Now back on Topic, anyone actually tried out the tutorial? I want to know on what i can improve, this is My first tutorial ever. Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 You could make it noob freindly. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 It is noob friendly …. LOL all you have to do is COPY/PASTE and Replace. If you want to find somethign just Press CTRL+F and paste in what you want to find Press FInd and you found it..... Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 Yea, but noobs will take a look at the source stuff, and say:Wow, that looks complicated.You should make it so it doesnt JUMP into the source edit. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 But…its a....source....edit o.O Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 Take my advice, and save the noobs…...save the noobs, dennys... ...save them. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 back on topic plz…. How do i make it more Noob friendly? Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 By NOT jumping right into the source edits! Link to comment Share on other sites More sharing options...
goku1993 Posted July 23, 2009 Share Posted July 23, 2009 he just means explain the code you changed or somthing(i think), oh and i didn't test the tutorial since i m not home but it looks good should work. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 How can i Explain the Code? Lol i dont know what the code emans i just know what to change and were….Its easy just change every 15 up there to 51 lol, And Yes it Must be 51 if you want 50 spawns, and Downlaod the FRM and FRX attached and add to Source folder. and your done. Link to comment Share on other sites More sharing options...
DarkEdge Posted August 16, 2009 Share Posted August 16, 2009 Never mind I musta missed somthing =/GREAT source edit btw, this really helps thanks man Link to comment Share on other sites More sharing options...
Dennys Posted August 16, 2009 Author Share Posted August 16, 2009 Thanks, been a while since someone posted in this Topic lol… was wodnering if it wasent needed. Link to comment Share on other sites More sharing options...
DarkEdge Posted August 18, 2009 Share Posted August 18, 2009 Adding the code below makes it so you can't add drops to NPC's. Atleast for me. I kept it at 18 and it works fine..``` NPCIndex = 51 ``` Link to comment Share on other sites More sharing options...
X-Weaver Posted August 21, 2009 Share Posted August 21, 2009 o.o i really need this thanks very much Link to comment Share on other sites More sharing options...
Dennys Posted August 21, 2009 Author Share Posted August 21, 2009 @DarkEdge:> Adding the code below makes it so you can't add drops to NPC's. Atleast for me. I kept it at 18 and it works fine..> > ```> NPCIndex = 51 > ```Thank you for the Find ill add it to the main Post. Link to comment Share on other sites More sharing options...
shadowwulf Posted March 17, 2010 Share Posted March 17, 2010 Has anyone used this successfully in 2.7?I have tried twice, both with slightly different, imperfect outcomes… Link to comment Share on other sites More sharing options...
Robin Posted March 17, 2010 Share Posted March 17, 2010 I'm sorry… but I think you just missed the point completely here.```Public Const MAX_MAP_NPCS = 15```**That is there for a reason.** Do you think that number is just… not doing anything? If you were doing this properly you'd have gone through and change all the 15s you found to MAX_MAP_NPCS.Then no one has to go through and change all the damn numbers again, they can just change MAX_MAP_NPCS. That's why all the 'Max' constants are there.Apart from that it'd be much better to simply have a dynamic array of NPCs in the map and allow the developer to change the amount via. the editor. Link to comment Share on other sites More sharing options...
shadowwulf Posted March 17, 2010 Share Posted March 17, 2010 Yeah I already considered that though…But where that threw me was the .frm.I think the npc selection should be different so it doesnt need the form rebuilt when max npcs are changed.(i think thats along the lines of what you were saying) 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