![]() |
I got some of it - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17) +---- Thread: I got some of it (/showthread.php?tid=2507) |
I got some of it - skillzalot - 19-01-2009 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 Re: I got some of it - Anthony - 19-01-2009 Search for this: Calculate exp to give and you should find the places that you need to change it to. Re: I got some of it - skillzalot - 19-01-2009 I searched for that and could not find it Re: I got some of it - Anthony - 19-01-2009 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 Re: I got some of it - skillzalot - 19-01-2009 I am really lost. I am using ms4 and cant find where to do this at. Please help me Re: I got some of it - deathknight - 19-01-2009 It is there in MS4 also, you must not be searching the whole project. It is in modPlayer, sub AttackNpc Re: I got some of it - Anthony - 20-01-2009 Server Side. Re: I got some of it - skillzalot - 20-01-2009 I change it but when i attack npc he dont have hp or exp so he wont die. So i decided to wait Re: I got some of it - deathknight - 20-01-2009 did you make sure to delete your NPC files? It may not work properly until you do. Re: I got some of it - skillzalot - 20-01-2009 no i did not but I think i will wait Re: I got some of it - genusis - 20-01-2009 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/viewtopic.php?f=75&t=97 Re: I got some of it - Coke - 20-01-2009 I like how we are attracting so many uber pro coders to the community lately. Yeeeehaaaaaar Re: I got some of it - Jacob - 20-01-2009 Quote:[16:52] Skillzalot: i cant figure this out Re: I got some of it - Anthony - 20-01-2009 viewtopic.php?f=75&t=97 It's made for MS1 but use your brain and it should be easy to figure out. Re: I got some of it - skillzalot - 21-01-2009 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 Re: I got some of it - skillzalot - 21-01-2009 Still get subscript out of range Re: I got some of it - deathknight - 21-01-2009 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)) Re: I got some of it - Coke - 22-01-2009 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. Re: I got some of it - Jacob - 22-01-2009 Code: Npc(n).Hp = CByte(Parse(16)) Are you sure you're sending 16 different pieces in that packet? Re: I got some of it - skillzalot - 22-01-2009 Dugor yes 16 things. Yes i deleted my npcs. It fails when i try to open the npc editor Re: I got some of it - Jacob - 22-01-2009 According to that tutorial, the HP and EXP are longs. You are trying to convert to Bytes, try to use CLng instead. Re: I got some of it - skillzalot - 22-01-2009 actual it highlight Npc(n).ExpGiven = CLng(Parse(17)) and says subscript out of range Re: I got some of it - deathknight - 22-01-2009 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 |