3dvisuals dude's Flying Saucer w/HUD

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.

3dvisuals dude's Flying Saucer w/HUD // Scriptorium

1  2  3  4  5  6  |  

Post by trueBlue // Sep 17, 2007, 10:33pm

trueBlue
Total Posts: 1761
pic
Here you go Mark. Not real happy with the controls as they stand. Would rather have used Widget Components. Maybe somebody can offer some ideas here. You can enter the UFO in two ways, one through the button on the panel in the Link Editor or Left Mouse Button select the Landing area under the UFO. There is two sets of buttons for the HUD, one for the Camera for looking around and the others for moving the UFO. You can adjust the speed numbers globally for each set of buttons. Each click of the Left Mouse Button moves each transformation by the number you enter in their Speed edit box. So say you want to rotate the UFO in 45 degree increments, you would set the Speed to 45. Right clicking each set of buttons will reset the the default settings.

Post by frootee // Sep 18, 2007, 2:17am

frootee
Total Posts: 2667
pic
hi trueblue. Nice!

The saucer only moves on mouse clicks; what about holding the mouse down, so it can move more smoothly?
Perhaps using a mouse listener would do the trick.


also, in the UFO node, how to you create the Transform node? I've seen that a lot. I am guessing use a Node.Create call.

EDIT: Found it:
Node.Create('Space 3D Package/Transform', '/Project/Space 3D')

Froo

Post by trueBlue // Sep 18, 2007, 6:52am

trueBlue
Total Posts: 1761
pic
As I said I was hoping to use Widget Components to LMB click and drag for smooth movement. I have not figured this approach out yet but this example is the bases for that. Well at least the buttons are there. There is also an example in the Animations library that could be utilized as well. Check out TBirds in Motion. Anyway I put what I have so far here in the hopes that somebody else could help with it. BTW this started out as a way to look around when Avatar is viewing from a Camera and lead to moving the object around to as a plus. Not a very good solution but has possibilities.

Post by frootee // Sep 18, 2007, 6:59am

frootee
Total Posts: 2667
pic
Yep, this is a good start. I like the HUD display interface.

It will be interesting to get this under smooth control. One idea which I believe 3dv mentioned before is to have races between two or more of these. Or maybe a demolition derby.


EDIT:

I am more than happy to take up the challenge. :=D

Post by Emma // Sep 18, 2007, 9:13am

Emma
Total Posts: 344
pic
Wigand's great Joystick script and this flying Saucer, couldn't resist :)


attached is a snapshot showing that with my joypad I can control that thing


Just cut out the 4 parts of the joypad script shown below and connect it to the UFO


hmmm, speed needs a real value but Joystickcontroler gives only integer,OK, converting script


8483


hmmm, which Spagethi should I connect now to cetchup and which one to the speed control, guess I'll have to search through this some more:D


till then, Houston I'will have a problem if connections are wrong ..............

Post by frootee // Sep 18, 2007, 10:16am

frootee
Total Posts: 2667
pic
question emma:


the joystick itself: Does it provide input continuously (periodically putting data on the bus), or is it a single-shot type of control, like a button?

If it is a continuous type of control, may I suggest connecting the output from the POSX, POSY, POSZ to the movement inputs on the saucer?


Also, it looks like we have nodes for: 1) Move UP 2) Move Down 3) Move Left 4) Move Right


I am assuming that positive POSX values mean, the joystick has moved right, and negative POSX values mean the joystick has moved left.

If this is the case, we could add a couple Binary math nodes between the ReadJoystick node, and the Move UP/Down/Left/Right nodes:

The math nodes would do a comparison: If Input is < 0 (negative), activate a Move Down node. If Input is > 0 (positive), activate a Move Up node.


Actually I think we would need 2 math nodes in series: The first would perform as described above.

The second would invert the output of the first node (multiply by -1). That way, we simultaneously activate a Move Down, and deactivate a Move Up, for example.

Post by Wigand // Sep 18, 2007, 10:34am

Wigand
Total Posts: 462
pic
question emma:


the joystick itself: Does it provide input continuously (periodically putting data on the bus), or is it a single-shot type of control, like a button?

If it is a continuous type of control, may I suggest connecting the output from the POSX, POSY, POSZ to the movement inputs on the saucer?


.



