JetPack Navigation

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

JetPack Navigation // Scriptorium

1  2  |  

Post by Délé // Dec 5, 2007, 9:00am

Délé
Total Posts: 1374
pic
I was messing around a bit this morning and found a way to simulate an Anti-Gravitational JetPack style navigation. I think it might be cool to have JetPacks in shared space. Still need to figure out how to attach the actual JetPack to the avatar though.


Attached is a test scene. If you go somewhat near the blue trigger in FPN mode and press the use key (P), it will activate JetPack navigation. You can move forward, backward, left, and right using the standard WASD keyboard controls just like in FPN mode.


You use the Q and E keys to ascend or descend. Once you start moving up or down you will keep flying in that direction. You must use the opposite control to slow down or stop. It takes a little practice to fly around good, but I've found that after a little bit it's actually kind of fun and works pretty good. There is a tall cube in the scene to help keep you oriented when flying.


After you're done flying around, be sure to fly back down near the trigger and press the use key again to deactivate JetPack Navigation. If you don't deactivate JetPack Navigation, it could cause problems (read warning below).


It might be fun to set up an obstacle course to fly around in. Maybe have races or something. :) Although, I haven't tested it in shared space yet to see if it works.


Warning: This works by linking into the EyeCam. So make sure you deactivate JetPack mode before starting a new scene or opening another. If you don't, some of the links may remain and you'll have to reset to default context to get it back to normal.

Post by trueBlue // Dec 5, 2007, 11:50am

trueBlue
Total Posts: 1761
pic
Very cool idea Dele, fun too!
I am not able get the Q and E keys to initiate without some coaxing, which I believe is to navigate over the trigger again.
When I did I was only able to travel up and not down.
I think that this version is missing the Deactivate command for the disconnect.
Thanks for sharing and making tS7 and tP more fun and interesting. :)

Post by Délé // Dec 5, 2007, 1:34pm

Délé
Total Posts: 1374
pic
Thanks trueBlue. :) I also think I found a way to assign more then one key to triggers too. Well, kind of. It's a workaround. We should be able to set it up so that you can use key combos with the P key. So the P key alone can execute one block of code, O + P can execute another, I + P can execute yet another, etc. It's not the ideal solution, but should allow a single trigger to perform multiple tasks.

I am not able get the Q and E keys to initiate without some coaxing, which I believe is to navigate over the trigger again.I'll have to look into that. I don't think I've experienced that yet. Might be that you have to move a little first since it uses the watchdog event. Not sure.

I think that this version is missing the Deactivate command for the disconnect.The trigger is supposed to work like a toggle. The first time you activate it, it should hook everything up. The second time it should disconnect. I might have to tweak that a bit yet.

Post by trueBlue // Dec 5, 2007, 2:28pm

trueBlue
Total Posts: 1761
pic
Great! Being able to use more then one key would open up alot of doors.
Thinking out loud and I have not tried this yet. Since you can enter more then one command in a Activate or Deactivate trigger, I was thinking about trying out a script that disconnects the trigger and connects to an additional trigger with different commands and then hook back to the original. Could be a toggle or even a multiple switch for even more triggers. Could be tricky but you might be able to switch from Usage and Distance too in the right scenario. Does this make any sense? I think I need a nap. :rolleyes:
Is your Avatar dreaming?

Post by Délé // Dec 6, 2007, 3:23am

Délé
Total Posts: 1374
pic
Yeah, I think I get what you're saying. Interesting idea. Definitely worth a go. That could open up some possibilities too. :)

Post by Délé // Dec 6, 2007, 4:26am

Délé
Total Posts: 1374
pic
Cool, it looks like the combo key thing will work. Here is a proof of concept scene. If you are near to the trigger and press certain key combo's, it will scale or rotate the cube.


Here's the combo's:

I + P = Scale to 5 in X axis

U + P = Scale to 1 in X axis

Y + P = Rotate to 45 degrees in Yaw

T + P = Rotate to 0 degrees in Yaw


So that's cool, triggers can now execute multiple blocks of code with different key combo's. :)

Post by frootee // Dec 6, 2007, 4:37am

frootee
Total Posts: 2667
pic
Nice Dele!


Froo

Post by 3dvisuals dude // Dec 6, 2007, 6:32am

