by ScottLininger » Sat Nov 22, 2008 10:54 pm
Hey everyone, I've finally found the time to assemble a ZIP containing the knight game demo that I presented at Google IO last year. Unzip the contents into your Sketchup Plugins directory, then look for a new menu item under Plugins > Knight Game <edit> Too big to upload to the forums, so you can get it here... http://www.sketchupdemos.com/knightgame.zipIt's about 4mb. </edit> This is an example of using a Ruby WebDialog to capture key strokes and control SU in a fun way. You can hear more details from the original preso: http://www.youtube.com/watch?v=FALvwBN5-hc Special thanks to Todd Burch for cleaning up the code and adding sound effects! If you could see my original demo code (and you never will!), you'd know why he's my hero.  And apologies to the community for taking so long to share. Cheers,
Last edited by ScottLininger on Sat Nov 22, 2008 11:03 pm, edited 1 time in total.
- Scott Lininger SketchUp Software Engineer Have you visited the Ruby API Docs?
-

ScottLininger
-
- Posts: 173
- Joined: Tue Oct 21, 2008 11:17 pm
- Location: Boulder, CO
-
by remus » Sat Nov 22, 2008 10:58 pm
could we have the .zip please? 
-
remus
-
- Posts: 8044
- Joined: Fri Nov 30, 2007 8:48 am
- Location: UK
- Name: remus
-
by JuanV.Soler » Sat Nov 22, 2008 11:26 pm
Thanks  (remus, the link is given above)
_,_)))_,_
-
JuanV.Soler
-
- Posts: 1267
- Joined: Tue Nov 13, 2007 8:39 am
- Location: Málaga. Spain.
- Name: Juan Víctor
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: landscape architecture
- Level of SketchUp: Intermediate
by Daniel S » Sat Nov 22, 2008 11:47 pm
Amazing game!!! Great work!! Thank you, Daniel S
-
Daniel S
-
- Posts: 341
- Joined: Mon Nov 12, 2007 6:06 pm
- Location: Mar del Plata, Buenos Aires, Argentina
- Operating system: Windows
- SketchUp version: 2015
- License type: Pro
- SketchUp use: product design
- Level of SketchUp: Intermediate
-
by Dhruv » Sun Nov 23, 2008 2:35 am
Thanks Scott, can feel that many more things can be done integrating javascript with sketchup.
Cheers, Dhruv
-
Dhruv
-
- Posts: 25
- Joined: Tue Nov 18, 2008 4:07 am
- Location: Vancouver
- Name: Dhruv Adhia
by Dhruv » Mon Nov 24, 2008 1:08 am
Hey Scott,
I tried converting 2dimensional game into 3d, like ability to go left and right. I did make some changes and it turns left and right, but does not run in that direction.
And yes I changed 3rd person view to 1st person and going forward is up key and backward is down key. So before doing that I basically commented jump sword functions.
-
Dhruv
-
- Posts: 25
- Joined: Tue Nov 18, 2008 4:07 am
- Location: Vancouver
- Name: Dhruv Adhia
by Chris Fullmer » Mon Nov 24, 2008 6:37 am
Thanks for posting that Scott!
Chris
-

Chris Fullmer
- SketchUp Team

-
- Posts: 6929
- Joined: Wed Nov 21, 2007 3:21 am
- Location: Boulder, CO
- Name: Chris Fullmer
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: landscape architecture
- Level of SketchUp: Advanced
-
by Fletch » Mon Nov 24, 2008 7:05 pm
thanks! I wanted this first time I saw it!  unfortunately I'm at work, and they refuse to give me SU7 for a few more weeks... no way we could get an SU6 version, is there?!
-
Fletch
- Twilight Render
-
- Posts: 732
- Joined: Wed Nov 14, 2007 1:02 am
- Location: Milwaukee, WI USA / Rovinj, Croatia
- Name: Fletch
- Operating system: Windows
- SketchUp version: 2017
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by linea » Mon Nov 24, 2008 7:25 pm
AWESOME SCOTT & TODD! Its fantastic, I had no idea this sort of thing was possible in SU. I want to make one! "How?" is a question I'm sure you'll be asked alot more.
-
linea
-
- Posts: 1143
- Joined: Tue Nov 13, 2007 9:13 am
- Location: Hull, UK
- Name: linea
-
by Dhruv » Mon Nov 24, 2008 11:54 pm
I made it run along Y axis as well, it was a little change and assigned J and S for jump and Swordhit respectively. Arrow keys for direction. Ill try and add more features.
Cheers, Dhruv
-
Dhruv
-
- Posts: 25
- Joined: Tue Nov 18, 2008 4:07 am
- Location: Vancouver
- Name: Dhruv Adhia
by Dhruv » Tue Nov 25, 2008 5:45 am
Hey Coen Naninck,
I wanted to do something related to Dynamic components, like when you click on an object/model, it brings to some website. Like lets say I have built a Kawasaki motor bike , when I left click on it brings me to some kawasaki website online.
Will try out though, see if I can come out with this feature. It would be cool to use it in a game.
Cheers, Dhruv
-
Dhruv
-
- Posts: 25
- Joined: Tue Nov 18, 2008 4:07 am
- Location: Vancouver
- Name: Dhruv Adhia
by pilou » Tue Nov 25, 2008 9:33 am
Totally amazing  prince.jpg
-