3 axes are continuously as the timer controls the readout.

But the buttons are firering like mouseclicks on your buttons.

Post by frootee // Sep 18, 2007, 10:36am

frootee
Total Posts: 2667
pic
OK. Thanks Wigand.


Then the joystick POSX,Y, and Z ought to be connected to the movement inputs I would think.


I don't have truespace here at work but Man Do I wish I did right now! :)

Post by Emma // Sep 18, 2007, 10:39am

Emma
Total Posts: 344
pic
The joypad I'm using is a Saitek P880, dual Analog so I can switch between digital (On/OFF) or analog = numeric value


I've got two analog sticks, 8 buttons and one digital pad



At the moment I'm trying to understand that spaghettie I can see so can not give any answer how to correctly connect now. What I can say though is, if this is supposed to be universal, we need


- a script that connects in kind of a matrix the buttons of any Joystick or joypad to the correct output


You can test very well wich button goes to which output. My Saitek goes along with the numbering Wigand used, but I can imagine this may be different for others, means you push button 1 on your joystick but output 5 gets activated in the script.

So the Saitek has a shift Button to convert Button 1 to 2, 2 to 8 and so on, but that doesn't work for example. The shift button gets shown as # 11 and #1 still stays as # 1. So the change has to be calculated by the script, means

Button 8 (shift) is set to ON

- button 1 now changed to 12

- button 2 now changed to 13

.....


So there is a lot you can do, but it has to be programmed. AT the moment I have no idea if there is a typical standard layout for oysticks and Joypads or if there is a numerous variation out in the wilderness.


Anyway this opens more than just a step on the moon if enhaced.


OK, back to anyalyzing spaghetti and cetchup and oh, what the heck is that :D


EDIT: in the converting script for example there could also be included a recalculating to set upper and lower value, the Saitek give me between +/-32767

Post by trueBlue // Sep 18, 2007, 10:58am

trueBlue
Total Posts: 1761
pic
What I have here would not work with joystick. You would need to Read and Write to Object. Look at Dele's scripts where he has an InMatrix as an example. Actually look at Wigands Crane example. Back to building Grandkid's two story fort. :D

Post by Emma // Sep 18, 2007, 11:28am

Emma
Total Posts: 344
pic
Thank's trueBlue, for pushing down from the cloud :D


Just checked the Grandkids building and located Saucer. If I expand the Matrix there and connect now the POS* to yaw or roll I can move the Saucer. Of course it just turns on place so some more has to be built there. What do you think, adding a "new part to the building" at these Matrix inputs, could that glance up Grandkid's two story fort to the moon rocket ?

Post by frootee // Sep 18, 2007, 11:33am

frootee
Total Posts: 2667
pic
Connect the POS* to tx, ty, and tz;

use the buttons for rotation?

Post by Emma // Sep 18, 2007, 11:48am

Emma
Total Posts: 344
pic
Yes, that works, cool, :jumpy: had to change the formular though to


.... = ( integerIN * 1.0) / 1000.0;


that way I get values of +/- 326


Can fly around with the saucer, cool.


Anyway, this is static, means when I release the joypad it returns to initial position. So what trueBlue said, it needs some code to "push" the saucer when the values of the joypd/joystick changes.


Too bad, midnight over here now, so I have to continue tomorrow, wherever you will end then :D

Post by frootee // Sep 18, 2007, 11:53am

frootee
Total Posts: 2667
pic
ah I see. so when you release the joystick, it returns to zero. Then we need a trigger-and-hold configuration.


Great work Emma! Thank You!


Froo

Post by 3dvisuals dude // Sep 18, 2007, 1:43pm

3dvisuals dude
Total Posts: 1703
pic
WOW.

Thanks for all the work you've done on this trueBlue, Frootee, Emma, and Wigand... looks like we may just get this thing running for us all to have fun with soon thanks to all your efforts.

Great work and deeply appreciated. Wait 'till the Cummunity here starts flying around for the first time on their own is shared space.... the reaction that day will be a genuine reward indeed.:)

Well done and thank you all.

- Mark / 3dvisuals dude

Post by Délé // Sep 18, 2007, 1:48pm

Délé
Total Posts: 1374
pic
Nice start trueBlue! :) :banana:

