![]() |
Updated Party/Group - 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: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Updated Party/Group (/showthread.php?tid=2024) Pages:
1
2
|
Re: Updated Party/Group - Rian - 21-08-2008 I think I'll have a go at it. Maybe if I can get something basic enough client side we can get another one of those community based tutorials going with it. Re: Updated Party/Group - Rian - 21-08-2008 Yeah, I'm gonna take a graphical approach for displaying hp and mp. Though I'll be doing it on a picBox rather than blting it to the game screen. I started working on it a little bit last night. My first attempt only read the Leader's Name, level, and class. It was like 3:00 a.m. though, so I didn't fiddle with it for too long. Re: Updated Party/Group - Rian - 21-08-2008 Okay, so I've been playing with this a little more today. Right now, I'm just trying to get everything displaying on plain old labels. Here is what I've done so far code-wise: Sub HandleData - Client Side Code: ' ::::::::::::::::: modGeneral - Server Side Code: Sub SendPartyStats(ByVal GroupID As Long) It works just fine when I have only 2 people in a party. This is what it looks like when I have 3 people in a party: ![]() As you can see, the third party member's stats are all out of order, and the name doesn't show up at all. I can't tell if the For statement client side is just spitting out random stuff, or if those numbers that do show up are actually representing the third party member. By the way Asrrin, you're missing some SEP_CHARs in SubSendPartyStats. Look between GetPlayerHP & GetPlayerMaxHP. Missing it for the Leader and Group Members. Does anyone see where this code is flawed? Because I don't :? Re: Updated Party/Group - Labmonkey - 21-08-2008 try having 4 or 2 people in the party. Is it always messing up on the third, or on the last, or everything after 2? Re: Updated Party/Group - Rian - 21-08-2008 Seems like it's everything after 2 party members. ![]() My FPS drops to 10 when I open 4 clients. Getting difficult to test :oops: Re: Updated Party/Group - GIAKEN - 21-08-2008 I'm thinking you're sending the packets wrong or handling them wrong. As you notice after the second one it skips the name and goes to the next parse data like it's skipping a number in a loop. Re: Updated Party/Group - Rian - 21-08-2008 I know. But I think it's worse than just skipping a parse. In the second pic, my level is where my class should be, and my name displays my class and hp. I'm about to commence thinking again though. Just got back from a job interview. Re: Updated Party/Group - Jacob - 21-08-2008 Add : Code: Debug.Print Data Under Code: If (LCase(Parse(0)) = "partystats") Then just so you can see what the actual packet data is. And instead of Code: n = n + 1 Code: n = n + 7 Re: Updated Party/Group - Rian - 21-08-2008 I'm adding different values to n to retrieve the right parse, then all I have to do is add 1 after it loops through the For statement. GroupNum always equals 1 though. One step closing to solving this I thinks Re: Updated Party/Group - Jacob - 21-08-2008 Sonire Wrote:I'm adding different values to n to retrieve the right parse, then all I have to do is add 1 after it loops through the For statement. You're not actually setting the n to those different values though. You have 7 parses in a loop so n needs to be n = n + 7. Re: Updated Party/Group - Rian - 21-08-2008 When I change the N + # I get pretty much the exact same results. Jumbled data, and the leader, and first party member working fine. Asrrin, bars will be easy just as soon as I get the right data sent. ![]() Re: Updated Party/Group - Matt - 22-08-2008 Just use shapes. As you can set the images to them and when you change the width, it doesn't stretch them and what not to the width, if it's shorter than the image loaded, it cuts it off. That's what we all do. >.> Re: Updated Party/Group - Jacob - 22-08-2008 I figured out the problem: In : Code: ' :::::::::::::::::: Change: Code: ' Check for a previous party and if so drop it to: Code: ' Check for a previous party and if so drop it The problem was on the server, it kept calling CreateGroup and makeing the groupcount = 0. You will still need to change N= N + 1 to N= N+7. Re: Updated Party/Group - Rian - 22-08-2008 ![]() Getting much closer. It displays the one of the party players twice though. Does the same thing if I have 3 people. I don't really understand how this makes a difference really though: Code: Player(n).PartyPlayer = Player(index).Char(Player(index).CharNum).Name Why do we need both of those lines? Re: Updated Party/Group - Jacob - 22-08-2008 Sonire Wrote: Opps, you just need: Code: Player(n).PartyPlayer = index Re: Updated Party/Group - NeoZeus - 27-08-2008 Hello, I've made some minor changes to hopefully fix up the code a bit. First, since we are keeping the leader separate from the members of the group, change Code: Type GroupRec to Code: Type GroupRec Now in the Joingroup, leavegroup, Sendgroupstats and Senddatatoparty sub, change all the for loops from Code: For I = 0 To MAX_GROUP_NUMBER To Code: For I = 1 To MAX_GROUP_NUMBER Now in the Leavegroup sub, add an Exit for to the for loop. We only want to assign 1 new group leader when the group leader leave the group so we need to exit after we promote 1 member to leader. Code: If Player(index).PartyStarter = YES Then In the Cleargroup sub, add the following line after you clear the group Code: CurrentGroupAmount = CurrentGroupAmount - 1 Finally, in the CloseSocket Sub find Code: If Index > 0 Then Below that line, add Code: If Player(index).InParty = YES Then This call the leavegroup sub to take a player out of the party when they disconnect from the server. I think that should be everything. For the client, what Sonire made works fine. My apologies for not mentioning which module the sub are in but I'm working off of 3.07 and I've modified the code a lot so my modules might be different than yours. Just do a search of the project for whatever you can't find. The party system seems to work fine (though it's still rather useless at this point until more features are added). I may have forgotten something typing all this up so if you can't get it working, post back and I'll double check my code. Re: Updated Party/Group - Matt - 28-08-2008 Asrrin29 Wrote:it is good practice to start arrays at 0 regardless of what is going on outside of them. you can do it that way if you want, but I think I'll keep it started at 0 unless it is causing errors elsewhere in the code. His changes just stops the group leader from being assigned a group ID, even though either way, it will always be 0 for the group leader. Lol. Re: Updated Party/Group - NeoZeus - 28-08-2008 Yeah, I just wanted to start at 1. 1 or 0 doesn't make a difference as long as you keep the structure throughout. Looking through the code, I see some bugs still. So here's the new Leavegroup sub: Code: Sub LeaveGroup(ByVal index As Long, ByVal N As Long) The original code left the members in their original spot in the members array when someone leave the group or DC from the server. That's also fine if you rewrite the code in the sendpartystats to use max_group_number instead of groupnum and just skip over any empty slot in the member array. However, since that sub is called very frequently, it is more efficient just to shift all members in the LeaveGroup Sub. The LeaveGroup sub now also reassign "PartyPlayer" for every group member. If you don't do this, members keep the ID of the leader if he/she DC and you'll error out later when you try to make calls based on that party ID. On the client side, make sure you clear out your labels when you receive partystats from the server. If you don't, you'll be seeing what looks to be duplicates ![]() Re: Updated Party/Group - DarkC - 14-09-2008 I've tried using this code...And so far I've only put in the Server side part of it, and it is giving me an error when I try compiling it. I'm using MS4 if that matters. I'm getting the error that says "Method or data member not found", and it's highlighting Code: Player(index).PartyPlayer = index The ".PartyPlayer =" part of the modTypes code above is what it's highlighting...What am I doing wrong? Re: Updated Party/Group - Rian - 14-09-2008 Server side coding on this tutorial is not fully functional yet. It's also largely written for compatibility with Mirage Source versions 3.0.3 and 3.0.7. Re: Updated Party/Group - DarkC - 14-09-2008 Oh, alright. Darn, I was hoping I could use this. =/ Oh well, I'll wait. Re: Updated Party/Group - skillzalot - 20-09-2008 Will this be updated for MSE2 this will be really neat to have Re: Updated Party/Group - Rian - 20-09-2008 I don't think it would be too difficult for anyone to integrate this into MSE2, as it's nearly identical to MSE1, MS303 and MS307 Re: Updated Party/Group - JadeCurt1ss - 26-09-2008 So, what works, and what doesn't? I'm trying to figure out the portions of the code I should be using, but its a pretty big confusing mess, and further to that, what parts work, and what doesn't? Re: Updated Party/Group - Rian - 26-09-2008 Sonire Wrote:Server side coding on this tutorial is not fully functional yet. It's also largely written for compatibility with Mirage Source versions 3.0.3 and 3.0.7. |