1. Post #1
    Devenger's Avatar
    February 2006
    235 Posts


    Playable game list:
    Pong by Devenger
    Snake by Fuzzylightning
    Tetris by Fuzzylightning
    Rock Attack by Nevec

    Something I thought of a very long time ago, did a while ago with input and support from RabidToaster, and never got round to releasing until now was Toolgun Minigames. Quite simply, the ability to play games on your toolgun screen, wherever you are - it's clientside, so all it relies on is having a toolgun to hand.

    WARNING TO GENERAL PLAYERS: there's a reason that this is in the Lua Scripting forum and not Releases. Though there is fun to be had with this, this is NOT a finished product.

    There's four playable minigames so far. It really isn't hard to make a minigame if you have experience with Lua, so please do mess around - Pong serves as a good example of a simple game, and the 'base' game is commented with explanations or all special functions the toolgun will call on games.

    Games are as easy to make as they'll ever be - similar to SWEPs, games need to have an appropriately named folder with an init.lua file inside to load, and have functions you can define which will call in certain situations - Initialize, Think, Render, Pause, et cetera. Games can be made of as many files as you want, you can just include additional ones as you would in any script (though Pong only has one file, MP Draughts has 6). Any games defined in themselves as 'selectable' are automatically entered into the game select menu, which is just another game that the toolgun loads first when you enter minigame mode.

    Instructions:

    - Get the latest version via SVN. There's details about checkout on the google code project: toolgunminigames. Check it out into garrysmod/addons/toolgun_minigames.

    OR


    Extract to garrysmod/addons.

    - Load up GMod, and bind a key to 'tgm_toggle' (e.g. bind 'l' 'tgm_toggle') - this key will then bring the toolgun up to your screen, if you have the toolgun out, so you can play minigames, and another press will put the toolgun back into normal operation mode.
    - Play any of the four completed games. In console, put 'tgm_showunfinishedgames 1' to have the game select menu show all games, including the ones that don't work (you may have to press USE - 'return to game select' - to refresh the game select menu).
    - Come back, give me constructive criticism and suggestions for games or other features.

    Commands Reference Guide:

    tgm_toggle - toggle whether toolgun is in minigame mode
    tgm_alwaysrender 0/1 - set whether the active minigame should render on the toolgun screen even when the toolgun is in normal operation mode
    tgm_showunfinishedgames 0/1 - for developers only, or people who want to play unfinished Breakout - when on, the game select menu will populate itself with all games when initialized, not just ones that want to be selectable
    tgm_reloadgames - another developer one; reloads all games so you can rapidly test changes you've saved to game files.
    tgm_initialize - not recommended: reload the addon entirely, shouldn't be neccessary

    Credits

    Devenger: idea, core coding, Pong
    RabidToaster: saying it was cool, additional ideas, testing
    Fuzzylightning: 'Snake' game, 'Tetris' game
    Nevec: 'Rock Attack' game


    Got ideas? Say them! Like this so far? Say so!
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Funny x 4Lua King x 2Artistic x 1Useful x 1Winner x 1Agree x 1 (list)

  2. Post #2
    kevkev's Avatar
    April 2007
    1,093 Posts
    Looks awesome :D

  3. Post #3
    Gold Member
    noobcake's Avatar
    November 2006
    3,652 Posts
    Quite.

  4. Post #4
    Gold Member
    Nevec's Avatar
    June 2008
    1,094 Posts
    Just awesome.

    I'll try to make some games for this. :)

  5. Post #5
    I will huff and puff and FLIP YOUR FUCKING TABLES
    Lyokanthrope's Avatar
    October 2005
    7,186 Posts
    I don't think it likes 16:10 resolutions..



  6. Post #6
    Devenger's Avatar
    February 2006
    235 Posts
    Lyoko774 posted:
    I don't think it likes 16:10 resolutions..


    I play at 16:10 and tested it on 4:3 as well; additionally, it never references screen size and shouldn't need to. I can't work out what this problem is immediately...

  7. Post #7
    I will huff and puff and FLIP YOUR FUCKING TABLES
    Lyokanthrope's Avatar
    October 2005
    7,186 Posts
    Well, that's strange..

  8. Post #8
    Devenger's Avatar
    February 2006
    235 Posts
    Once some other people start getting it, I'll try and isolate the details of it. It seems unreplicatable. Anything odd about your GMod install? What quality levels for things do you run at?

  9. Post #9
    I will huff and puff and FLIP YOUR FUCKING TABLES
    Lyokanthrope's Avatar
    October 2005
    7,186 Posts
    Devenger posted:
    Once some other people start getting it, I'll try and isolate the details of it. It seems unreplicatable. Anything odd about your GMod install? What quality levels for things do you run at?
    I run at all highest settings, and I have mat_picmip -10 in my autoexec.
    8x MSAA, 16x AF, VSync disabled.
    Maybe I should try on a fresh GMod install..Gotta clean it out anyhow.

    Edit:

    Nope. Happens on a fresh install.

  10. Post #10
    Limee's Avatar
    August 2008
    700 Posts
    You have no life at all if you are making this so COOL!! :D

  11. Post #11
    Gold Member

    December 2007
    489 Posts
    I want a Gmod mini game as an idea!

    Play Gmod in Gmod!


    Just kidding, woah, I never thought anyone would think of these. Extraordinary!

  12. Post #12
    Gold Member
    Night-Eagle's Avatar
    January 2005
    815 Posts
    Interesting way to do mouse input. I guess I did mine the hard way, but then again, I need raw keyboard input...
    Hey, this method will work with the Toolbow without modification.

  13. Post #13
    Gold Member

    July 2006
    1,960 Posts
    Pretty cool.

  14. Post #14

    October 2007
    169 Posts
    Awesome. :D

  15. Post #15
    Gold Member
    Nevec's Avatar
    June 2008
    1,094 Posts
    I'm making an asteroid game for this. I just have to add asteroid spawning and asteroid-blast collision detecting and it will be done. I'll post screen shots tomorrow.

    Edit:

    Or maybe now.


  16. Post #16
    Empire Phoen's Avatar
    October 2006
    36 Posts
    I suggest for lase perosns as me just a normal toolmode, that with primary fire enable sgame mode and allows a simple way to switch back, cause console commands kinda suck

  17. Post #17
    Devenger's Avatar
    February 2006
    235 Posts
    Nevec posted:
    I'm making an asteroid game for this. I just have to add asteroid spawning and asteroid-blast collision detecting and it will be done.
    You are epic wins, good sir.

    Empire Phoen posted:
    I suggest for lase perosns as me just a normal toolmode, that with primary fire enable sgame mode and allows a simple way to switch back, cause console commands kinda suck
    I'll see about hacking in a toolmode. Might not be easily possible though because of the nature of toolgun modes; I think requests for changes are sent to the server, which checks if the selection is legal, then sent back to client.

    Just bind the console command for now.

    Night-Eagle posted:
    Interesting way to do mouse input. I guess I did mine the hard way, but then again, I need raw keyboard input...
    Hey, this method will work with the Toolbow without modification.
    What yours did you do (to flout grammar)? I thought I was original. D: Also, yeah, mouse input thing is a neat method I use for most things. Players could probably use the input library if they desperately wanted specific keys, I dunno.

  18. Post #18
    PENISCORP DIRECTOR
    Gran PC's Avatar
    August 2007
    3,114 Posts
    This is really awesome. I found a bug: If you press a button binded to phys_swap (default: mouse4), you'll swap to the gravity gun but you'll be still frozen.
    Solution: Add phys_swap to the redirectBinds table.
    local redirectBinds = {
    	["+attack"] = true,
    	["+attack2"] = true,
    	["+moveleft"] = true,
    	["+moveright"] = true,
    	["+forward"] = true,
    	["+back"] = true,
    	["+speed"] = true,
    	["+duck"] = true,
    	["+jump"] = true,
    	["phys_swap"] = true,
    }

  19. Post #19
    KevinESP's Avatar
    October 2007
    17 Posts
    It reminds me to the timesplitters minigames, awesome.
    Reply With Quote Edit / Delete Reply Spain Show Events Dumb Dumb x 1 (list)

  20. Post #20
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,860 Posts
    Devenger posted:
    I'll see about hacking in a toolmode. Might not be easily possible though because of the nature of toolgun modes; I think requests for changes are sent to the server, which checks if the selection is legal, then sent back to client.

    Just bind the console command for now.
    You could always make a middle-ground for that - make a tool that enables or disables the games, possibly?
    Reply With Quote Edit / Delete Reply United States Show Events Disagree Disagree x 1 (list)

  21. Post #21
    Gold Member
    Nevec's Avatar
    June 2008
    1,094 Posts
    OK, the asteroids game is coming together. I didn't work on it much today and I'm gonna go to bed soon, so I'll probably finish it tomorrow.

    Also, the game list needs a scroll bar or scroll buttons of some kind. If you didn't already know that.

  22. Post #22
    Gold Member
    SamPerson123's Avatar
    September 2007
    3,558 Posts
    Lyoko774 posted:
    I don't think it likes 16:10 resolutions..


    Mine looks like that too when I try to play. I think it may have something to do with texture detail settings.

  23. Post #23
    Gold Member
    Night-Eagle's Avatar
    January 2005
    815 Posts
    Devenger posted:
    What yours did you do (to flout grammar)? I thought I was original. D: Also, yeah, mouse input thing is a neat method I use for most things. Players could probably use the input library if they desperately wanted specific keys, I dunno.

    I use the default cursor and vector math to calculate where the mouse is on the screen. This also allows me to fetch raw keyboard input, needed for text entries. It also works when the gun is not in "ironsight" mode, and every point in between. The only downsides are that it only works for one viewmodel FOV - not to be confused with player FOV - and needs explicit setup for the Toolbow. I started the project on August 7th, but since then, I've had no time to work on it due to college.

    /hijackthread

    I love the way you did it, simply because you still have access to the player's default bindings, and because it seems more intuitive. I guess mine is more suitable for my purposes, because my implementation is for a toolgun. I think I might rip off your idea to implement Red Orchestrish aiming (sometime in the next year, Valve time).

  24. Post #24
    Empire Phoen's Avatar
    October 2006
    36 Posts
    Enable Disable idea,

    Enable witha tollgun you fire, diable by starting the game "exit"
    Reply With Quote Edit / Delete Reply Germany Show Events Late Late x 1 (list)

  25. Post #25
    ray243's Avatar
    January 2008
    1,847 Posts
    Haha, looks like those handphone games. Great work.

  26. Post #26
    Gold Member
    Benie's Avatar
    September 2007
    3,929 Posts
    This would be great when waiting for your contraption to stop spazzing.
    Great idea here. You should allow a multiplayer mode to connect two or more toolguns.

  27. Post #27
    Devenger's Avatar
    February 2006
    235 Posts
    Night-Eagle posted:
    I use the default cursor and vector math to calculate where the mouse is on the screen. This also allows me to fetch raw keyboard input, needed for text entries. It also works when the gun is not in "ironsight" mode, and every point in between. The only downsides are that it only works for one viewmodel FOV - not to be confused with player FOV - and needs explicit setup for the Toolbow. I started the project on August 7th, but since then, I've had no time to work on it due to college.
    Looks great, on a graphical level and an awesome-wire-chip level. Text entries are obviously a near-impossibility (well, I'm not doing it anyway) with my implementation, whereas you can partially use default VGUI keyboard input I guess?

    Night-Eagle posted:
    I love the way you did it, simply because you still have access to the player's default bindings, and because it seems more intuitive. I guess mine is more suitable for my purposes, because my implementation is for a toolgun. I think I might rip off your idea to implement Red Orchestrish aiming (sometime in the next year, Valve time).
    Thanks for the compliment; not that I'm not happy to see more solid SWEPs - I loved CSE with RO aiming even though the actual classic CSE parts were clunky - but keep in mind you'd be ripping me off more than you might know. So, if you do it, do something special (guns and crosshair rattling around? if nothing else, better transitions between an animed and unaimed mode, regardless of ironsighting?). Can't wait to see if you do take it up!

    ---

    ON-THE-DARN-TOPIC: I'm considering making a game I think a lot of GModders could have a little fun with, because it wouldn't be such an active investment of time. Anyone familiar with Progress Quest will be familiar with the concept - you'll set up a character who'll be dropped into a generic fantasy RPG scenario, then for the most part just set them loose to kill stuff and complete quests by doing so. Unlike Progress Quest I intend to make your character setup somewhat influence what your character does and can do, and I'll maybe even have the ability to make certain choices, but mostly you'll be able to just run it in the background (and even watch some health bars and other information whilst using the toolgun generally, if tgm_alwaysrender is on). I'll have to add some extra stuff to allow game thinking when toolgun is not drawn, but other than that it's all possible with the current version of the core.

  28. Post #28
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,860 Posts
    Progress quest was awesome - do it :).

  29. Post #29
    I will huff and puff and FLIP YOUR FUCKING TABLES
    Lyokanthrope's Avatar
    October 2005
    7,186 Posts
    Can you please try to figure out why it messes up like this for us?
    SamPerson123 posted:
    Lyoko774 posted:
    I don't think it likes 16:10 resolutions..


    Mine looks like that too when I try to play. I think it may have something to do with texture detail settings.

  30. Post #30
    Devenger's Avatar
    February 2006
    235 Posts
    Lyoko774 posted:
    Can you please try to figure out why it messes up like this for us?
    I don't have ANY leads. Your setting sare he same as mine, for example. I'll probably just add an option to render at half-size. Or you could tell me what happens if you change tgm.ScreenSize to 256, 512 might go over some limit for some people or something.

  31. Post #31
    Extraction Point
    Empty_Shadow's Avatar
    July 2006
    8,302 Posts
    ON-THE-DARN-TOPIC: I'm considering making a game I think a lot of GModders could have a little fun with, because it wouldn't be such an active investment of time. Anyone familiar with Progress Quest will be familiar with the concept - you'll set up a character who'll be dropped into a generic fantasy RPG scenario, then for the most part just set them loose to kill stuff and complete quests by doing so. Unlike Progress Quest I intend to make your character setup somewhat influence what your character does and can do, and I'll maybe even have the ability to make certain choices, but mostly you'll be able to just run it in the background (and even watch some health bars and other information whilst using the toolgun generally, if tgm_alwaysrender is on). I'll have to add some extra stuff to allow game thinking when toolgun is not drawn, but other than that it's all possible with the current version of the core.
    There is a specific image-macro that fulfils it's function perfectly here.
    But rules are rules.
    DO IT NOW!

  32. Post #32
    Gold Member
    SamPerson123's Avatar
    September 2007
    3,558 Posts
    Devenger posted:
    I don't have ANY leads. Your setting sare he same as mine, for example. I'll probably just add an option to render at half-size. Or you could tell me what happens if you change tgm.ScreenSize to 256, 512 might go over some limit for some people or something.
    It works now! Thanks Devenger :3.
    EDIT:
    Uh oh, doing that makes breakout look weird.
    Reply With Quote Edit / Delete Reply United States Show Events Funny Funny x 1 (list)

  33. Post #33
    Gold Member
    Nevec's Avatar
    June 2008
    1,094 Posts



    The collision detection is kinda bugged, and it probably needs some graphical improvements(like make the asteroids look like asteroids).

  34. Post #34
    Fuzzyltning's Avatar
    July 2008
    18 Posts
    The player gets stuck unable to input anything if they are killed while using the toolgun minigames. Also, is there anything you can do about the twitching? My tool has about a 30% chance of going into uncontrollable non-stop twitching each time I go into minigame mode.

    Okay so I fell in love with the thing, I've wanted to do some sort of arcade type deal for a long, long time and this is probably the best platform for it. Nice work on the API, I had exactly what I needed the whole time. I spent the day working on a Snake game for it, and it works pretty well. It weighs in at around 312 lines (larger than I expected, probably because of the menu code).

    I'm quite happy with it, it has a difficulty setting menu and a game over screen. The game features 4 difficulty modes of varying speed, food availability and score settings. It doesn't play as nice with tgm.ScreenSize as I had hoped despite all the size, position and font calculations being based off percentages of it.

    Download and Screenshots: http://garrysmod.org/downloads/?a=view&id=50984

    Extract to addons/toolgun_minigames/lua/autorun/client/toolgun_minigames/games.

    It's up to you what you do with it. Let me know if you find any bugs or think the difficulty should be tweaked any.

  35. Post #35
    Gold Member
    Nevec's Avatar
    June 2008
    1,094 Posts
    The "King Cobra" difficulty level is too fast in my opinion. But overall it's awesome. I really like your menus.

  36. Post #36
    Gold Member

    January 2007
    194 Posts
    Just exit garry's mod and play these minigames on the web. Garry's mod is for garry's mod and the like. LOL on you
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 1Disagree Disagree x 1 (list)

  37. Post #37
    Gold Member
    Nevec's Avatar
    June 2008
    1,094 Posts
    GMod is for anything you can think of. Including this sort of thing.
    Reply With Quote Edit / Delete Reply Latvia Show Events Optimistic Optimistic x 1 (list)

  38. Post #38
    elcidop's Avatar
    March 2008
    441 Posts
    Where i can find Devenger's Toolgun Minigames addon?

  39. Post #39
    Gold Member
    Nevec's Avatar
    June 2008
    1,094 Posts
    You can download it with an SVN client. Address is in OP.

  40. Post #40
    Tawfiq's Avatar
    August 2008
    11 Posts
    wow i got these they are really good and in time if they were all as good as pong this would be soo cool. Especially if multiplayer.