19-01-2009, 11:23 AM
I want to change the way you pick the exp and health. I went to change to scroll bars. Right now i got the scroll bars working but it still wants to use the formula. How do i change this
I got some of it
|
19-01-2009, 11:23 AM
I want to change the way you pick the exp and health. I went to change to scroll bars. Right now i got the scroll bars working but it still wants to use the formula. How do i change this
19-01-2009, 03:56 PM
Search for this:
Calculate exp to give and you should find the places that you need to change it to.
19-01-2009, 08:26 PM
I searched for that and could not find it
19-01-2009, 08:34 PM
Press Ctrl+F and type that in exactly. It should show up in two spots, maybe more I am not sure but it's there. Should look something like this:
Code: ' Calculate exp to give attacker
19-01-2009, 09:00 PM
I am really lost. I am using ms4 and cant find where to do this at. Please help me
19-01-2009, 09:23 PM
It is there in MS4 also, you must not be searching the whole project. It is in modPlayer, sub AttackNpc
20-01-2009, 12:31 AM
Server Side.
20-01-2009, 02:12 AM
I change it but when i attack npc he dont have hp or exp so he wont die. So i decided to wait
20-01-2009, 02:37 AM
did you make sure to delete your NPC files? It may not work properly until you do.
20-01-2009, 02:49 AM
no i did not but I think i will wait
20-01-2009, 03:04 PM
hey ^^ well skills you have to delet your npcs in order for this to work correctly.
here the ho/EXP thing for ya http://web.miragesource.com/forums/viewt...?f=75&t=97
20-01-2009, 06:33 PM
I like how we are attracting so many uber pro coders to the community lately. Yeeeehaaaaaar
20-01-2009, 06:50 PM
Quote:[16:52] Skillzalot: i cant figure this out
20-01-2009, 07:02 PM
viewtopic.php?f=75&t=97
It's made for MS1 but use your brain and it should be easy to figure out.
21-01-2009, 12:25 AM
I change it but i got a problem.
Code: ' ::::::::::::::::::::: It highlights Npc(n).ExpGiven = CByte(Parse(17)) and says subscript out of range ive been playing withg it for 10 mins and cant figure it out
21-01-2009, 03:55 AM
Still get subscript out of range
21-01-2009, 11:17 PM
Yeah, I've been playing with it for a bit too and can't get it to work. it gives me a subscript out of range message on
Code: Npc(n).Hp = CByte(Parse(16))
22-01-2009, 12:28 AM
Its not difficult, just make sure you are parsing all the values in the packet in exactly the same order client and server side.
From the nature of the error though (you aren't getting far enough for the above to be a problem), you are doing something very stupid like declaring the MaxHP and ExpGiven in a private event procedure. In fact, I'll bet you a tenner its something along those lines. Either that, you are forcing too many values into the packet (you haven't constructed your sendsavenpc event proc properly), or, as I don't use ms4, there is some unforeseen but obvious complication. Hell, are you even populating the variables at all client side? (MaxHP and ExpGiven) - could be you are trying to pull in a var that hasn't actually been populated yet, but I think vb6 defaults blank vars to 0 (false), or vbnullstring in the case of a string (since vb seems to have no concept of null, or protects us from it at least). Have you deleted your NPC's so your client isn't falling over when its trying to get information about an NPC? At what point does this blow up? Upon attempting to run the client, upon going onto a map with an npc, upon sending the npc editor... DON'T JUST SKIM READ WHAT I SAID AND ONLY COME BACK WITH "oh it blows up when I run the client". Check everything I just said, it will either be the variable can't be reached, or you are forcing too many variables into your sendsavenpc method, I'm pretty confident its one or the other.
22-01-2009, 12:32 AM
Code: Npc(n).Hp = CByte(Parse(16)) Are you sure you're sending 16 different pieces in that packet?
22-01-2009, 12:40 AM
Dugor yes 16 things.
Yes i deleted my npcs. It fails when i try to open the npc editor
22-01-2009, 12:45 AM
According to that tutorial, the HP and EXP are longs. You are trying to convert to Bytes, try to use CLng instead.
22-01-2009, 01:02 AM
actual it highlight Npc(n).ExpGiven = CLng(Parse(17)) and says subscript out of range
22-01-2009, 02:22 AM
It's still failing when you type /editnpc? Mine fails after I click on an NPC to edit and send. Yes Fox, I did add everything to both sides. I planned on making a tutorial for this for MS4 if I had gotten it to work, I'll post it below, it shows exactly what I've done with it. As for forcing to many variables into it, how is that possible? I'm still pretty new, but I thought I'd had gotten a few of the basics down.
And I didn't look at the tutorial that was posted, everything that I did, I tried to do myself. I'll go back and take a look at it later though. What I was writing up wasn't done at all, it was done as far as adding the variables into the NPC file, not using them yet. I always make sure the variable is added in before I use it for anything. [spoiler]First add s scrollbars to your frmNpcEditor, and rename them scrlExp and scrlHp. Make sure you keep the lblStartHp and lblExpGiven, and set them next to your scrollbars to show you the value. Make sure you set the minimum value at 1. Next in frmNpcEditor find these 3 subs Code: Private Sub scrlStrength_Change() And Replace with Code: Private Sub scrlStrength_Change() Next add these 2 subs to your frmNpcEditor Code: Private Sub scrlExp_Change() In Sub NpcEditor, underneath Code: frmNpcEditor.scrlMagic.Value = Npc(EditorIndex).Stat(Stats.Magic) Add Code: frmNpcEditor.scrlExp.Value = Npc(EditorIndex).Exp Now in Sub NpcEditorOK beneath Code: Npc(EditorIndex).Stat(Stats.Magic) = frmNpcEditor.scrlMagic.Value add Code: Npc(EditorIndex).Exp = frmNpcEditor.scrlExp.Value Now in sub HandleUpdateNpc, beneath Code: Npc(n).Stat(Stats.Magic) = 0 add Code: Npc(n).Exp = 0 Now in Sub HandleEditNpc, underneath Code: Npc(n).Stat(Stats.Magic) = CByte(Parse(14)) Code: Npc(n).Exp = CInt(Parse(15)) Now in Type NpcRec, add Code: Hp as integer Now in sub SendSaveNpc before Code: & END_CHAR Code: & SEP_CHAR & .Exp & SEP_CHAR & .Hp Now we are done Client Side. Now for SERVER side. In Sub HandleSaveNpc add in Code: Npc(n).Exp = Val(Parse(15)) In Sub SendEditNpcTo add Code: & SEP_CHAR & Npc(NpcNum).Exp & SEP_CHAR & Npc(NpcNum).Hp Now in Type NpcRec, add Code: Hp as integer |
« Next Oldest | Next Newest »
|