3dvisuals dude
Total Posts: 1703
pic
There aren't words to describe how excitied I am about this new capability to access keypresses aside from the "Use / P" key through script without resorting to dll creation. Very well done Matthew, this is absolutely great!!!:banana:

It will also be a blast jet-packing around now in shared space, and I have no doubt we'll be doing that soon now too!:p

Thanks guy.... amazing contribution here to everyone and I'm definitely gonna have a lot of fun with all of this!!!:D

- Mark / 3dvisuals dude

Post by Délé // Dec 7, 2007, 4:51am

Délé
Total Posts: 1374
pic
Thanks guys. :) I actually got the keyboard code from Johny's Tetris game though, so he deserves the credit for that. I don't know where he figures this stuff out, but I'm glad he does. :)


One thing I was having trouble with though was figuring out the hexadecimal numbers for each key. I searched the web but got incredibly frustrated when I couldn't find a simple hexadecimal chart anywhere. Well, I did find a couple, but they were wrong. They didn't work.


Does anyone know of a chart that maps out the keyboard as hexadecimal?


I had to figure out some by hand. Here's what I did figure out so far:


A = OxO41

B = OxO42

C = OxO43

D = OxO44

E = OxO45

F = OxO46

G = OxO47

H = OxO48

I = OxO49


J - O = ???


P = OxO50

Q = OxO51

R = OxO52

S = OxO53

T = OxO54

U = OxO55

V = OxO56

W = OxO57

X = OxO58

Y = OxO59

Z = OxO5a


Other then that I have no idea. I would think that there has to be a chart somewhere.

Post by frootee // Dec 7, 2007, 4:57am

frootee
Total Posts: 2667
pic
J-O should be:


4A J

4B K

4C L

4D M

4E N

4F O


Here's a link to an ascii - decimal chart:


http://www.jimprice.com/ascii-0-127.gif


You would need to convert decimal to hex, but the Windows calculator can do that for you.

To do that, open the calculator, then select View.

In the drop down menu, Select: Scientific.

There are radio buttons for Hex, Dec, Oct, and Bin.

To convert from Dec to Hex, select the Dec radio button

Then type in your number

Then select the Hex radio button.

The number is then displayed in hex format.

To convert another number from dec to hex, make sure you select the Dec radio button again!


HTH!


Froo

Post by trueBlue // Dec 7, 2007, 5:35am

trueBlue
Total Posts: 1761
pic
Does anyone know of a chart that maps out the keyboard as hexadecimal?

Would this be it?
Virtual - Key Codes:
http://msdn2.microsoft.com/en-us/library/ms645540.aspx

Post by Délé // Dec 7, 2007, 5:54am

Délé
Total Posts: 1374
pic
Thanks guys. :) :banana: Between those two links I think I got it now. I didn't know about the conversion. I'm still surprised that there isn't a clear chart anywhere though. That MSDN link has a lot of stuff, but I don't see the Letter keys. :confused:

Anyway, I should have it down now thanks you to guys. Perhaps I'll whip up a simple chart and post it for easier future reference. :)

Post by trueBlue // Dec 7, 2007, 6:22am

trueBlue
Total Posts: 1761
pic
Yes I am still looking for the one I used a long time ago.

Post by frootee // Dec 7, 2007, 6:34am

frootee
Total Posts: 2667
pic
You know, maybe to make things interesting you could make a little decimal to hex convertor, so you can use decimal, and have the convertor output the hex value.


Thanks guys. :) :banana: Between those two links I think I got it now. I didn't know about the conversion. I'm still surprised that there isn't a clear chart anywhere though. That MSDN link has a lot of stuff, but I don't see the Letter keys. :confused:


Anyway, I should have it down now thanks you to guys. Perhaps I'll whip up a simple chart and post it for easier future reference. :)

Post by Délé // Dec 7, 2007, 7:28am

Délé
Total Posts: 1374
pic
That's not a bad idea too there Froo.

Thanks for looking trueBlue. If you can't find it, that's cool. With the links you guys provided I should be able to easily make a chart myself. :)

Check this out guys. I'm not 100% sure if it will work for others or not. I think it will. I was playing with changing post process effects. Of course your computer must be capable of bloom and glow for this.

