donovanvaught Posted January 17, 2012 Author Share Posted January 17, 2012 Hello all! Coming to you with a problem that I can't seem to find a solution for. I have a Data type for players that is set when you attack someone. Let me break it down, Weapon has affect (let's say Stun), when attacking a player, if the conditions are right, the victim has his Player.Status.type set to Stun, and the Player.status.time set to gettickcount plus a duration. all this info is being set properly (most of the time), and the packet is set up properly (same packet that sets the value in the first place), but it isn't resetting after the time runs out. Here is my server loop code```' check if need to turn off Affect For s = 1 To 25 If GetTickCount > TempPlayer(i).Status(s).Time Then TempPlayer(i).Status(s).Type = 0 TempPlayer(i).Status(s).Time = 0 TempPlayer(i).Status(s).Value = 0 SendAffect i, s, 0, 0, 0 End If Next```I've been getting intermittent problems while setting up the Affect system in my game, so any help with this is appreciated. Any other info needed just ask. :) Link to comment Share on other sites More sharing options...
Growlith1223 Posted January 17, 2012 Share Posted January 17, 2012 the Stun duration thing should already been on…...Are you trying to add it into the PlayerRec? Link to comment Share on other sites More sharing options...
donovanvaught Posted January 17, 2012 Author Share Posted January 17, 2012 Well, the stun was just an example, but if you must know I changed the stun mechanics. I have a total of 25 special affects (including stun) so I needed them to all be in the same place for more concise code. So now, instead of stunduration I have the PlayerRec.Status and the status data has .Type (stun, etc.) .Time (Gettickcount + Duration) and .value (like damage for poison). You can see in the code that it's not too different from what was there, it's just flexible to handle multiple affects. Link to comment Share on other sites More sharing options...
donovanvaught Posted January 23, 2012 Author Share Posted January 23, 2012 bump Link to comment Share on other sites More sharing options...
Ruins of Hell Posted January 23, 2012 Share Posted January 23, 2012 Set a breakpoint to see if the if is actually running and if it's true when it should be. Then add another check client-side to see if SendAffect actually works (you said you did this, but make sure).Other than the generic debugging help, I can't help you without knowing more about the system. Link to comment Share on other sites More sharing options...
donovanvaught Posted January 23, 2012 Author Share Posted January 23, 2012 Thanks for the reply Soul, funny story, was just coming back to say that I solved the problem when I saw your post. Anywho, I checked client side and it finally clicked that there was a check to make sure it fills an empty status slot, this same check was running when trying to turn off an affect (therefore the slot wasn't empty, so it didn't get set to 0). So long to short, I fixed it. Thanks again for the replies! 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