1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Anyone Here Do VB?

Discussion in 'Off Topic' started by The Twiggman, Aug 27, 2003.

  1. The Twiggman

    The Twiggman Instagib 4 Life

    Joined:
    Feb 7, 2002
    Messages:
    647
    Likes Received:
    0
    Im just wondering if any of you do any Visual Basic programming in your spare time. Im a little stuck, but I've yet to find an answer on alot of the sites.

    How to read and write treeviews?

    You see im building a web browser, no apparent reason, just for style and speed. So far I got the built in media player so you can surf and listen to tunes, has favorites, sourcecode downloader (.txt and .html) and a popup blocker. Not too bad.

    So I just started coding up the treeview so it builds itself as you search sites just like the history does. But when its time to save, ya, lol its nearly impossible to load it back in due to the branches in the keys needed to form the tree.

    Other than that umm, I was going to put in its own searching tool to parse a pile of search engines for a keyword, or whatnot just to give it more flexibility.

    EDIT # 2
    =======
    Oh ya if your intrested in an animated picture of what it looks like, click "My Website" in my sig.
     
    Last edited: Aug 27, 2003
  2. Syri

    Syri Who are you calling short?

    Joined:
    Aug 18, 2000
    Messages:
    4,617
    Likes Received:
    16
    hm, i've played a little with the treeview, i'll see if i've got any stuff lying around that may help
     
  3. FireSlash

    FireSlash Whats a FireSlash?

    Joined:
    Feb 3, 2001
    Messages:
    4,300
    Likes Received:
    0
    I did some projects. My most nutty was an RTS using Direct Draw (Bitblt was too slow, and lacked the ROPs for what I wanted to do)

    I can post some screenies, but its not much to look at. I never developed a real tileset for it (In fact, I just used my wallpaper :eek:), and the buildings and such were all ripped from TA... movement code (sorta) works, but lacks pathing abilities, etc.

    In short, I dropped it right around when i realized VB was too goddamn slow to do anything fun in ;)
     
  4. The Twiggman

    The Twiggman Instagib 4 Life

    Joined:
    Feb 7, 2002
    Messages:
    647
    Likes Received:
    0
    Thanks D-Stroya. BTW 3300 post dude cheers!

    Exactly, you can build things but its not dynamic enough. I wanted to get into bitblt but only got as far as a cruddy screensaver. Hehe, whatever its better than nothing, and if your creative then there ya go.
     
  5. The Twiggman

    The Twiggman Instagib 4 Life

    Joined:
    Feb 7, 2002
    Messages:
    647
    Likes Received:
    0
    As for games wise, I've done a few games in my time.

    VB Dope Wars, that was quite intresting, it eventually got right unstable as I put so much into it. It was mint though, it was real time, like the prices for drugs were changing all the time, just had to buy and sell and not be busted at the wrong time. But you could also buy rocket launchers to shoot the cops with. The game was nuts.

    I tried to build a top down game like "Total Carnage" for SNES. I had it working with guns and collision detection, but I couldn't figure out how you would really move around farther than the screen so I just turned it into a game where you have enemys moving towards you from all sides and you have to shoot them. Every minute they move faster.

    Then recently I just started making a game like everwars style. Like an rpg text bases fighting game, not that bad but it had some style to it. I called it "Ghetto Wars" because you fight with guns, knives, chains and bats. Toss on a backwards hat and get an extra 2 armour points. The battle engine was neat though. For every round it takes to fight and defeat the opposing player the fight jackpot would go up by $5, so if it takes like 10 rounds to defeat the player then someone wins $50 bucks and the other player loses $50 bucks.
     
  6. FireSlash

    FireSlash Whats a FireSlash?

    Joined:
    Feb 3, 2001
    Messages:
    4,300
    Likes Received:
    0
    Moving the screen tiles takes a bit of thinking. I just put them in a matrix, and moved the tiles in relation to the absolute and partial positions of the character. (Round to a tile, get the tiles we need, and draw them with an offset relational to the offset from the character to the tile you rounded off too.

    I think I have some sample code here somewheres...
     
  7. The Twiggman

    The Twiggman Instagib 4 Life

    Joined:
    Feb 7, 2002
    Messages:
    647
    Likes Received:
    0
    Smart thinking. I should have just looked for a sample instead of just trying to figure it out myself. But I like to be independant on this stuff.

    Hmm, im going to go figure out this read/write treeview stuff. Im sure I can figure out a way to write to an ini and call it all back. If I got any success then I'll post the code here and at PSC just because I've yet to see anything done.
     
  8. The Twiggman

    The Twiggman Instagib 4 Life

    Joined:
    Feb 7, 2002
    Messages:
    647
    Likes Received:
    0
    Holy Jeeze, Mind Numbing Stuff

    Well this will work reads and writes just fine for what I need. A little bit sloppy and makes the folders look pretty jumbled up, but hey, either that or nothing. Lol.

    Code:
    'Read And Write Treeviews, A Little Demo For Use For Web Browser History
    'Still A Bit Buggy, But Nothing Half As Bad As It Was 10 Minutes Ago
    'All you need is a folder named Cache within the directory of the programhttp://forums.beyondunreal.com/editpost.php?do=editpost&p=1196128
    
    'By Twiggy
    
    'Define Variables
    Dim a As Integer
    Dim z As Integer
    
    'Each click saves the special number to a cache folder
    'Also saves two files per address, one with date, one with time
    
    Private Sub Command1_Click()
    'Adding One To Special Number
    a = a + 1
    Label2 = a
    
    'Saving Special Number
    Open App.Path & "\Cache\a.ini" For Output As #2
    Print #2, a
    Close #2
    
    'Adding Node Displaying Site Under The Date
    TV1.Nodes.Add "Date" & Date, tvwChild, a & "Site", Text1
    
    'Saving The Two Files For The Address
    Open App.Path & "\Cache\t" & a For Output As #2
    Print #2, Text1
    Close #2
    
    Open App.Path & "\Cache\d" & a For Output As #2
    Print #2, Date
    Close #2
    
    End Sub
    
    Private Sub Form_Load()
    
    'When The Program Loads It Creates A New Parent Node For Todays Date
    TV1.Nodes.Add , , "Date" & Date, Date
    
    'Loads In The Special Number
    Open App.Path & "\Cache\a.ini" For Input As #1
    Input #1, x
    a = x
    Label2 = a
    Close #1
    
    'A Loop To Load In The Previous History From 1 to The Speical Number
    'See where it comes into play
    
    For p = 1 To Label2
    Open App.Path & "\Cache\t" & p For Input As #1
    Open App.Path & "\Cache\d" & p For Input As #2
    Input #1, t
    Input #2, D
    t1 = t
    d1 = D
    TV1.Nodes.Add "Date" & Date, tvwChild, p & "Site", t1
    Close #1
    Close #2
    Next p
    
    End Sub
    
    'When You Click The History Item, It Will Appear In A Text Box Below
    Private Sub TV1_NodeClick(ByVal Node As MSComctlLib.Node)
    Text1 = TV1.SelectedItem.Text
    End Sub
    
    Make not I didn't use d1 yet, it gives me missing element, so until I figure that bit out, im stuck with it always showing todays date instead of a new big date everytime, no big deal. Its only a number. Lol I should have just used a listbox in the first place. :p
     
    Last edited: Aug 28, 2003

Share This Page