Vbscript to make Win API DLL Calls from trueSpace

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.

Vbscript to make Win API DLL Calls from trueSpace // Scriptorium

1  |  

Post by 3dvisuals dude // Sep 14, 2007, 5:02pm

3dvisuals dude
Total Posts: 1703
pic
Hi folks.

As some of you know I used to program in Liberty BASIC where I would occasionally utilize internal DLL Calls from my programs to the Windows API in order to harness a few of the inherent powers of the Win API for my programs instead of re-inventing the wheel with some kinds of routines.

One of those routines involves calls to the Win API DLL's for various graphics "BitBlit" type operations on two dimensional bitmaps. There are a pretty vast number of effects one can accomplish very easily with 2D Graphics inside a program which utilizes the BitBlit functions of the Win API Dll's, and I have a few ideas on related ways we could all enhance both trueSpace workflow and scripted special effects by doing this from inside trueSpace VBScripts. What I don't know yet, is how to access a Windows DLL from inside trueSpace Scripts though. If I had one single working example as a template I'd be all set with all of this though.

So does anyone know of any existing trueSpace Script which makes any internal call of any kind to a Windows (non-trueSpace) DLL or OCX file?

Thanks for any help,

- Mark / 3dvisuals dude

Post by Emma // Sep 14, 2007, 9:07pm

Emma
Total Posts: 344
pic
Take a look at Wigand's scripts where he calls his self programmed ActiveX controls to:


- control a crane with external Joystick, Joypad, etc

- make an UDP connection between two trueSpace users over internet

- control a MIDI device by trueSpace

- control objects of another user inside his running trueSpace, even over internet


You can find them in the Interactiv thread and some additonal discussions in the scriptorium


