Kimimaru Posted June 19, 2009 Author Share Posted June 19, 2009 Hello. I would like to make it so that once you enter a PvP map, it displays a sign on the bottom right of the game screen indicating that the area is a PvP zone. For example, upon entering a PvP map, it displays a "VS" sign on the bottom right. Additionally, I only want the image to appear in PvP maps. I think that I know the basics of getting this to work, although I'm not sure if my thoughts are correct or not. Any help would be appreciated. Link to comment Share on other sites More sharing options...
Sowtis Posted June 19, 2009 Share Posted June 19, 2009 I see what you mean, it would be a good idea.I'd like to know how to do this too, probably quite easy, but what do I know… Link to comment Share on other sites More sharing options...
dao Posted June 20, 2009 Share Posted June 20, 2009 well im not so sure =/ but my guess is to paste the image on the game screen and make it visible=falsethen go to ' draw map name and somewere put myimage.visible=true something like that Link to comment Share on other sites More sharing options...
ZeroOnlin200 Posted June 20, 2009 Share Posted June 20, 2009 well you could make a script were when u step on a tile that will appear and just put it on all the tile's Link to comment Share on other sites More sharing options...
dao Posted June 20, 2009 Share Posted June 20, 2009 uhh no heres what u do. paste an image on and name it "imgnone"and find ' draw map name and replace it with this> ' Draw map name> If Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_NONE Then> Call DrawText(TexthDC, 0 + sx, 0 + sx,> imgnone.visible=true> Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(BRIGHTRED))> ElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_HOUSE Then> Call DrawText(TexthDC, 0 + sx, 0 + sx,> imgnone.visible=false> Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(YELLOW))> ElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_SAFE Then> Call DrawText(TexthDC, 0 + sx, 0 + sx,> imgnone.visible=false> Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(BRIGHTGREEN))> ElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_NO_PENALTY Then> Call DrawText(TexthDC, 0 + sx, 0 + sx,> imgnone.visible=false> Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(WHITE)) Link to comment Share on other sites More sharing options...
Kimimaru Posted June 20, 2009 Author Share Posted June 20, 2009 The only way I can move my image on the game screen after I paste it is to put it into a picture box and then move the picture box. I can't name the image, but I can name the picture box. Your method would work; however, I believe that I would have to have some sort of background behind the image because I cannot make the picture box transparent. I believe I would need some DirectX coding skills of some sort to do that. If I'm wrong, please correct me. Thanks for the help, though. I can use this to my benefit. Link to comment Share on other sites More sharing options...
dao Posted June 20, 2009 Share Posted June 20, 2009 lol.. noo simply just find the image button and make a box then paste it inside Link to comment Share on other sites More sharing options...
Kimimaru Posted June 20, 2009 Author Share Posted June 20, 2009 Okay, thanks. I understand what you're saying, but whenever I paste my image onto there, it has a white background, even though I previously removed the background from the image and made the background transparent. Do you know what I can do? Link to comment Share on other sites More sharing options...
Kimimaru Posted June 22, 2009 Author Share Posted June 22, 2009 I've managed to make some modifications, and everything is fine. Thanks a lot Zultar! However, your code was slightly off and didn't work. I modified it to make it work, though. This is how it should be:```' Draw map nameIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_NONE Then Call DrawText(TexthDC, Int((20.5) * PIC_X / 2) - (Int(Len(Trim$(Map(GetPlayerMap(MyIndex)).Name)) / 2) * 8) + sx, 2 + sx, Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(BRIGHTRED)) frmMirage.imgnone.Visible = TrueElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_HOUSE Then Call DrawText(TexthDC, Int((20.5) * PIC_X / 2) - (Int(Len(Trim$(Map(GetPlayerMap(MyIndex)).Name)) / 2) * 8) + sx, 2 + sx, Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(YELLOW)) frmMirage.imgnone.Visible = FalseElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_SAFE Then Call DrawText(TexthDC, Int((20.5) * PIC_X / 2) - (Int(Len(Trim$(Map(GetPlayerMap(MyIndex)).Name)) / 2) * 8) + sx, 2 + sx, Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(WHITE)) frmMirage.imgnone.Visible = FalseElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_NO_PENALTY Then Call DrawText(TexthDC, Int((20.5) * PIC_X / 2) - (Int(Len(Trim$(Map(GetPlayerMap(MyIndex)).Name)) / 2) * 8) + sx, 2 + sx, Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(BLACK)) frmMirage.imgnone.Visible = FalseEnd If```Since I have the map name placed above my game screen, I no longer need to have all of that code there, so I'll show you my current code:```' Draw map nameIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_NONE Then frmMirage.imgnone.Visible = TrueElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_HOUSE Then frmMirage.imgnone.Visible = FalseElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_SAFE Then frmMirage.imgnone.Visible = FalseElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_NO_PENALTY Then frmMirage.imgnone.Visible = FalseEnd If```Anyway, thanks a lot for the help! Link to comment Share on other sites More sharing options...
dao Posted June 22, 2009 Share Posted June 22, 2009 ah alright no problem glad to help man Link to comment Share on other sites More sharing options...
Neth Posted July 23, 2009 Share Posted July 23, 2009 Hey when I tried this I keep getting the error.Run time error '401'Can't show non-modal form when modal form is displayed.know any reason why? Link to comment Share on other sites More sharing options...
Kimimaru Posted July 23, 2009 Author Share Posted July 23, 2009 Since I display the map name in a spot other than the game screen, you would use this code:```' Draw map nameIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_NONE Then Call DrawText(TexthDC, Int((20.5) * PIC_X / 2) - (Int(Len(Trim$(Map(GetPlayerMap(MyIndex)).Name)) / 2) * 8) + sx, 2 + sx, Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(BRIGHTRED)) frmMirage.imgnone.Visible = TrueElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_HOUSE Then Call DrawText(TexthDC, Int((20.5) * PIC_X / 2) - (Int(Len(Trim$(Map(GetPlayerMap(MyIndex)).Name)) / 2) * 8) + sx, 2 + sx, Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(YELLOW)) frmMirage.imgnone.Visible = FalseElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_SAFE Then Call DrawText(TexthDC, Int((20.5) * PIC_X / 2) - (Int(Len(Trim$(Map(GetPlayerMap(MyIndex)).Name)) / 2) * 8) + sx, 2 + sx, Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(WHITE)) frmMirage.imgnone.Visible = FalseElseIf Map(GetPlayerMap(MyIndex)).Moral = MAP_MORAL_NO_PENALTY Then Call DrawText(TexthDC, Int((20.5) * PIC_X / 2) - (Int(Len(Trim$(Map(GetPlayerMap(MyIndex)).Name)) / 2) * 8) + sx, 2 + sx, Trim$(Map(GetPlayerMap(MyIndex)).Name), QBColor(BLACK)) frmMirage.imgnone.Visible = FalseEnd If```Make sure that the image you pasted onto Visual Basic 6 has the name "imgnone." The name shouldn't contain the "." at the end. Also, make sure that you've placed your image within a Picture Box. For the best results, make sure the image takes up the whole Picture Box. Your image may need to have a background on it because the picture box is a box and cannot take a transparent background. You would need to know how to program in DirectX to create an image without a background.Please post here again if you have any other problems. Link to comment Share on other sites More sharing options...
Neth Posted July 23, 2009 Share Posted July 23, 2009 Didn't help the problem even if I removed to script and put back in the original.It occurs when I click properties in the map editor. Link to comment Share on other sites More sharing options...
Kimimaru Posted July 23, 2009 Author Share Posted July 23, 2009 Strange. Try downloading a fresh copy of frmMirage.frm. Then, copy the part in the original where it renders the map name and replace it with yours. This should hopefully prevent the error from occuring. Once we get the error to stop, we can continue with the code. Link to comment Share on other sites More sharing options...
Neth Posted July 23, 2009 Share Posted July 23, 2009 hmm, well It works on a fresh clean mirage. May be something conflicting within mine. I'll rebuild mine and see where the error lies. Doing an Alpha test of my game tomorrow so I'll have to do a new file so I can give the game out. Link to comment Share on other sites More sharing options...
Kimimaru Posted July 23, 2009 Author Share Posted July 23, 2009 Yeah, that may be the case. PM me if you need further assistance, I suppose. Link to comment Share on other sites More sharing options...
Neth Posted July 24, 2009 Share Posted July 24, 2009 Problem was something in the main.txt file. don't know what but glad it's gone. Link to comment Share on other sites More sharing options...
damian666 Posted July 24, 2009 Share Posted July 24, 2009 hmm… i think this is just a fix, this doesn't REALLY draw the image on the screen, its just a picbox right?we should take a look to really draw it on there using DX.i am gonna take a look.Damian666 Link to comment Share on other sites More sharing options...
Kimimaru Posted July 24, 2009 Author Share Posted July 24, 2009 I know, but this is a solution for people like me who don't know how to program in DirectX. It works pretty well. Of course, I would much rather have it draw the image onto the screen as well. 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