| Mirage Source http://www.miragesource.net/forums/ |
|
| Bloody RTE 9: Subscript out of Range http://www.miragesource.net/forums/viewtopic.php?f=201&t=5353 |
Page 1 of 1 |
| Author: | MirWraith [ Thu Apr 02, 2009 12:01 pm ] |
| Post subject: | Bloody RTE 9: Subscript out of Range |
Hi, I've recently used the "kingdoms" tutorial in the old tutorials section of the forum. I've made a couple of alterations to get the code to actually work, however, I've now run into a problem. Whenever anyone logs out the game, everyone else left on gets a "RTE 9: subscript out of range" error. I've ran it through the debug and it highlights this line: Call SetPlayerkingdom(i, Val(Parse(10))) which is under "Player data packet", I've checked the packet the server sends and found that it does send the players kingdom information. So now I'm confused as hell, I know the answer to this is going to be simple as hell, but well atm I'm confused. Thanks in advance for any help |
|
| Author: | Pbcrazy [ Thu Apr 02, 2009 12:06 pm ] |
| Post subject: | Re: Bloody RTE 9: Subscript out of Range |
you might check the variable types to make sure they match up, as the only thing i can think of atm, is that you either converted or didn't a variable type (may be worng, idk). check here, and the corrosponding sub: Code: i, Val(Parse(10)) i'll look at the tut later, when i have time. |
|
| Author: | Jacob [ Thu Apr 02, 2009 12:08 pm ] |
| Post subject: | Re: Bloody RTE 9: Subscript out of Range |
You need to figure out if it's the 'i' or the 'val(parse(10))' that is causing the RTE 9. My first guess would be that there's nothing in 'val(parse(10))' which means you need to check the packet server side and make sure you're sending the right amount of data. |
|
| Author: | MirWraith [ Thu Apr 02, 2009 12:35 pm ] |
| Post subject: | Re: Bloody RTE 9: Subscript out of Range |
Server side, under the "SendJoinMap" sub: ' Send index's player data to everyone on the map including himself Packet = "PLAYERDATA" & SEP_CHAR & Index & SEP_CHAR & GetPlayerName(Index) & SEP_CHAR & GetPlayerSprite(Index) & SEP_CHAR & GetPlayerMap(Index) & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & GetPlayerAccess(Index) & SEP_CHAR & GetPlayerPK(Index) & SEP_CHAR & GetPlayerkingdom(Index) & SEP_CHAR & END_CHAR and under the "SendLeaveMap" sub: Packet = "PLAYERDATA" & SEP_CHAR & Index & SEP_CHAR & GetPlayerName(Index) & SEP_CHAR & GetPlayerSprite(Index) & SEP_CHAR & 0 & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & GetPlayerAccess(Index) & SEP_CHAR & GetPlayerPK(Index) & SEP_CHAR & GetPlayerkingdom(Index) & SEP_CHAR & END_CHAR and finally under the "SendPlayerData" sub: Packet = "PLAYERDATA" & SEP_CHAR & Index & SEP_CHAR & GetPlayerName(Index) & SEP_CHAR & GetPlayerSprite(Index) & SEP_CHAR & GetPlayerMap(Index) & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & SEP_CHAR & GetPlayerDir(Index) & SEP_CHAR & GetPlayerAccess(Index) & SEP_CHAR & GetPlayerPK(Index) & SEP_CHAR & GetPlayerkingdom(Index) & SEP_CHAR & END_CHAR Whats annoying me with it, is the fact its only happening when they actually log out the game, not when they simply change maps. |
|
| Author: | Jacob [ Thu Apr 02, 2009 12:39 pm ] |
| Post subject: | Re: Bloody RTE 9: Subscript out of Range |
I don't know what version of MS you're using, but I do believe there's also a 'SendLeftGame' that has the playerdata. |
|
| Author: | MirWraith [ Thu Apr 02, 2009 12:54 pm ] |
| Post subject: | Re: Bloody RTE 9: Subscript out of Range |
Dugor, cheers mate. Sorted lol, I'm such an idiot |
|
| Author: | Jacob [ Thu Apr 02, 2009 12:56 pm ] |
| Post subject: | Re: Bloody RTE 9: Subscript out of Range |
I just posted this: viewtopic.php?f=120&t=5356 Might be interest to you. |
|
| Author: | GIAKEN [ Thu Apr 02, 2009 1:42 pm ] |
| Post subject: | Re: Bloody RTE 9: Subscript out of Range |
Dugor wrote: You need to figure out if it's the 'i' or the 'val(parse(10))' that is causing the RTE 9. How could the i ever be causing an RTE 9 on that line? |
|
| Author: | Jacob [ Thu Apr 02, 2009 1:46 pm ] |
| Post subject: | Re: Bloody RTE 9: Subscript out of Range |
I was thinking "Overflow', if the value is too high for that variable type. If i was a byte and it was 299. |
|
| Author: | GIAKEN [ Thu Apr 02, 2009 1:52 pm ] |
| Post subject: | Re: Bloody RTE 9: Subscript out of Range |
Surreee... |
|
| Author: | FrankJScott [ Fri Jan 12, 2024 11:12 am ] |
| Post subject: | High Rated Product Website |
Please try Google before asking about Best Product Website 2af4fc2 |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|