Register
Email: Password:
Forum » Sorced Combat (Almost Alpha!)
  • « previous
  • 1
  • 2
  • » next
  • Sorced Combat (Almost Alpha!)

    E_net4 16 years ago
    Simple as this:

    I created a test script with 3 procedures. One of them is the RGB_field, which draws those 3 different circles around each player. By adding these to the game loop (with the function "add_to_loop"), these circles are drawn every frame.
    You'll find exec.txt in the scripts folder. This one must be used for initializing stuff, as it's the only script that is run at the start. Then, one can make the game load any other script in the scripts folder, by using the exec function.
    You might want to check the readme file.
    #
    Amarth 16 years ago
    This script thingy is interesting... Very interesting, even...
    #
    E_net4 16 years ago
    Yes, but there are many things to be done, such as defining the players' properties. However, it is now possible to make a tic tac toe script.
    ...*Goes script*
    #
    MageKing17 16 years ago
    Now add a bit to the exec script that runs every script in a specific folder, e.g. "autorun". That way people can add autorunning scripts without editing the exec script every time.
    #
    Amarth 16 years ago
    "MageKing17" said:
    Now add a bit to the exec script that runs every script in a specific folder, e.g. "autorun". That way people can add autorunning scripts without editing the exec script every time.
    Put this in your exec.txt:
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.getFolder("Scripts")
    Set fc = f.Files
    For Each f1 in fc
    s = f1.name
    if Right(s,4) = ".bas" then
    s2 = Left(s, Len(s) - 4)
    form.exec(s2 & "")
    end if
    Next

    Modify the getFolder thingy if you want a different folder. Feel free to improve on this script, my vbscript is a bit... Well, I started learning it half an hour ago.

    [EDIT]Note that the working dir is the application dir. Also, don't assume anything about the order of loading the files.

    So, script showoff time?
    Sub Noise()
    for i = 0 to 2000
    Form.DrawPixel Rnd * 640, Rnd * 480, Rgb(Rnd * 256, Rnd * 256, Rnd * 256)
    next
    End Sub
    Kind of stresses the system, though.

    Global variables are possible, too:
    Randomize Timer
    Dim X,Y,Speed
    X = Rnd * 640
    Y = 0
    Speed = 10
    Sub Falling()
    Y = Y + Speed
    if Y > 480 then
    Y = 0
    X = Rnd * 640
    end if
    Form.DrawCircle CInt(X), CInt(Y), 10, Rgb(Rnd * 256, Rnd * 256, Rnd * 256)
    End Sub

    For some reason, you need to add explicit casts when using variables. Oh well. Anyway, with global variables, you could do interesting things...
    #
    Quanrian 16 years ago
    With Global Variables there is actually nothing you shouldn't be able to do. The only usual problem is that global values tend to be limited, and tend to be resource hogs if you're not careful. Your global variables are only limited by the variables that are possible, if you stick to numbers, you can really check anything at any point. Now if you get into binary conversion, even letters and symbols have numerical values that can quickly be read and even re-read at rediculous speeds. Ergo, the sky is the limits if you plan your use of global variables properly.
    #
    Amarth 16 years ago
    E, tip, how about letting us draw random sprites? You can't do that much with primitives like pixels, lines, etc.

    While I'm at that, transformations other than translations would be fun. Rotations, scaling, mirroring, shearing, that kind of things... Though I don't know how easy it is to implement this stuff in that VB thing.

    If only vbScript had OO support... Or, well, closures... Or at least *something* outstanding. For now, I find it to be a pretty mediocre language. Bonus points for having regular expressions though, although that's not too useful in a (graphical) game.
    #
    E_net4 16 years ago
    Nice work there, Amarth! Sure's nice to see some scripts being made.
    "Amarth" said:
    E, tip, how about letting us draw random sprites? You can't do that much with primitives like pixels, lines, etc.
    That is already listed in the features list, it's just not done yet.
    "Amarth" said:
    While I'm at that, transformations other than translations would be fun. Rotations, scaling, mirroring, shearing, that kind of things... Though I don't know how easy it is to implement this stuff in that VB thing.
    Scaling can be possible, using Stretchblt. Unfortunately, rotating, mirroring, and those other things don't seem to be workable. Well, this can't be done by either BitBlt or other picturebox control functions.

    I also thank you for that "run scripts in a folder" thingy, I'm storing it for future use.
    Now let me see if I can finish up Tic Tac Toe...

    Edit: Changed my mind, I'll be doing something else.
    #
    E_net4 16 years ago
    I've seen your scripts there, and it's time to challenge you.

    Here's my version of the Noise:
    Sub Noise()
    For i = 0 To 2000
    Form.Draw_from_Palette Rnd * 640, Rnd * 480, Int(Rnd * 2), 0, 1, 1
    Next
    End Sub
    Note: This will only work in this version, as the function Draw_from_Palette will be changed to Draw_from_Pallet
    Only 2 colours show up on this one, but I assure you it's faster than DrawPixel.
    #
    Quanrian 16 years ago
    "E_net4" said:
    Scaling can be possible, using Stretchblt. Unfortunately, rotating, mirroring, and those other things don't seem to be workable. Well, this can't be done by either BitBlt or other picturebox control functions.

    How is that even possible ? I mean that was possible with Qbasic... I think you need to research a bit, you'll prolly see it is possible. When it comes to programming, never say never, that's all I'm getting at. Rotation for example, can be done by rotating a texturable box ok. Next you simply texture the box, and you've got a rotatable texture. Just make sure you use the alpha channel to get rid of the bits you shouldn't see. As for mirroring, I believe that is done with some kind of trick for that as well, thinking of each pixel as a bit with a specific value. So once you know the value of the pixel, it's not a big thing to swap it from left to right or vice versa.
    #
    Amarth 16 years ago
    "Quanrian" said:
    "E_net4" said:
    Scaling can be possible, using Stretchblt. Unfortunately, rotating, mirroring, and those other things don't seem to be workable. Well, this can't be done by either BitBlt or other picturebox control functions.

    How is that even possible ? I mean that was possible with Qbasic...
    I'm not sure... I never saw an example of rotating with QBasic.
    Rotation for example, can be done by rotating a texturable box ok. Next you simply texture the box, and you've got a rotatable texture.
    Ehh, nope, not the way he's doing it. He's drawing pics on the canvas directly, not by texturing 3D models.
    As for mirroring, I believe that is done with some kind of trick for that as well, thinking of each pixel as a bit with a specific value. So once you know the value of the pixel, it's not a big thing to swap it from left to right or vice versa.
    I think this is the way to go: direct manipulation of your image data. A bit of linear algebra can get you a far way. Mirrorring is easy indeed, just flip around your indices. As for rotating, you'll have to multiply with a rotation matrix. Though I think doing this straightforward will yield bad results, both in terms of speed and numerical stability. You could do some research on rotation algorithms.
    #
    E_net4 16 years ago
    Indeed, I am not using textured 3D models. I am using BitBlt to Blit the sprites onto the screen.

    I just wonder whether StretchBlt is able to use negative width and height destination values, which would let me mirror sprites. If so, a mirroring feature is guaranteed.
    As for the rotation, yes, I'd need to look for some complicated algorithms. And still, the process would be as slow as my 2D polygon rotation program in my calculator.
    ...What? It's cool, it rotates a polygon...
    #
    Amarth 16 years ago
    Except that computers are generally faster than a calculator...
    #
    E_net4 16 years ago
    "Amarth" said:
    Except that computers are generally faster than a calculator...
    Yes, I did consider that.

    If I used directX, I'd have many powerful features to be added, including 3D models. Its implementation may be done after quite a while. It's just too hard for me to use it right now.
    #
    Quanrian 16 years ago
    "E_net4" said:
    Indeed, I am not using textured 3D models. I am using BitBlt to Blit the sprites onto the screen.

    Why would you use 2d techniques that take no advantage of the hardware out there ? Every computer sold going at least 5 years back has 3d hardware acceleration. PCs 'still' to this day do next to nothing to optomize 2d graphics. You're shooting yourself in the foot to spite your face. Just use texturing on a 2d plane in 3d space, so you can 'actually' use the hardware power out there, than you wont have to worry about how archaic it is just to rotate a graphic .
    #
    E_net4 16 years ago
    That's the problem, I told you I'm not using DirectX, nor any other 3D engine.
    Also, I'd choose DirectX if I had to use 3D.
    #
    Amarth 16 years ago
    "E_net4" said:
    Also, I'd choose DirectX if I had to use 3D.
    Boo. Hiss.
    #
    E_net4 16 years ago
    "Amarth" said:
    "E_net4" said:
    Also, I'd choose DirectX if I had to use 3D.
    Boo. Hiss.
    I'll take that as a "Don't use it, use N."
    What is N?
    #
    MageKing17 16 years ago
    Does SDL work with VB?
    #
    E_net4 16 years ago
    No, it doesn't.

    So, what is N?
    #
    Murska 16 years ago
    "E_net4" said:

    So, what is N?

    Well, it's a letter, it's between "M" and "O" in the alphabet, it's the 14:th letter, in morse, it's -.
    In ASCII, "N" is 78, and "n" is 110, in binary "N" is "01001110" and "n" is "01101110" N is the symbol of Nitrogen, and Newton. N is the second most commonly used consonant in the English language. As a vehicle country identification code, it means Norway, but in airplanes, it's the USA's. Mathematicians use N to refer to the set of all natural numbers. In astronomy, N stands for a reddish class of stars, and also the planet Neptune. In biochemistry, it's the symbol of asparagine. In electronics, it's a type of RF connector. "N" is the symbol of a nucleus. "n" is the symbol of a neutron. In statistics, "n" is the size of a sample. "N" is a song by Korean band, Banya.
    N is the name of an Adobe Flash game. In chess, "N" is a notation symbol for the knight piece, as the letter K is used for the king. In bus routes numbers in London, N indicates a night service and prefixes the number of the day route (though there may be small route differences), which generally runs from about 23:00 to 06:00 the next day. N scale is a popular model railway size, using rails nine-millimetres apart. The prefix N is used in a system for grading the strength of neodymium magnets, from N24 to the strongest, N54.

    There are other uses, if you need more info.
    #
    E_net4 16 years ago
    I won't let you do that again. Go away.
    #
    MageKing17 16 years ago
    "E_net4" said:
    I won't let you do that again. Go away.
    You "won't let"? Did you magically get moderator powers in the Projects Corner? :S

    Seriously, if you expect us to do the work for you, you're barking up the wrong community. Find a library yourself.
    #
    Amarth 16 years ago
    Well, I dunno. VB6 is such an ancient language that I'm actually surprised that the programs still compile and run. Of course, Microsoft has spend quite some time keeping the ABI constant. Another proof that that isn't always a good idea.

    Anyway, if you want to use VB6 + DirectX, go ahead. Be aware there are other things out there. Stuff like FreeBASIC. Stuff that is free and newer and not as MS-tied.

    Also, I'm sure you'd love Python and the likes. Very VBlike from what I heard.

    In fact, I wonder why *anyone* would still use a commercial language/IDE.
    #
    E_net4 16 years ago
    I'll take a look at Python, then.
    So, apart from graphics, what do you suggest to Sorced Combat?
    #
    MageKing17 16 years ago
    Make something procedurally generated. They're always fun.
    #
    E_net4 16 years ago
    Finished 0.43, which unfortunately is full of mistakes and other bad stuff. The good part is that option saving and loading is working great. You can now add your own scenes, and I've made a brand new character, Hacklon.

    And if anyone finds out the problem with player collisioning, tell me ASAP.
    #
    Forum » Sorced Combat (Almost Alpha!)
  • « previous
  • 1
  • 2
  • » next
  • Post Reply


    Your email:
    Your name: