DarkDino Posted May 29, 2015 Share Posted May 29, 2015 Make this little changes to optimize :3:``` 'write name & level & hp   For i = 1 To Npc_HighIndexif mapNpc(i).num > 0 And Not myTarget > Npc_HighIndex Then    If MapNpc(myTarget).num = mapNpc(i).num Then        RenderText Font_Default, NPC(MapNpc(myTarget).num).Name, x + 10, y + 4, Yellow        RenderText Font_Default, MapNpc(myTarget).Vital(HP) & "/" & NPC(MapNpc(myTarget).num).HP, x + 55, y + 15, Red        RenderText Font_Default, NPC(MapNpc(myTarget).num).Level, x + 150, y + 4, Yellow        Exit For ' Leave the sub when this drawed       End If     End if  Next``` Link to comment Share on other sites More sharing options...
Growlith1223 Posted May 29, 2015 Share Posted May 29, 2015 @'DarkDino':> Make this little changes to optimize :3:> > ```> 'write name & level & hp>    For i = 1 To Npc_HighIndex> if mapNpc(i).num > 0 And Not myTarget > Npc_HighIndex Then>     If MapNpc(myTarget).num = mapNpc(i).num Then>         RenderText Font_Default, NPC(MapNpc(myTarget).num).Name, x + 10, y + 4, Yellow>         RenderText Font_Default, MapNpc(myTarget).Vital(HP) & "/" & NPC(MapNpc(myTarget).num).HP, x + 55, y + 15, Red>         RenderText Font_Default, NPC(MapNpc(myTarget).num).Level, x + 150, y + 4, Yellow>         Exit For ' Leave the sub when this drawed>        End If>      End if>   Next> > ```You don't need the for loop lol, it's already rendering to myTarget and it's already checking before the sub is even being called lol, just a waste of cpu power Link to comment Share on other sites More sharing options...
DarkDino Posted May 29, 2015 Share Posted May 29, 2015 @'Growlith1223':> You don't need the for loop lol, it's already rendering to myTarget and it's already checking before the sub is even being called lol, just a waste of cpu powerSure haha, I thought that this showed the details of several NPCs i don't law all code:``` if myTarget > 0 And Not NPC(MapNpc(myTarget).num).Name = "" then RenderText Font_Default, NPC(MapNpc(myTarget).num).Name, x + 10, y + 4, Yellow RenderText Font_Default, MapNpc(myTarget).Vital(HP) & "/" & NPC(MapNpc(myTarget).num).HP, x + 55, y + 15, Red RenderText Font_Default, NPC(MapNpc(myTarget).num).Level, x + 150, y + 4, Yellow End If``` Link to comment Share on other sites More sharing options...
Alerd Posted June 1, 2015 Share Posted June 1, 2015 Good? or not?``` 'write name & level & hp For i = 1 To Npc_HighIndex If myTarget > 0 And Not NPC(MapNpc(myTarget).num).name = "" Then RenderText Font_Default, NPC(MapNpc(myTarget).num).name, x + 10, y + 4, Yellow RenderText Font_Default, MapNpc(myTarget).Vital(HP) & "/" & NPC(MapNpc(myTarget).num).HP, x + 55, y + 15, Red RenderText Font_Default, NPC(MapNpc(myTarget).num).Level, x + 150, y + 4, Yellow End If Next``` Link to comment Share on other sites More sharing options...
Kizzaa Posted June 1, 2015 Share Posted June 1, 2015 @'adiif1':> Good? or not?> > ```>   'write name & level & hp>    For i = 1 To Npc_HighIndex>     If myTarget > 0 And Not NPC(MapNpc(myTarget).num).name = "" Then>         RenderText Font_Default, NPC(MapNpc(myTarget).num).name, x + 10, y + 4, Yellow>         RenderText Font_Default, MapNpc(myTarget).Vital(HP) & "/" & NPC(MapNpc(myTarget).num).HP, x + 55, y + 15, Red>         RenderText Font_Default, NPC(MapNpc(myTarget).num).Level, x + 150, y + 4, Yellow>     End If>   Next> ```There is no need for the For loop. Link to comment Share on other sites More sharing options...
DarkDino Posted June 1, 2015 Share Posted June 1, 2015 @'adiif1':> Good? or not?> > ```> 'write name & level & hp> For i = 1 To Npc_HighIndex> If myTarget > 0 And Not NPC(MapNpc(myTarget).num).name = "" Then> RenderText Font_Default, NPC(MapNpc(myTarget).num).name, x + 10, y + 4, Yellow> RenderText Font_Default, MapNpc(myTarget).Vital(HP) & "/" & NPC(MapNpc(myTarget).num).HP, x + 55, y + 15, Red> RenderText Font_Default, NPC(MapNpc(myTarget).num).Level, x + 150, y + 4, Yellow> End If> Next> ```@Adiif do you need change this to that code:```if myTarget > 0 And Not NPC(MapNpc(myTarget).num).Name = "" then RenderText Font_Default, NPC(MapNpc(myTarget).num).Name, x + 10, y + 4, Yellow RenderText Font_Default, MapNpc(myTarget).Vital(HP) & "/" & NPC(MapNpc(myTarget).num).HP, x + 55, y + 15, Red RenderText Font_Default, NPC(MapNpc(myTarget).num).Level, x + 150, y + 4, YellowEnd If``` Link to comment Share on other sites More sharing options...
Kaymak Posted June 15, 2015 Author Share Posted June 15, 2015 i have updated the thread and changed the whole sub, to make it easier to handle for the server.```npcNum = MapNpc(myTarget).Num ' exists? If npcNum > 0 Then Name = Trim$(NPC(npcNum).Name) HpBar = Trim$(MapNpc(npcNum).Vital(HP)) ' show the information RenderText Font_Default, Name, x + 10, y + 4, Yellow RenderText Font_Default, MapNpc(myTarget).Vital(HP) & "/" & NPC(MapNpc(myTarget).Num).HP, x + 66, y + 15, Yellow RenderText Font_Default, NPC(npcNum).Level, x + 150, y + 4, Yellow End If``` Link to comment Share on other sites More sharing options...
Daneta Posted August 20, 2015 Share Posted August 20, 2015 Hey, So When I click an npc, I get error 9 sub script out of range in "GameLoop" "ModGameLogic" .. no idea why XD Link to comment Share on other sites More sharing options...
Joyce Posted August 21, 2015 Share Posted August 21, 2015 Unless you tell us where it breaks exactly (e.g. the line) and which sub you'll have a hard time finding someone that can offer a solution. Link to comment Share on other sites More sharing options...
Daneta Posted August 21, 2015 Share Posted August 21, 2015 i have a post if you wanna go see it lol Link to comment Share on other sites More sharing options...
iLeGiTiMx Posted November 8, 2015 Share Posted November 8, 2015 Hello.. Can someone tell me what exactly what**Tex_GUI(24)**in```RenderTexture Tex_GUI(24), x, y, 0, 0, Width, Height, Width, Height```is?I always get this error when i click a npc:![](http://i.imgur.com/t1RtiBt.png)Without this line i see the details but not the gui for this.I created the Texture like this:```Public Tex_GUI As DX8TextureRec``````Private Sub LoadTextures()  NumTextures = NumTextures + 12  ReDim Preserve gTexture(NumTextures)  Tex_Shadow.filepath = App.Path & "\Pack\grafik\misc\shadow.png"  Tex_Shadow.Texture = NumTextures - 11  LoadTexture Tex_Shadow  Tex_Fade.filepath = App.Path & "\Pack\grafik\misc\fader.png"  Tex_Fade.Texture = NumTextures - 10  LoadTexture Tex_Fade  Tex_ChatBubble.filepath = App.Path & "\Pack\grafik\misc\chatbubble.png"  Tex_ChatBubble.Texture = NumTextures - 9  LoadTexture Tex_ChatBubble  Tex_Weather.filepath = App.Path & "\Pack\grafik\misc\weather.png"  Tex_Weather.Texture = NumTextures - 8  LoadTexture Tex_Weather  Tex_White.filepath = App.Path & "\Pack\grafik\misc\white.png"  Tex_White.Texture = NumTextures - 7  LoadTexture Tex_White  Tex_Door.filepath = App.Path & "\Pack\grafik\misc\door.png"  Tex_Door.Texture = NumTextures - 6  LoadTexture Tex_Door  Tex_Direction.filepath = App.Path & "\Pack\grafik\misc\direction.png"  Tex_Direction.Texture = NumTextures - 5  LoadTexture Tex_Direction  Tex_Target.filepath = App.Path & "\Pack\grafik\misc\target.png"  Tex_Target.Texture = NumTextures - 4  LoadTexture Tex_Target  Tex_Misc.filepath = App.Path & "\Pack\grafik\misc\misc.png"  Tex_Misc.Texture = NumTextures - 3  LoadTexture Tex_Misc  Tex_Blood.filepath = App.Path & "\Pack\grafik\misc\blood.png"  Tex_Blood.Texture = NumTextures - 2  LoadTexture Tex_Blood  Tex_Bars.filepath = App.Path & "\Pack\grafik\misc\bars.png"  Tex_Bars.Texture = NumTextures - 1  LoadTexture Tex_Bars   Tex_Selection.filepath = App.Path & "\Pack\grafik\misc\select.png"  Tex_Selection.Texture = NumTextures  LoadTexture Tex_Selection Tex_GUI.filepath = App.Path & "\Pack\grafik\misc\select.png"   Tex_GUI.Texture = NumTextures   LoadTexture Tex_GUIEnd Sub```Whats wrong?Thank you :) Link to comment Share on other sites More sharing options...
Growlith1223 Posted November 8, 2015 Share Posted November 8, 2015 Tex_GUI is not an array. from what you have said. Link to comment Share on other sites More sharing options...
iLeGiTiMx Posted November 9, 2015 Share Posted November 9, 2015 @'Growlith1223':> Tex_GUI is not an array. from what you have said.Yeah i took the (24) away and got no error then. But i didn't see the picture then.. Link to comment Share on other sites More sharing options...
BeNjO Posted November 9, 2015 Share Posted November 9, 2015 pm me your whole rendering mod, modgraphics or modrendering. Link to comment Share on other sites More sharing options...
BeNjO Posted November 9, 2015 Share Posted November 9, 2015 RenderTexture Tex_Target, x, y, 0, 0, Width, Height, Width, Height Link to comment Share on other sites More sharing options...
iLeGiTiMx Posted November 9, 2015 Share Posted November 9, 2015 And what if i want to use another texture than the Tex_Target? :) Link to comment Share on other sites More sharing options...
BeNjO Posted November 9, 2015 Share Posted November 9, 2015 you change the picture that you set…``` Tex_Target.filepath = App.Path & "\Pack\grafik\misc\target.png"``` Link to comment Share on other sites More sharing options...
iLeGiTiMx Posted November 9, 2015 Share Posted November 9, 2015 Yeah i know this, but i created a new because the Targetpicture should be target, and this here should be detail.png.Tried this:  Tex_GUI.filepath = App.Path & "\Pack\grafik\misc\select.png"  Tex_GUI.Texture = NumTextures  LoadTexture Tex_GUIBut this doesn´t work.I think its because the array(?). The numbers from 12 to 0:```NumTextures = NumTextures + 12  ReDim Preserve gTexture(NumTextures)  Tex_Shadow.filepath = App.Path & "\Pack\grafik\misc\shadow.png"  Tex_Shadow.Texture = NumTextures - 11  LoadTexture Tex_Shadow  Tex_Fade.filepath = App.Path & "\Pack\grafik\misc\fader.png"  Tex_Fade.Texture = NumTextures - 10  LoadTexture Tex_Fade  Tex_ChatBubble.filepath = App.Path & "\Pack\grafik\misc\chatbubble.png"  Tex_ChatBubble.Texture = NumTextures - 9  LoadTexture Tex_ChatBubble  Tex_Weather.filepath = App.Path & "\Pack\grafik\misc\weather.png"  Tex_Weather.Texture = NumTextures - 8  LoadTexture Tex_Weather  Tex_White.filepath = App.Path & "\Pack\grafik\misc\white.png"  Tex_White.Texture = NumTextures - 7  LoadTexture Tex_White  Tex_Door.filepath = App.Path & "\Pack\grafik\misc\door.png"  Tex_Door.Texture = NumTextures - 6  LoadTexture Tex_Door  Tex_Direction.filepath = App.Path & "\Pack\grafik\misc\direction.png"  Tex_Direction.Texture = NumTextures - 5  LoadTexture Tex_Direction  Tex_Target.filepath = App.Path & "\Pack\grafik\misc\target.png"  Tex_Target.Texture = NumTextures - 4  LoadTexture Tex_Target  Tex_Misc.filepath = App.Path & "\Pack\grafik\misc\misc.png"  Tex_Misc.Texture = NumTextures - 3  LoadTexture Tex_Misc  Tex_Blood.filepath = App.Path & "\Pack\grafik\misc\blood.png"  Tex_Blood.Texture = NumTextures - 2  LoadTexture Tex_Blood  Tex_Bars.filepath = App.Path & "\Pack\grafik\misc\bars.png"  Tex_Bars.Texture = NumTextures - 1  LoadTexture Tex_Bars   Tex_Selection.filepath = App.Path & "\Pack\grafik\misc\select.png"  Tex_Selection.Texture = NumTextures  LoadTexture Tex_Selection  Tex_GUI.filepath = App.Path & "\Pack\grafik\misc\select.png"  Tex_GUI.Texture = NumTextures  LoadTexture Tex_GUI```Can i change 12 to 13 and set Tex_Selection to -1 then ?Also with```RenderTexture Tex_Target, x, y, 0, 0, Width, Height, Width, Height```i can´t see the image :D Link to comment Share on other sites More sharing options...
BeNjO Posted November 9, 2015 Share Posted November 9, 2015 why are you adding it in the tex_ anyway, remove what you added, add the gui picture in with the other gui (inventory ect) and render its number like before (#) Link to comment Share on other sites More sharing options...
iLeGiTiMx Posted November 9, 2015 Share Posted November 9, 2015 Okay i deleted anything except```Public Sub DrawTargetDetails()Dim I As Long, X As Long, Y As Long, npcNum As LongDim Width As Long, Height As Long, SpriteNum As LongDim MapNpcNum As LongDim Name As StringDim HpBar As String ' render the window Width = 256 Height = 64 ' render the window on screen X = 300 Y = 64 ' render the details RenderTexture Tex_GUI(24), X, Y, 0, 0, Width, Height, Width, Height npcNum = MapNpc(myTarget).num ' exists? If npcNum > 0 Then Name = Trim$(NPC(npcNum).Name) HpBar = Trim$(MapNpc(npcNum).Vital(HP)) ' show the information RenderText Font_Default, Name, X + 10, Y + 4, Yellow RenderText Font_Default, MapNpc(myTarget).Vital(HP) & "/" & NPC(MapNpc(myTarget).num).HP, X + 66, Y + 15, Yellow RenderText Font_Default, NPC(npcNum).Level, X + 150, Y + 4, Yellow End IfEnd Sub``````Tex_GUI(24)```24 is the Texture number right?So where do i need to declare it? :cSorry.. Link to comment Share on other sites More sharing options...
BeNjO Posted November 9, 2015 Share Posted November 9, 2015 Do the tutorial, but dont add the tex stuff, just add it to the gui folder and rename it so its the last number aka 1 2 3 4 and you new one is 5, then use the RenderTexture Tex_GUI(NEW NUMBER HERE)Should work :) Link to comment Share on other sites More sharing options...
iLeGiTiMx Posted November 9, 2015 Share Posted November 9, 2015 Did it.. finally :)![](http://i.imgur.com/I3EcH4p.png) Link to comment Share on other sites More sharing options...
Miharukun Posted November 10, 2015 Share Posted November 10, 2015 The link for picture is broken :( anyone can upload the new one? Link to comment Share on other sites More sharing options...
BeNjO Posted November 10, 2015 Share Posted November 10, 2015 Pull the information from the tutorial it self, its height and width are clearly in the code and you could just steal the image from the screen shot, Combine the two and you have a picture. Your best of creating your own as the image he provided may not be for public use. Link to comment Share on other sites More sharing options...
Miharukun Posted November 10, 2015 Share Posted November 10, 2015 I just need it for example ._. I just crop the image from screenshot and the size is diff :(Uhh Nvm i did it! xD http://s28.postimg.org/gmjg2tjm5/vb6_2015_11_10_21_00_06_232.jpg 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