| Mirage Source http://web.miragesource.net/forums/ |
|
| I got some of it http://web.miragesource.net/forums/viewtopic.php?f=201&t=4979 |
Page 1 of 2 |
| Author: | skillzalot [ Mon Jan 19, 2009 11:23 am ] |
| Post subject: | I got some of it |
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 |
|
| Author: | Anthony [ Mon Jan 19, 2009 3:56 pm ] |
| Post subject: | Re: I got some of it |
Search for this: Calculate exp to give and you should find the places that you need to change it to. |
|
| Author: | skillzalot [ Mon Jan 19, 2009 8:26 pm ] |
| Post subject: | Re: I got some of it |
I searched for that and could not find it |
|
| Author: | Anthony [ Mon Jan 19, 2009 8:34 pm ] |
| Post subject: | Re: I got some of it |
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
STR = Npc(NpcNum).Stat(Stats.Strength) DEF = Npc(NpcNum).Stat(Stats.Defense) Exp = STR * DEF * 2 |
|
| Author: | skillzalot [ Mon Jan 19, 2009 9:00 pm ] |
| Post subject: | Re: I got some of it |
I am really lost. I am using ms4 and cant find where to do this at. Please help me |
|
| Author: | deathknight [ Mon Jan 19, 2009 9:23 pm ] |
| Post subject: | Re: I got some of it |
It is there in MS4 also, you must not be searching the whole project. It is in modPlayer, sub AttackNpc |
|
| Author: | Anthony [ Tue Jan 20, 2009 12:31 am ] |
| Post subject: | Re: I got some of it |
Server Side. |
|
| Author: | skillzalot [ Tue Jan 20, 2009 2:12 am ] |
| Post subject: | Re: I got some of it |
I change it but when i attack npc he dont have hp or exp so he wont die. So i decided to wait |
|
| Author: | deathknight [ Tue Jan 20, 2009 2:37 am ] |
| Post subject: | Re: I got some of it |
did you make sure to delete your NPC files? It may not work properly until you do. |
|
| Author: | skillzalot [ Tue Jan 20, 2009 2:49 am ] |
| Post subject: | Re: I got some of it |
no i did not but I think i will wait |
|
| Author: | genusis [ Tue Jan 20, 2009 3:04 pm ] |
| Post subject: | Re: I got some of it |
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 |
|
| Author: | Coke [ Tue Jan 20, 2009 6:33 pm ] |
| Post subject: | Re: I got some of it |
I like how we are attracting so many uber pro coders to the community lately. Yeeeehaaaaaar |
|
| Author: | Jacob [ Tue Jan 20, 2009 6:50 pm ] |
| Post subject: | Re: I got some of it |
Quote: [16:52] Skillzalot: i cant figure this out
[16:57] Jacob: I cant either [16:57] Skillzalot: what are you trying to do [16:57] Jacob: how to get away with murder [16:57] Jacob: you? [16:57] Skillzalot: lol [16:58] Skillzalot: im trying to change the calculations for npc hp and exp [16:58] Skillzalot: that way they run off of scroll bars [16:58] Jacob: well do you have variables to hold those values? [16:59] Skillzalot: no |
|
| Author: | Anthony [ Tue Jan 20, 2009 7:02 pm ] |
| Post subject: | Re: I got some of it |
viewtopic.php?f=75&t=97 It's made for MS1 but use your brain and it should be easy to figure out. |
|
| Author: | skillzalot [ Wed Jan 21, 2009 12:25 am ] |
| Post subject: | Re: I got some of it |
I change it but i got a problem. Code: ' ::::::::::::::::::::: ' :: Edit npc packet :: ' ::::::::::::::::::::: Sub HandleEditNpc(ByRef Parse() As String) Dim n As Long n = CLng(Parse(1)) ' Update the npc Npc(n).Name = Parse(2) Npc(n).AttackSay = Parse(3) Npc(n).Sprite = CInt(Parse(4)) Npc(n).SpawnSecs = CLng(Parse(5)) Npc(n).Behavior = CByte(Parse(6)) Npc(n).Range = CByte(Parse(7)) Npc(n).DropChance = CInt(Parse(8)) Npc(n).DropItem = CByte(Parse(9)) Npc(n).DropItemValue = CInt(Parse(10)) Npc(n).Stat(Stats.Strength) = CByte(Parse(11)) Npc(n).Stat(Stats.Defense) = CByte(Parse(12)) Npc(n).Stat(Stats.SPEED) = CByte(Parse(13)) Npc(n).Stat(Stats.Magic) = CByte(Parse(14)) Npc(n).Quest = CByte(Parse(15)) Npc(n).MaxHP = CByte(Parse(16)) Npc(n).ExpGiven = CByte(Parse(17)) ' Initialize the npc editor Call NpcEditorInit End Sub 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 |
|
| Author: | skillzalot [ Wed Jan 21, 2009 3:55 am ] |
| Post subject: | Re: I got some of it |
Still get subscript out of range |
|
| Author: | deathknight [ Wed Jan 21, 2009 11:17 pm ] |
| Post subject: | Re: I got some of it |
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)) When I scroll over the Npc(n).Hp ith shows = 0, but when I scroll over the CByte(Parse(16)) it shows = Subscript out of range. I'm not sure what I'm Missing in the code. I haven't even tried to make the 2 values do anything yet, just save.
|
|
| Author: | Coke [ Thu Jan 22, 2009 12:28 am ] |
| Post subject: | Re: I got some of it |
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. |
|
| Author: | Jacob [ Thu Jan 22, 2009 12:32 am ] |
| Post subject: | Re: I got some of it |
Code: Npc(n).Hp = CByte(Parse(16)) Are you sure you're sending 16 different pieces in that packet? |
|
| Author: | skillzalot [ Thu Jan 22, 2009 12:40 am ] |
| Post subject: | Re: I got some of it |
Dugor yes 16 things. Yes i deleted my npcs. It fails when i try to open the npc editor |
|
| Author: | Jacob [ Thu Jan 22, 2009 12:45 am ] |
| Post subject: | Re: I got some of it |
According to that tutorial, the HP and EXP are longs. You are trying to convert to Bytes, try to use CLng instead. |
|
| Author: | skillzalot [ Thu Jan 22, 2009 1:02 am ] |
| Post subject: | Re: I got some of it |
actual it highlight Npc(n).ExpGiven = CLng(Parse(17)) and says subscript out of range |
|
| Author: | deathknight [ Thu Jan 22, 2009 2:22 am ] |
| Post subject: | Re: I got some of it |
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: (click to show)
|
|
| Page 1 of 2 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|