Interesting project here guys. I wish I wasn't so busy. For the joystick, you said it works like a button that keeps getting pressed right? Would it be possible then to just check the value that it's outputting and increase or decrease it depending on which way the joystick is moving?

Here is a simple timer script to demonstrate what I'm talking about. It checks the "Timer" output value and increases or decreases the value by the "Speed" amount depending on if the "Reverse" is checked or not.

Just start the timer and it will either count up or down each time it's executed. It will continue from where it last left off. I haven't looked closely at everything yet but perhaps this same method will allow the joystick to continue from where it leaves off.

Post by Wigand // Sep 18, 2007, 5:13pm

Wigand
Total Posts: 462
pic
Nice start trueBlue! :) :banana:


Interesting project here guys. I wish I wasn't so busy. For the joystick, you said it works like a button that keeps getting pressed right? Would it be possible then to just check the value that it's outputting and increase or decrease it depending on which way the joystick is moving?


Here is a simple timer script to demonstrate what I'm talking about. It checks the "Timer" output value and increases or decreases the value by the "Speed" amount depending on if the "Reverse" is checked or not.


Just start the timer and it will either count up or down each time it's executed. It will continue from where it last left off. I haven't looked closely at everything yet but perhaps this same method will allow the joystick to continue from where it leaves off.




Isn't this problem already solved by my JoystickCtrl object? :rolleyes:


You can change the factor for each axe.

The Min and Max

The limit for the joystick noise

And you can reset the position to zero

Post by 3dvisuals dude // Sep 18, 2007, 6:52pm

3dvisuals dude
Total Posts: 1703
pic
Isn't this problem already solved by my JoystickCtrl object? :rolleyes:

You can change the factor for each axe.
The Min and Max
The limit for the joystick noise
And you can reset the position to zero

Hi Wigand,

Since you didn't make it to tonight's Script Live meeting in the truePlaces meetingroom I just wanted you to know that many of us are very excited about how much fun this will be when we all have the ability to fly this saucer and vehicles like it on our own in truePlaces.

Many of us tried out this saucer tonight and had a lot of fun with it. trueBlue's HUD is a very cool interface device too!

Roman went into the saucer tonight too, flew around in it a bit and really enjoyed it a lot. Now he's very excited to hear that several of you folks are working on enhancing it and that you have made it possible to control the craft with a joystick. He said he's going to go get a joystick himself now just because of this! (So am I and so is Frootee!)

We all had a lot of fun with this and I see there is a great deal of potential in your earlier scripts to do far more with vehicles than we have tried to do yet, so I am very happy you have also taken an interest in this project as well.

Thanks for all your groundbreaking scripting work over the last year. It is all very pioneering stuff indeed and deeply appreciated by many of us, especially now that the potential of actually using such scripts ourselves for fun online group activities is swiftly becoming a reality for us all.

We're all starting to wake up now, together.:)

- Mark / 3dvisuals dude

Post by trueBlue // Sep 18, 2007, 7:23pm

trueBlue
Total Posts: 1761
pic
Isn't this problem already solved by my JoystickCtrl object? :rolleyes:

You can change the factor for each axe.
The Min and Max
The limit for the joystick noise
And you can reset the position to zero
Using a Joystick is great! Can you check your Joystick out in Shared Space? I could have very easily made this with Keyboard Keys but this does not work in Shared Space. Again it is my hope that we will be able to use Widget Components to control movement with HUD. This would eliminate the need for a Timer I would hope.

Post by Emma // Sep 19, 2007, 5:55am

Emma
Total Posts: 344
pic
Attached is an RsRcd shot of playing shortly around with the Joystick.


- when you start it first an error pops up, just click OK


- now the UFO should fly around and stay at the end in it's initial position


Changed the devider to 2000.0 instead of 1000.0 so it will not disappear too much out of the scenerey. I'll try Dele's timer script next to see. This is just a teaser to get people interested in investigating for exploration of scripting.


Sorry if I kind of hijacked trueBlues HUD control so think it's important to say: Joystick or pads can only be used for , let's say, not so precise control, like flying from earth to moon. When trying to get the lander down so first step on moon can be done, you will definitely need something the way he showed. With single klicks on the direction triangles you can then very precise launch the lander.

Post by frootee // Sep 19, 2007, 6:02am

