Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Mikekan13

Members
  • Posts

    406
  • Joined

  • Last visited

    Never

Everything posted by Mikekan13

  1. Easy peasy nice and cheesy! Thanks Robin for de-complicating my mess :)
  2. I know the difference. ByRef will actually change the variable passed to the function. I don't ever use them much though and the structure–as you said--is different than what I am accustomed to. ok help me out a little more. So I call my word wrap and I send it an unformed string, how many characters before it breaks the line, and a placeholder for the converted string. Then the function runs through and puts each line of converted text into an array position of the ReturnedString? Is that the gist of it?
  3. why does the function return a boolean? Edit: So the ReturnString() is an array of converted lines? Then you pass the lines to your RenderText with a for loop? The function is actually changing the dynamic array but why does it return a boolean? couldn't it just be a sub? Confused on how that is set up.
  4. > Function WordWrap(ByVal PassedString as string, ByVal MaxCharsPerLine as long, ByRef ReturnString() as string) as boolean What is that? > I'm too baked to read your code at the moment and you haven't posted the function structure in the first place, so yeah. > > Basically it's just a case of referencing a string array and passing through the lines to that, rather than using line breaks. here is the entire render text function. I didn't post it all because it is so long. Maybe you could take a look when you aren't stoned. Is the function you referenced handle individual word wrapping or does it just wrap at the character length? Call for the speech bubble ``` RenderText Trim$(Chat.strMsg), x + Width / 2, y - 35, r, g, b, a, 300, 1, 14, True, True ``` text rendering ``` Public Sub RenderText(strText As String, left As Long, top As Long, _ Optional r As Integer = 255, Optional g As Integer = 255, _ Optional b As Integer = 255, Optional a As Integer = 255, _ Optional boxWidth As Long, Optional fntNum As Byte = 2, _ Optional fntSize As Byte = 16, Optional center As Boolean = False, _ Optional bottom As Boolean = False) Dim i As Long, n As Long '//Loop variable Dim CharX As Integer, CharY As Integer '//Grid coordinates for our character 0-15 and 0-7 Dim Char As String '//The current Character in the string Dim LinearEntry As Long Dim LineNum, ColumnNum As Long Dim str1 As String, str2() As String, Count As Long, wrapAt As Long Dim lines As Long If Len(strText) = 0 Then Exit Sub If boxWidth = 0 Then boxWidth = Options.ScreenWidth - left If center = True Then If left - (Len(strText) * (fntSize - fntSize \ 3)) / 2 < left - boxWidth / 2 Then left = left - boxWidth \ 2 Else left = left - (Len(strText) * (fntSize - fntSize \ 3)) / 2 End If End If ' Word wrapping wrapAt = boxWidth \ (fntSize - fntSize \ 3) str2 = Split(strText) For i = LBound(str2) To UBound(str2) Count = Count + Len(str2(i)) + 1 ' total characters in current line ' if word is bigger than wrapat then it needs to be spliced onto multiple lines If Len(str2(i)) + 1 > wrapAt + 1 Then For n = 0 To (((Len(str1)) Mod (wrapAt + 1)) + Len(str2(i)) + 1) \ (wrapAt + 1) str2(i) = Mid$(str2(i), 1, n * (wrapAt + 2)) & vbCrLf & Right$(str2(i), Count - n * (wrapAt + 1)) ' splice line lines = lines + 1 ' advance line count Next Count = ((Len(str2(i)) + 1) Mod (wrapAt + 1)) ' set count to where the word got spliced str1 = str1 & str2(i) & " " ' add word to string Else ' wrap word to next line if it falls over wrapat If Count > wrapAt + 1 Then str1 = str1 & vbCrLf & str2(i) & " " ' add word to string with a line break Count = Len(str2(i)) + 1 ' reset count and add the length of current word lines = lines + 1 ' advance line count Else str1 = str1 & str2(i) & " " ' add word to string End If End If Next i strText = Trim$(str1) If bottom = True Then top = top - lines * fntSize End If For i = 1 To Len(strText) '//Loop through each character '//1\. Choose the Texture Coordinates 'To do this we just need to isolate which entry in the texture we 'need to use - the Vertex creation code sorts out the ACTUAL texture coordinates Char = Mid$(strText, i, 1) '//Get the current character LinearEntry = Asc(Char) 'We now need to process the actual coordinates. If LinearEntry = 16 And LinearEntry = 32 And LinearEntry = 48 And LinearEntry = 64 And LinearEntry = 80 And LinearEntry = 96 And LinearEntry = 112 And LinearEntry = 128 And LinearEntry = 144 And LinearEntry = 160 And LinearEntry = 176 And LinearEntry = 192 And LinearEntry = 208 And LinearEntry = 224 And LinearEntry = 240 And LinearEntry
  5. So I am working on speech bubbles for my game and I am trying to make the text wrap so that it always stays within a certain box area. Basically exactly how Crystalshire does it. I have been working on a text wrapping code for 2 days now and it is really starting to pee me off. The text wraps fine if you are typing like a normal person but as soon as you have really long words, things start to get ducked up. If anyone could help–most likely Robin--then I would be ecstatic. ``` ' Word wrapping wrapAt = boxWidth \ (fntSize - fntSize \ 3) ' wrapAt is characters allowed per line str2 = Split(strText) ' Separate string into individual words For i = LBound(str2) To UBound(str2) Count = Count + Len(str2(i)) + 1 ' total characters in current line ' if word is bigger than wrapat then it needs to be spliced onto multiple lines If Len(str2(i)) + 1 > wrapAt + 1 Then For n = 0 To (((Len(str1)) Mod (wrapAt + 1)) + Len(str2(i)) + 1) \ (wrapAt + 1) str2(i) = Mid$(str2(i), 1, n * (wrapAt + 2)) & vbCrLf & _ Right$(str2(i), Count - n * (wrapAt + 1)) ' splice line lines = lines + 1 ' advance line count Next Count = ((Len(str2(i)) + 1) Mod (wrapAt + 1)) ' set count to where the word got spliced str1 = str1 & str2(i) & " " ' add word to string Else ' wrap word to next line if it falls over wrapat If Count > wrapAt + 1 Then str1 = str1 & vbCrLf & str2(i) & " " ' add word to string with a line break Count = Len(str2(i)) + 1 ' reset count and add the length of current word lines = lines + 1 ' advance line count Else str1 = str1 & str2(i) & " " ' add word to string End If End If Next i ``` Please Help!
  6. > May I sign up for the pre-alpha? Please read the first post for details about sign up.
  7. Ok bug is gone! Yay! Just added jumping too. Need to clean it up and I think I am going to sort of merge jumping and climbing together a bit. Sort of like jump up a cliff then grab on and then jump up a bit more till you get to the top. Once that is done I need to work on a few packets for when a player leaves or enters your range and then I should be ready to let you guys break it :)
  8. > Emiliano also went a little further in providing the code necessary to make a Control. So Emiliano's would be the best one to use if I wanted to slam it into Eo. Also how far along are you on yours?
  9. > You will notice a performance improvement with either of them when you substitute in an existing application. Any reason to not use one of them? One better than the other?
  10. > dim tmr500 as long > if tmr500 < GetTickCount then > ' code here > tmr500 = GetTickCount + 500 > end if To be fair to Robin, that code does work. It just wasn't exactly what you were trying to do.
  11. the reason tmr500 is going off immediately is because it is set to 0 unless you say other wise so gettickcount is going to always be larger than it. try something like this. Initilize the tmr with the current tick + whatever time you want. Granted it seems you are trying to do a sort of one shot timer so there is no need to put it into the main game loop ``` Dim tmr500 as long tmr500 = GetTickCount + 5000 ' 5000 is about 5 seconds '-GAME LOOP STARTS HERE- Do While InGame If tmr500 < GetTickCount Then Call PlayerMsg(index, "timer done", Green) tmr500 = GetTickCount + 5000 End If 'other codey bits loop ```
  12. > Looking amazing! > This game looks awesome :D I would for sure like to test it > Those screenies are amazing. Thanks for the praise. I need it right now :P The big bad bug isn't totally gone as if you change a layer and fall at the same time it rears its ugly head again. basically the server is sending the new cells to the client but the client has already moved either down a layer or back to its old cell or to a corner cell close to it. It is a lot of checking to see where the client is and where he was and sorting each block to where it needs to go. Gets very confusing when you trow in a 3rd dimension. Hopefully by tomorrow I will have it completely fixed and the world streaming will be 100% bug free. Then I can get back on track and get something for you guys to mess with.
  13. > -.-' god thats just racist you know… > well i spend more time sleeping than watching CNN... > and whats wrong with shortening a few words? > the meaning is still the same -.- > doesn`t mean i`m just 13 i`m dumb O.O I am normally not a violent person, but this made me want to punch you.
  14. > I'll play. Keepin it real in TN. Represent! :P Ok here is the cutaway I was mentioning in my last post. outside, inside, behind.
  15. Well the good news is I think I have killed the bug of doom as I was calling it. I have to still test everything with the climbing engine re enabled but I think it is dead. I have a handful of smaller bugs to stomp and for some reason I can't get my warp hacking check to work right. In the process of killing the bug I re-wrote my movement packets and some of my server-client sync. I am rather proud of it. I am by no means a great or even good programmer but the server and client sync is really good; I tested it from a few different computers/connections and no matter the fps or ping the server and clients tick counter stay in a perfect sync. A couple things are bothering me right now. The first is over-complicating the controls. Currently I have the 4 movement keys, run key, attack key, guard key. I currently handle climbing based on simply location–if you are near a wall and continue to walk into it then the character starts to climb up the wall. I am not quite satisfied with this and I am hesitant to add another button for climbing as I will probably need one for jumping and some other things. The second concern is with the way I cut away blocks so you can see behind them. I can't think of a practical and good looking way of doing this. Currently I make any blocks--within a small range--on the same level as you transparent and any blocks higher than you disappear completely. It is functional but I don't really like the way it looks. I would love to have it just cutaway everything when you are in an enclosed area and when you are outside of one it would just make the walls semi transparent and anything within would not be shown. I have no Idea how this could be programed though since you can build in any way. You could have an "enclosure" within an "enclosure". I might drop a couple screenshots to show how the current cutaway system works. Just wanted to get some feedbacks and different ideas on these two things.
  16. Ran into a few more bugs, and a bug I have been ignoring has finally come to bite me in the ass: > -If player moves quickly back and forth between cells then shit gets ducked up I really wish I was ready for the pre-alpha but I am going to have to redo a lot of stuff. Might be longer than expected but I swear I will give you guys something by the mid of this month–bugs or no bugs. One good thing is I cleaned up my rendering a lot and managed to get back up to 40+ fps on my computer. I have also stopped messing with shadows for now and I will probably leave them out for the pre-alpha. Main focus is that bug and I have looked quite hard for it. I am going to rewrite the packets for movement tomorrow as they are messy and might be the issue.
  17. > It depends on your bandwith, not on pc specs, like Robin already said thousand times. depends on both
  18. Doesn't look like I am going to hit the deadline for the pre-alpha. Probably going to be another week or so. I know it sucks. Here is my list of things I have left straight from my development text file: Before Pre Alpha –----------------------------------------------------------------------------------- Moving up/down layers: -Change climb collision -Ceiling collision -Server validation of layer change and collisions Block building: -Check for other player and block collision before building -Server confirmation of valid build and send to other clients -Check for left or right click when building -Building fail msg at buildack -Destroy block**** right click to destroy for now? Rendering: -Optimize rendering(only render blocks that are viewable) -Shadows -- all sorts of fucked up -Optimize Dx8 texture loading and unloading -Redo movement smoothing Misc: -Exit Option for fullscreen (just press esc to close for now) -change range function to work with any position instead of just player Bugs: -If player moves quickly back and forth between cells then shit gets fucked up -Server warp hack check not working -Player facing gets messed up sometimes I would also like to have at least 7 or so different tiles so it isn't all the same looking. Most of the code is simple stuff. Only big thing is the rendering optimize. Probably a night or two for that maybe 3 nights for everything else and a night for some graphics.
  19. > i study drawing all by myself i used some books for basics but i just don't like learn drawing or painting from books > soon i will ad new work i have some shading to do ;] I agree with you there. I think formal training can in a lot of ways remove certain characteristics from an artist. I am self taught as well.
  20. The female figure is always fun to draw! I mean who doesn't like boobs. That does look like a heart nipple :P. Couple critiques: The face doesn't seem to have enough depth in the eye and forehead area. Also The hair looks dry to me. Other than that, not a bad little sketch. > Maybe throw some carpet down there for realism. Shaved/Wax is realistic too, and more appealing in my imho
  21. None to the amount of success I think you are talking about. I was just giving a general statement about indie developers. They are almost always 1 or 2 man teams.
  22. Mikekan13

    Thank You

    > 2 minutes to load Please tell me that is an exaggeration. Does 56k still exist? Yes it is obviously not optimized for the web but it took me less than 2 seconds to load the entire site.
  23. > n the mean wile i realised that everyone wants there own games and they end up by failing it and i was wondering if there will be a day when they get united and make a real game with an real team… Actually most successful indie developers are single guys or a very small team of maybe 2 or 3.
×
×
  • Create New...