pilou
- Top SketchUcator
-
- Posts: 21104
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by notareal » Tue Nov 25, 2008 9:38 am
 Thanks!
-
notareal
- Thea Render Support

-
- Posts: 1075
- Joined: Tue Nov 13, 2007 9:54 pm
- Location: Oulu, Finland
- Name: notareal
-
by HFM » Tue Nov 25, 2008 11:58 am
Fletch wrote:thanks! I wanted this first time I saw it!  unfortunately I'm at work, and they refuse to give me SU7 for a few more weeks... no way we could get an SU6 version, is there?!
It's pretty simple to make this SU6 compatible. Just save the maps [.skp] as SU6
-
HFM
-
- Posts: 336
- Joined: Mon Apr 14, 2008 5:57 pm
- Location: The Netherlands
- Name: HFM
by Matt666 » Tue Nov 25, 2008 12:38 pm
-
Matt666
-
- Posts: 830
- Joined: Wed Dec 05, 2007 8:38 am
- Location: 48.1184, -1.675
- Name: Matt
-
by •BTM » Wed Nov 26, 2008 2:32 am
I have a mac running OSX 10.5.5, and for every frame, I encounter the error "newGroundz: value=>-5000< TypeError: Value undefined (result of expression value.split) is not object.". the error pops up first, i have to click enter, then next frame, same error, this repeat over and over, then the knight falls through the floor, screams, and SU messes up. Any idea why?
-
•BTM
- PluginStore Author

-
- Posts: 717
- Joined: Wed Jul 23, 2008 12:59 am
- Name: •BTM
by ScottLininger » Wed Nov 26, 2008 5:43 am
BTM,
Ah, there's a snippet of code in the .rb file that detects if you're on a mac, but it was added back when the mac/su6 had WebDialog errors that are fixed in 7.
I'll need to test on my Mac with SU7 and post a fixed version.
- Scott Lininger SketchUp Software Engineer Have you visited the Ruby API Docs?
-

ScottLininger
-
- Posts: 173
- Joined: Tue Oct 21, 2008 11:17 pm
- Location: Boulder, CO
-
by plot-paris » Thu Nov 27, 2008 1:09 pm
fantastic! thank you so much for posting this game. indeed, a new era is about to begin 
-

plot-paris
-
- Posts: 1573
- Joined: Tue Apr 01, 2008 10:15 am
- Location: Konstanz, Germany
- Name: plot-paris
- Operating system: Windows
- SketchUp version: 2016
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by chief1234 » Wed Dec 10, 2008 2:55 am
Thanks Scott, this is great!!
I'm working on incorporating this into a school project, and I'm wondering if there's a way to load the engine onto any map without it being hardcoded.
IE - if I could download anything from the 3D warehouse, start the Knight plugin and be able to navigate?
Thanks in advance,
Luke J.
-
chief1234
-
- Posts: 2
- Joined: Wed Nov 26, 2008 7:16 pm
by ScottLininger » Wed Dec 10, 2008 5:14 pm
chief1234 wrote:I'm wondering if there's a way to load the engine onto any map without it being hardcoded.
Well, you could do one of two things. 1. Open one of the .skp files inside Plugins/knightgame and edit the maps directly. 2. Open the knightgame.rb file and modify the code to not load in a new model but simply run on top of the current model. So yeah... it's doable. Let me know if you have specific questions. 
- Scott Lininger SketchUp Software Engineer Have you visited the Ruby API Docs?
-