It's "Magic Sight". When you turn on your magic eyes you can see things in the scene that are otherwise not there. :)

In FPN mode:
O + P = Turn on Magic Eyes
I + P = Turn off Magic Eyes

If you try this, please let me know if it worked or not. I think it will, but I'm not sure.

Post by frootee // Dec 7, 2007, 7:38am

frootee
Total Posts: 2667
pic
Cool man! I will have to look at this tonight when I get home. Hm.... find the key, put it in the right spot (a puzzle). The hidden door opens. You find the magic goggles... use the P trigger to put them on... and walk around... then use the I+P to use them and you see hidden things... sweet!

Post by Délé // Dec 7, 2007, 7:48am

Délé
Total Posts: 1374
pic
Exactly. :) It's all kind of coming together now. It's completely possible to make a puzzle oriented FPN game in trueSpace right now. I've even played around a bit with creating inventories to keep track of what you have collected (keys, power-ups, etc.). With Glen making good progress on AI, it probably won't be long before we can add enemies and such too. :D

Post by 3dvisuals dude // Dec 7, 2007, 8:38am

3dvisuals dude
Total Posts: 1703
pic
I'm pulling a Jscript error on Line 7 Character 3 with Magic Sight, but I have a dinosaur video card so maybe that's the problem. It does change my bloom intensity though, but I don't see anything in the scene.

On a better note, I have something for you here... hope you like it, the name says it all!:D

- Mark / 3dvisuals dude

Zipped RsObj file below the screengrab image:

PS: There is an opening on the cube where you enter, but you will need to scale this puppy VERY big to enter this with a jetpack.... good luck!:D

Post by frootee // Dec 7, 2007, 9:01am

frootee
Total Posts: 2667
pic
Aw, Dude. We need a crash helmet for that one!

Post by 3dvisuals dude // Dec 7, 2007, 9:06am

3dvisuals dude
Total Posts: 1703
pic
Aw, Dude. We need a crash helmet for that one!

Hahahaha!!! Exactly!

We can also use this particular model for physics sims too, I had a talk in shared space with Norm ages ago about flushing Avatars through tubes with physics that we may be able to apply to this one too! Hahahaha!:D

I can hear the puns already!:rolleyes:

- Mark / 3dvisuals dude

Post by Délé // Dec 7, 2007, 9:10am

Délé
Total Posts: 1374
pic
Yeah, that looks like a pretty twisted course. :) Thanks Mark. I'll give it a whirl.


I tried the magic sight scene with a different layout and got the same error as you. Darn. :( I'll have to find another way to access the post process effects I think. I was hoping that would work. I'll mess around with it more and see if I can get it to work.

Post by frootee // Dec 7, 2007, 9:11am

frootee
Total Posts: 2667
pic
Yep. The trouble we always seemed to have with that sort of thing is collisions with the tube surface (our stuff always would stop at the beginning, due to friction?).

Now how would we correct that...

Post by 3dvisuals dude // Dec 7, 2007, 9:12am

3dvisuals dude
Total Posts: 1703
pic
Exactly. :) It's all kind of coming together now. It's completely possible to make a puzzle oriented FPN game in trueSpace right now. I've even played around a bit with creating inventories to keep track of what you have collected (keys, power-ups, etc.). With Glen making good progress on AI, it probably won't be long before we can add enemies and such too. :D

A similar game thought occured to me when I was first experimenting with your FPN hotkeys here. That cube scaling in front of me inspired it.

Ever see those doors in Egyptian mummy movies inside pyramids where you bump into something and a huge block in the wall suddenly slides revealing an entrance leading somewhere? We could use your code here to do that too by just reversing the same scaling method you used for your cube!

Great stuff all of this!

- Mark / 3dvisuals dude

Post by 3dvisuals dude // Dec 7, 2007, 9:16am

3dvisuals dude
Total Posts: 1703
pic
Yep. The trouble we always seemed to have with that sort of thing is collisions with the tube surface (our stuff always would stop at the beginning, due to friction?).
Now how would we correct that...

Actually in this particular case of using jetpacks to navigate that won't be an issue at all, but yeah, I remember that time in the Goldberg Scenario too.

The trick with this one will be scaling the whole deal large enough to maneuver, but once it is as big as Godzilla it should work just fine!:D