Problem though, the mechanism of globals has changed in 7.51 so you will not be able to run his old scripts in 7.51 without modifications (sorry, don't know yet what to do there, perhaps the real experts can tell)

Post by 3dvisuals dude // Sep 14, 2007, 10:23pm

3dvisuals dude
Total Posts: 1703
pic
Take a look at Wigand's scripts where he calls his self programmed ActiveX controls to:

- control a crane with external Joystick, Joypad, etc
- make an UDP connection between two trueSpace users over internet
- control a MIDI device by trueSpace
- control objects of another user inside his running trueSpace, even over internet

You can find them in the Interactiv thread and some additonal discussions in the scriptorium

Problem though, the mechanism of globals has changed in 7.51 so you will not be able to run his old scripts in 7.51 without modifications (sorry, don't know yet what to do there, perhaps the real experts can tell)


Thank you Emma!

That is all very helpful indeed, now at least I have a starting point for deeper research, and from the sound of it Wigand made quite a bit of progress in these methods as well. Although his work may be somewhat dated now a few of his methods may still be quite usable with slight modifications for the less ambitious projects I have in mind, so at least I'll have a good place to begin further research now.

Thank you for taking the time to help me with that, I do appreciate it a great deal.

- Mark / 3dvisuals dude

Post by Emma // Sep 14, 2007, 11:22pm

Emma
Total Posts: 344
pic
We enjoyed playing around with it. To use the joystick for steering the crane was just an initial idea of Wigand. Further applications would have been car driving, air planes, games, but then came 7.51:( The new dev docs though seem to be coming to light meanwhile as I follow the discussions about script programming in the forum. So it could be time to return back to that idea.

Post by Wigand // Sep 15, 2007, 1:49am

Wigand
Total Posts: 462
pic
Nice to see more people be interested in

DLL-Interface-Technics.

Yes, it was an easy way to implement some

self written dll's into TS. But like Emma said,

the 7.51 version changed its behaviour.

There was no information about what had been

changed. Since that time I put all of my projects

on ice.


a. It could be a security problem of Caligari.

b. It could be a sales strategy.


I really don't know, I got no answers.


But one thing I can say, maybe it helps you a little.

For many self-programmed dll's (to use in TS) you need

the program or window-handle of TS. Then you can send

information between TS and your program. The last weeks

I had not the time to look for this handle in the

manual and nobody helped me. Maybe someone else find

this information.


Greetings and good luck


Wigand

Post by 3dvisuals dude // Sep 15, 2007, 12:19pm

3dvisuals dude
Total Posts: 1703
pic
Wow!

Thanks for all the help Wigand and Emma!

I understand that there do exist valid security issues, but on the other hand these issues are already specifically and effectively addressed by the fact that no one can utilize any malicious code via these methods without leaving a very clear path directly to their computer when accessing these specific server networks. In fact the path cannot even be effectively masked by those with genuinely malicious intent, so they would be setting themselves up on the losing side of an immediate and potentially formidable lawsuit to even attempt such things in this case. All that is a good thing, since all we are attempting to do here is enhance Caligari products rather than interfere with them. So all potential security issues are essentially irrelevant.

In all honesty I believe the changes are likely due to ongoing core rewrite enhancements rather than these other possibilities anyway, which would also explain why no one would be willing to openly discuss them given that the specific nature of these core advances is no doubt a highly guarded Corporate advantage. I realize this would lead to related frustration for those of us seeking to enhance these products through our own efforts, but I wouldn't take their related silence personally, it actually makes sense if my assumptions above are accurate.

Regarding the "window-handle of trueSpace" perhaps this image below will help?

Thanks for your help on these things, you have both made my related learning curve much more focused, and that helps a great deal!

- Mark / 3dvisuals dude

Post by Emma // Sep 15, 2007, 12:47pm

Emma
Total Posts: 344
pic
Well, actually if you take the crane script for example, there Wigand has a


- Start/Stop node ,

- timer node,

- Read Joystick node

.....


Inside the Start/Stop the connection to the DLL is set and passed on to the Read Joystick node - this doesn't work anymore. There are new commands and a new mechanism for this.


Start has to be clicked first, then the timer has to be started and after that the Joystick/Joypad works, one can see the marks for corresponding buttons when pressed (when it works )

Post by 3dvisuals dude // Sep 15, 2007, 1:01pm

3dvisuals dude
Total Posts: 1703
pic
Well, actually if you take the crane script for example, there Wigand has a

- Start/Stop node ,
- timer node,
- Read Joystick node
.....

Inside the Start/Stop the connection to the DLL is set and passed on to the Read Joystick node - this doesn't work anymore. There are new commands and a new mechanism for this.

Start has to be clicked first, then the timer has to be started and after that the Joystick/Joypad works, one can see the marks for corresponding buttons when pressed (when it works )

Thanks again Emma!

I will definitely have a deep look into all these scripts of Wigand in an effort to discern workable approaches. Perhaps the new command sets which Vladimir provided and Norm posted here may be of use to breath new life into Wigands scripts as well now!

In all honesty I am a little ahead of myself in bringing this whole "Win API DLL access" subject up here at this point, I do plan to directly pursue it but at the moment I am still concluding other pressing projects which unfortunately prevent me at this time from focusing all the attention to this new issue which I do intend to focus on immediately thereafter.

It's kind of funny, I wasn't expecting such a rapid response to my opening post on this! Now you have me ready to pursue this and I wasn't expecting that so soon at all!

Thanks you so much Emma, and also Wigand! You two have made this a lot easier to approach now for me and I thank you for that and for "breaking new ground" on all these things so long ago here and without the benefit of adequate documentation at that time too! Your pioneering here has proven very valuable to all us "latecomers," and I thank you both a great deal for that!

- Mark / 3dvisuals dude

Post by Emma // Sep 15, 2007, 1:10pm

Emma
Total Posts: 344
pic
I wasn't expecting such a rapid response to my opening post on this!


Well, in fact I wasn't very happy about those scripts not working anymore. We had lot's of ideas what for to use all of Wigands scripts, as I said, car race, air plaing flights and others. There never came an answer to the questions. One of the goal was to connect the 3D Connexion SpaceNavigator to trueSpace, something quite a few have been asking for.

Post by 3dvisuals dude // Sep 20, 2007, 6:52am

3dvisuals dude
Total Posts: 1703
pic
Well, in fact I wasn't very happy about those scripts not working anymore. We had lot's of ideas what for to use all of Wigands scripts, as I said, car race, air plaing flights and others. There never came an answer to the questions. One of the goal was to connect the 3D Connexion SpaceNavigator to trueSpace, something quite a few have been asking for.

I apologize for taking so very long to respond to this Emma. I've been so busy with other projects (which are now essentially finished for the time being) that I have been popping into the forums here over the last few days only for a few minutes at a time and have missed many posts and responses here, including this one. Not an excuse, but it is the truth!:o

I see now that Wigand has already successfully adapted Vladimir's new global function set approach with his earlier scripts. The only issues he appears to be still having now in relation to those same scripts are technical issues in relation to the way in which the Caligari Shared Space Servers are set up.

These same scripts now work offline just fine, and I do believe that with a concerted approach made by all of us (including Roman and Norm) we will in fact arrive at a solution to implementing Wigand's joystick-related scripts even on the Caligari Shared Space Servers.

I do believe you and Wigand were "ahead of the times" before. I also believe that "the times" have now caught up to where you two were previously, in that as a Community we are now becoming genuinely aware of the plausibility of implementing avatar vehicular transport in multi-user online spaces, and that as a Corporation, I believe Caligari is also becoming aware now of the actual competetive practicality of doing so as well. A good combination.;)

If we all strive hard enough and stand together with you two on these longstanding visions of yours, I believe together we will accomplish this and a great deal more in the months ahead. We may be latecomers, but we are with you now all the way.

Thanks for taking all this up again and joining with us in this latest initiative. Perhaps at long last we will all now pull together to help you accomplish the great potentials which you two have already seen for a very long time.

- 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