ScottLininger
-
- Posts: 173
- Joined: Tue Oct 21, 2008 11:17 pm
- Location: Boulder, CO
-
by chief1234 » Thu Dec 11, 2008 12:13 am
Right, changing the code to run on top of the current model would be ideal.
Unfortunately, I'm a novice at Ruby so I'm not quite sure how to do this...
I tried removing any direct references to maps in the file_loaded? method at the bottom. This way the engine will run, but only on maps AFTER they have been hardcoded, run, then the code removed again...
Obviously I'm missing a vital part of the puzzle...
Any help out of your busy schedule would be greatly appreciated!
Thanks, Luke J.
-
chief1234
-
- Posts: 2
- Joined: Wed Nov 26, 2008 7:16 pm
by toxic » Tue Dec 23, 2008 4:36 pm
Thats fantastic So when do we get worms 
-
toxic
-
- Posts: 6
- Joined: Tue Apr 15, 2008 5:04 pm
- Location: United Kingdom
-
by trickout » Tue Jan 27, 2009 5:28 am
when i try to go to the linked site for the .zip, it says sight unavailable
can someone post it somewhere else?
-
trickout
-
- Posts: 2
- Joined: Sun Jan 25, 2009 5:20 am
by ScottLininger » Tue Jan 27, 2009 7:25 am
Hello trickout. Terribly sorry for the broken link. Please try again.
Cheers,
- Scott Lininger SketchUp Software Engineer Have you visited the Ruby API Docs?
-

ScottLininger
-
- Posts: 173
- Joined: Tue Oct 21, 2008 11:17 pm
- Location: Boulder, CO
-
by trickout » Fri Jan 30, 2009 1:54 am
Thank you for fixing the link. How can I edit the code, for instance make it move in 3 dimensions instead of just on a plane? I've tried to find a .rb editor but no success. 
-
trickout
-
- Posts: 2
- Joined: Sun Jan 25, 2009 5:20 am
by todd burch » Fri Jan 30, 2009 3:12 am
.rb files are merely text files. Notepad, Textedit, lots of editors will work. Always save as plain text.
-
todd burch
-
- Posts: 913
- Joined: Mon Nov 12, 2007 2:43 pm
- Location: Katy, Texas
- Name: Todd Burch
-
by August » Fri Feb 20, 2009 11:10 am
YouTube says: "We're sorry, this video is no longer available." Any alternate sources? Thanks, August
“An idea, like a ghost, must be spoken to a little before it will explain itself.” -- Charles Dickens
-
August
-
- Posts: 250
- Joined: Thu Mar 27, 2008 1:48 am
- Location: Boulder Creek, California
- Name: August Mohr
- Operating system: Mac
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Intermediate
-
by ScottLininger » Fri Feb 20, 2009 5:47 pm
August wrote:YouTube says: "We're sorry, this video is no longer available."
Any alternate sources?
Hey August, I've sent a query to the code site folks asking what happened to the video. Thanks!
- Scott Lininger SketchUp Software Engineer Have you visited the Ruby API Docs?
-

ScottLininger
-
- Posts: 173
- Joined: Tue Oct 21, 2008 11:17 pm
- Location: Boulder, CO
-
by Trimmer » Mon Apr 06, 2009 4:55 pm
Hi Scott, I'm Having the same problem BTM did back in Nov: •BTM wrote:I have a mac running OSX 10.5.6, and for every frame, I encounter the error "newGroundz: value=>-5000< TypeError: Value undefined (result of expression value.split) is not object.". the error pops up first, i have to click enter, then next frame, same error, this repeat over and over, then the knight falls through the floor, screams, and SU messes up. Any idea why?
ScottLininger wrote:I'll need to test on my Mac with SU7 and post a fixed version.
Have you found a way to correct this?
-
Trimmer
-
- Posts: 7
- Joined: Fri Mar 27, 2009 4:59 pm
- Location: Phoenix, AZ
- Name: Eric Hunt
-
by driven » Sun Feb 21, 2010 12:49 pm
Hi All,
did anyone ever get this running on a Mac? can something be changed to make it run?
john
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Developers' Forum
|