- Mark / 3dvisuals dude

Post by 3dvisuals dude // Dec 7, 2007, 9:20am

3dvisuals dude
Total Posts: 1703
pic
Yeah, that looks like a pretty twisted course. :) Thanks Mark. I'll give it a whirl.

I tried the magic sight scene with a different layout and got the same error as you. Darn. :( I'll have to find another way to access the post process effects I think. I was hoping that would work. I'll mess around with it more and see if I can get it to work.

I don't know if this will help but I recall seeing a post processing object in the LE one time when I opened a truePlay scene, and another time I saw the same object somewhere in the libraries of trueSpace. Maybe you could access the nodes on that object instead of going the direct path route all the way up through system? Not sure, but I hope that helps.:confused:

- Mark / 3dvisuals dude

Post by trueBlue // Dec 7, 2007, 9:24am

trueBlue
Total Posts: 1761
pic
Very cool idea! Red Bloom would be cool too when hit 6 Gs or die. :p
The path is wrong to the PostProcess node.
In the Default layout it should be:
"/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess"

truePlay will be different too as well as other layouts.
I would suggest that you copy the Default PostProcess settings so that you can set them back when done. Like this:

function Execute(params)
{
if (RsTool.GetAsyncKeyState(0x04f)) {
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Bloom intensity") = 1.77;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Highlight intensity") = 3;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Highlight Threshold") = 0.83;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Scene intensity") = 0.99;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Bloom quality") = 1;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Bloom downsample") = 1;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Bloom") = -1;
Node.Value(Space.CurrentScene() + "/Pharo", "Invisible") = false;
Node.Value(Space.CurrentScene() + "/Hotrod", "Invisible") = false;
}
elseif (RsTool.GetAsyncKeyState(0x049)) {
Node.Value(Space.CurrentScene() + "/Pharo", "Invisible") = true;
Node.Value(Space.CurrentScene() + "/Hotrod", "Invisible") = true;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Bloom intensity") = 0.300;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Highlight intensity") = 1.5;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Highlight Threshold") = 0.900;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Scene intensity") = 0.700;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Bloom quality") = 4;
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Bloom downsample") = 2
Node.Value("/Project/Windows Manager Space/Frame Window/Border Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 1/Split Docking Place/Frame Window, 2/Postprocess", "Bloom") = 0;
}
}

Post by frootee // Dec 7, 2007, 9:31am

frootee
Total Posts: 2667
pic
Wow. Trueblue hath Spoken.

Say trueblue... I have this mind meld machine... wanna link up? :D It's the fastest way to learn!

Post by Délé // Dec 7, 2007, 9:35am

Délé
Total Posts: 1374
pic
Yeah, I am changing the settings on the panel in the stack with the magic sight script. I wanted to access the node directly in the LE, but I can't find it anymore. I swear I remembered seeing it in the LE some time back. I wonder if it was removed in 7.51 or something. Or maybe I'm just imagining it. If I could access the node in the LE rather then the stack though, it should work properly.


Here is another idea for a course. I started this. If anyone wants to add to it or change it completely that's cool. I don't know how much time I'll have to work on it. I was thinking of creating floating rings. In each ring would be a trigger that would keep track of what rings you have gone through. That way it ensures that you go through the course correctly. The first and last rings could start and stop a timer that would keep track of your race time.


The tall cube in the scene can be deleted. It has no use. The scene is already set up to fly around in though. I have the jetpack trigger distance set to 500 so you should be able to activate and deactivate it pretty much anywhere in the scene.


9989

Post by trueBlue // Dec 7, 2007, 9:38am

trueBlue
Total Posts: 1761
pic
Wow. Trueblue hath Spoken.
Say trueblue... I have this mind meld machine... wanna link up? :D It's the fastest way to learn!
We both have the machine. It is the Vulcan jScript Macro recorder. :)

Post by Délé // Dec 7, 2007, 9:39am

Délé
Total Posts: 1374
pic
Thanks trueBlue. :) Yeah, I have a custom layout so it didn't record for default. I was hoping that it wasn't layout dependent but I guess it is. I would really like to find a better more consistent way to access the post process effects. I don't know if that would be possible right now. There should to be some way to access it without going to the stack though.
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn