![]() |
Bloody RTE 9: Subscript out of Range - Printable Version +- Mirage Engine (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: Bloody RTE 9: Subscript out of Range (/showthread.php?tid=2673) |
Bloody RTE 9: Subscript out of Range - MirWraith - 02-04-2009 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 ![]() Re: Bloody RTE 9: Subscript out of Range - Pbcrazy - 02-04-2009 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. Re: Bloody RTE 9: Subscript out of Range - Jacob - 02-04-2009 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. Re: Bloody RTE 9: Subscript out of Range - MirWraith - 02-04-2009 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. :evil: Re: Bloody RTE 9: Subscript out of Range - Jacob - 02-04-2009 I don't know what version of MS you're using, but I do believe there's also a 'SendLeftGame' that has the playerdata. Re: Bloody RTE 9: Subscript out of Range - MirWraith - 02-04-2009 Dugor, cheers mate. Sorted ![]() lol, I'm such an idiot Re: Bloody RTE 9: Subscript out of Range - Jacob - 02-04-2009 I just posted this: viewtopic.php?f=120&t=5356 Might be interest to you. Re: Bloody RTE 9: Subscript out of Range - GIAKEN - 02-04-2009 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? Re: Bloody RTE 9: Subscript out of Range - Jacob - 02-04-2009 I was thinking "Overflow', if the value is too high for that variable type. If i was a byte and it was 299. Re: Bloody RTE 9: Subscript out of Range - GIAKEN - 02-04-2009 Surreee... |