frootee
Total Posts: 2667
pic
Hi Emma. I'll check this out when I get home tonight.

I'll second trueblue's question. Have you tried the joystick in shared space? If not could you check it out and report back? (Too bad I can't install truespace here at work... :p


Froo

Post by Emma // Sep 19, 2007, 6:13am

Emma
Total Posts: 344
pic
Have you tried the joystick in shared space


Sorry, no .

If you tell me how I get this into shared place, because I don't know anything about that.:o


Perhaps Wigand knows and will do it, I'll be on the road for the next two hours.;)

Post by frootee // Sep 19, 2007, 6:26am

frootee
Total Posts: 2667
pic
Hi Emma and Wigand.


Encapsulate the saucer and joystick objects together in the LE by left clicking and dragging around the saucer and joystick controller.


Then click the Encapsulate tool, then type a name for the new object in the LE (a window outline with a title bar will appear around the objects)


Then save this new object as a .RsObj file.


Then login to Shared Space by clicking the icon that looks like two avatar heads, and typing your login name. This is usually your forum name and password credentials.


Once you get logged in, click the Meeting Room icon. You will actually be taken to a rather blank area; this is a good testing ground. In that room, there will be a small bar that says something like, "Click here to go to the meeting Room". Click on that if you want to get to the meeting area with all the cool gadgets.


Once in your destination, load the RsObj file, and use it as you would on your own PC.


HTH and Thanks for all your effort!


BTW have a safe trip!


Froo

Post by Wigand // Sep 19, 2007, 8:41am

Wigand
Total Posts: 462
pic
I tried what you said, but I have no experience with this meeting room.

I uploaded my object and could see it in LE but not in the room.

I think I have to make some changes to my objects.


Edit:

Now I see all of my objects, but I can't move them.

And the timer don't start.


Edit:

Maybe function set is not possible?

Post by frootee // Sep 19, 2007, 12:00pm

frootee
Total Posts: 2667
pic
I'll give this a shot tonight. I have to hook up my joystick (old Thrustmaster Mark II) :-D


Froo

Post by frootee // Sep 19, 2007, 3:41pm

frootee
Total Posts: 2667
pic
well I can't do much about this right now unfortunately, because my joystick is a 15 pin connector; my PC has a 9 pin serial connector. Apparently at some point in time I either lost or discarded the adapter. Durnit.


I will have to purchase one tomorrow. Dang!@


Froo

Post by frootee // Sep 20, 2007, 2:05am

frootee
Total Posts: 2667
pic
Is there a general issue with using a timer in Shared Space? I did an experiment using a mouse listener, a binary op, and a timer. The idea was similar to trueblue's Widget Component thought, where a click and drag would result in continuous motion. The trouble was, when I released the mouse button, the timer Activate connector did not get disabled, as it does on my PC. The only way to disable the timer was to disconnect the activate connector on the timer and manually click the Activate checkbox.


here is a quick sample scene so you can look at it in the LE.


Froo

Post by 3dvisuals dude // Sep 20, 2007, 7:33am

3dvisuals dude
Total Posts: 1703
pic
The Servers probably don't have mice let alone joysticks so the common issue there may be no more than that.

Mark

Post by Wigand // Sep 20, 2007, 7:37am

Wigand
Total Posts: 462
pic
The Servers probably don't have mice let alone joysticks so the common issue there may be no more than that.



Mark


Sorry Mark,

I did not understand what you said :confused:

Post by 3dvisuals dude // Sep 20, 2007, 7:51am

3dvisuals dude
Total Posts: 1703
pic
Sorry Mark,
I did not understand what you said :confused:

Hi Wigand,

I was thinking that maybe the reason both the joystick approach (which now works fine offline) and Frootee's "mouse listener" approach (which also works fine offline) not working on the online Server could be that the Server hardware which Caligari Shared Space uses probably has neither a mouse nor a joystick attached to it.

If it did have a joystick attached to it and someone were to install your "joy.dll" to it, it may work perfectly online just as it does offline. The same holds true of Frootee's approach, it uses a "mouse listener" on a Server which in all likelyhood has no mouse DLL installed nor a mouse attached, which would very likely lead to related Server processing conflicts with a mouse related script on it.

Sorry for any confusion, just seems logical to me. Nice scripts by the way!

- Mark / 3dvisuals dude
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