• Toolgun Minigames - games on your toolgun screen
    122 replies, posted
  • Avatar of Devenger
  • [url=http://i16.photobucket.com/albums/b35/Devenger/gm_construct0044.jpg][img]http://s16.photobucket.com/albums/b35/Devenger/th_gm_construct0044.jpg[/img][/url][url=http://i16.photobucket.com/albums/b35/Devenger/gm_construct0046-1.jpg][img]http://s16.photobucket.com/albums/b35/Devenger/th_gm_construct0046-1.jpg[/img][/url][url=http://i16.photobucket.com/albums/b35/Devenger/gm_construct0050.jpg][img]http://s16.photobucket.com/albums/b35/Devenger/th_gm_construct0050.jpg[/img][/url][url=http://i16.photobucket.com/albums/b35/Devenger/gm_construct0051.jpg][img]http://s16.photobucket.com/albums/b35/Devenger/th_gm_construct0051.jpg[/img][/url][url=http://i16.photobucket.com/albums/b35/Devenger/gm_construct0052-1.jpg][img]http://s16.photobucket.com/albums/b35/Devenger/th_gm_construct0052-1.jpg[/img][/url] [i]Playable game list:[/i] [b]Pong[/b] by Devenger [b]Snake[/b] by [b]Fuzzylightning[/b] [b]Tetris[/b] by [b]Fuzzylightning[/b] [b]Rock Attack[/b] by [b]Nevec[/b] 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. [b]WARNING TO GENERAL PLAYERS:[/b] 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: [url=http://code.google.com/p/toolgunminigames/source/checkout]toolgunminigames[/url]. Check it out into garrysmod/addons/toolgun_minigames. [b]OR[/b] [url=http://www.garrysmod.org/downloads/?a=view&id=51683][img]http://www.garrysmod.org/img/?t=dll&id=51683[/img][/url] Extract to garrysmod/addons. - Load up GMod, and bind a key to 'tgm_toggle' (e.g. [b]bind 'l' 'tgm_toggle'[/b]) - 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. [b]Commands Reference Guide:[/b] [b]tgm_toggle[/b] - toggle whether toolgun is in minigame mode [b]tgm_alwaysrender[/b] [i]0/1[/i] - set whether the active minigame should render on the toolgun screen even when the toolgun is in normal operation mode [b]tgm_showunfinishedgames[/b] [i]0/1[/i] - 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 [b]tgm_reloadgames[/b] - another developer one; reloads all games so you can rapidly test changes you've saved to game files. [b]tgm_initialize[/b] - not recommended: reload the addon entirely, shouldn't be neccessary [b]Credits[/b] Devenger: idea, core coding, Pong RabidToaster: saying it was cool, additional ideas, testing Fuzzylightning: 'Snake' game, 'Tetris' game Nevec: 'Rock Attack' game [b]Got ideas? Say them! Like this so far? Say so![/b]
  • Avatar of Lyokanthrope
  • I don't think it likes 16:10 resolutions.. [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20027.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20027.jpg[/img_thumb][/url] [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20029.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20029.jpg[/img_thumb][/url] [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20031.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20031.jpg[/img_thumb][/url]
  • Avatar of Devenger
  • [QUOTE=Lyoko774]I don't think it likes 16:10 resolutions.. [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20027.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20027.jpg[/img_thumb][/url] [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20029.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20029.jpg[/img_thumb][/url] [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20031.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20031.jpg[/img_thumb][/url][/QUOTE] 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...
  • Avatar of Devenger
  • 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?
  • Avatar of Lyokanthrope
  • [QUOTE=Devenger]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?[/QUOTE] 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. [b]Edit:[/b] Nope. Happens on a fresh install.
  • 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!
  • Avatar of Night-Eagle
  • 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 [url=http://forums.facepunchstudios.com/showthread.php?t=379508]Toolbow[/url] without modification.
  • Avatar of Nev
  • 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. [B]Edit:[/B] Or maybe now. [URL=http://img231.imageshack.us/my.php?image=gmconstruct0039jr5.jpg][IMG]http://img231.imageshack.us/img231/5471/gmconstruct0039jr5.th.jpg[/IMG][/URL]
  • Avatar of Empire Phoen
  • 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
  • Avatar of Devenger
  • [QUOTE=Nevec]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.[/QUOTE] You are epic wins, good sir. [QUOTE=Empire Phoen]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[/QUOTE] 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. [QUOTE=Night-Eagle]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 [url=http://forums.facepunchstudios.com/showthread.php?t=379508]Toolbow[/url] without modification.[/QUOTE] 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.
  • Avatar of Gran PC
  • 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. [lua]local redirectBinds = { ["+attack"] = true, ["+attack2"] = true, ["+moveleft"] = true, ["+moveright"] = true, ["+forward"] = true, ["+back"] = true, ["+speed"] = true, ["+duck"] = true, ["+jump"] = true, ["phys_swap"] = true, }[/lua]
  • Avatar of Kogitsune
  • [QUOTE=Devenger] 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. [/QUOTE] You could always make a middle-ground for that - make a tool that enables or disables the games, possibly?
  • Avatar of Nev
  • 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.
  • Avatar of SamPerson123
  • [QUOTE=Lyoko774]I don't think it likes 16:10 resolutions.. [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20027.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20027.jpg[/img_thumb][/url] [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20029.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20029.jpg[/img_thumb][/url] [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20031.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20031.jpg[/img_thumb][/url][/QUOTE] Mine looks like that too when I try to play. I think it may have something to do with texture detail settings.
  • Avatar of Night-Eagle
  • [QUOTE=Devenger]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.[/QUOTE] [img]http://img411.imageshack.us/img411/4946/gmconstruct0038copyvp9.jpg[/img] 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).
  • Avatar of Benie
  • 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.
  • Avatar of Devenger
  • [QUOTE=Night-Eagle]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.[/QUOTE] 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? [QUOTE=Night-Eagle]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).[/QUOTE] 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 [url=http://forums.facepunchstudios.com/showthread.php?p=11422674#post11422674]you'd be ripping me off more than you might know[/url]. 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 [url=http://progressquest.com/info.php]Progress Quest[/url] 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.
  • Avatar of Lyokanthrope
  • Can you please try to figure out why it messes up like this for us? [quote=SamPerson123][QUOTE=Lyoko774]I don't think it likes 16:10 resolutions.. [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20027.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20027.jpg[/img_thumb][/url] [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20029.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20029.jpg[/img_thumb][/url] [url=http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20031.jpg][img_thumb]http://jman94.crystalmoon.com/gm_construct_flatgrass_v4-20031.jpg[/img_thumb][/url][/QUOTE] Mine looks like that too when I try to play. I think it may have something to do with texture detail settings.[/quote]
  • Avatar of Devenger
  • [QUOTE=Lyoko774]Can you please try to figure out why it messes up like this for us?[/QUOTE] 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.