| Mirage Source http://www.miragesource.net/forums/ |
|
| Class-Specific Background http://www.miragesource.net/forums/viewtopic.php?f=201&t=4154 |
Page 1 of 1 |
| Author: | Acruno [ Wed Aug 13, 2008 4:20 pm ] |
| Post subject: | Class-Specific Background |
I am attempting to make a feature where the GUI changes dependent on the player's class, but I keep getting RTE9. In my FrmMirage frmLoad sub - Code: If GetPlayerClass(Index) = 0 Then picBackground.Picture = LoadPicture(App.Path & "\gfx\gui\ingame\warrior\ingame.bmp") End If When run IDE it highlights Code: Function GetPlayerClass(ByVal Index As Long) As Long GetPlayerClass = Player(Index).Class End Function Specifically, Code: GetPlayerClass = Player(Index).Class Any help/nudges in the right direction would be greatly appreciated I don't doubt I'm missing something painfully obvious |
|
| Author: | Rian [ Wed Aug 13, 2008 4:22 pm ] |
| Post subject: | Re: Class-Specific Background |
Code: If GetPlayerClass(Index) = 0 Then picBackground.Picture = LoadPicture(App.Path & "\gfx\gui\ingame\warrior\ingame.bmp") End If Change the if statement to: Code: If GetPlayerClass(MyIndex) = 0 Not sure if that's the problem exactly, but it's a start. |
|
| Author: | Acruno [ Wed Aug 13, 2008 4:27 pm ] |
| Post subject: | Re: Class-Specific Background |
Still no change, although thanks for pointing that out. |
|
| Author: | Robin [ Wed Aug 13, 2008 4:32 pm ] |
| Post subject: | Re: Class-Specific Background |
Your MyIndex hasn't been set yet. Find: Code: MyIndex = Val(Parse(1)) In modHandleData. Underneath it add: Code: Select Case GetPlayerClass(myindex)
Case 0 'class 0 frmMirage.Picture = LoadPicture(App.Path & "\gfx\gui\ingame\warrior\ingame.bmp") Case 1 frmMirage.Picture = LoadPicture(App.Path & "\gfx\gui\ingame\class2\ingame.bmp") End select |
|
| Author: | Acruno [ Wed Aug 13, 2008 4:44 pm ] |
| Post subject: | Re: Class-Specific Background |
Thanks Robin, it's working fine now |
|
| Author: | Rian [ Wed Aug 13, 2008 5:06 pm ] |
| Post subject: | Re: Class-Specific Background |
The select case should run through just fine if you put it where Robin said to. Perhaps you've got the wrong graphics path? |
|
| Author: | Rian [ Wed Aug 13, 2008 5:07 pm ] |
| Post subject: | Re: Class-Specific Background |
So what was the problem? |
|
| Author: | Acruno [ Wed Aug 13, 2008 5:30 pm ] |
| Post subject: | Re: Class-Specific Background |
I was lazy and just directly copied and pasted it, not realizing it was only frmMirage.Picture, not frmMirage.picBackground.Picture. Although that was probably Robins way of telling me that the picture box wasn't needed. [EDIT] The only GUI displaying is the Case 0 one, regardless of the class of the player. Ideas? [EDIT2] I had another look, realized that the whole Select Case was in the loginok packet, wheras it should be in the ingame packet no? Will mess around with it a little, see what happens. |
|
| Author: | Matt [ Wed Aug 13, 2008 5:40 pm ] |
| Post subject: | Re: Class-Specific Background |
My guess would be that the server isn't sending the player's class in that packet. I don't see why you don't just have the server send the class in a packet to the client, in the joingame sub server side and change it there. |
|
| Author: | Acruno [ Wed Aug 13, 2008 6:06 pm ] |
| Post subject: | Re: Class-Specific Background |
Because that would work perfectly, and teach me how to construct packets. Thanks |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|