3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Sliders Plugin - Oh No! not more Dll's  (Read 3323 times)

jestermon

« on: July 02, 2010, 06:12:43 PM »
After settling on AutoIt to do the user interface for the GUI dll, and getting everything running smoothly, I hit the age old problem of lost focus. When any dialog other that 3D Rad has focus, the game pauses until it gets mouse focus again. I thought I could live with this, but found it such a pain in the �you-know-what�, and that all the effort seemed a total waste of time.

I left the problem to work itself out somewhere in the recesses of my mind, and carried on with other more important things... While putting together some screen assets for my current game, I got to thinking about the silly focus problem again.. and decided to rather use Rad itself as an interface, and put together a plugin for the job.

So here we have it at last.. A plugin that uses 20 sliders that can simply be merged into any project, and give instant feedback. It uses the RadScriptGlobals dll which now works after ironing out all the bugs.

How it works

Merge the plugin project into the test project that you wish to use sliders with

Use the Slider test script as a template in order to set up the slider values in your own scripts

You call setupSlider(int index, float min, float max, float value, string label) function which passes the required info to the  RadScriptGlobals dll. The dll is monitored by the plugin controller script, and then displays the sliders you requested.

There are 20 sliders in all, and you refer to them by index (0 to 19).

Only the sliders that you request will be displayed, and will give immediate feedback to your script via the dll

In the test script, the following is used to set up 3 sliders

setupSlider(0,0,30,15,"Frequency");  //Particles  Fequency
setupSlider(1,0,5,1,"Lifetime" );    //Particles  Life-Time
setupSlider(3,0,1, 0.5,"Opacity");   //TextPrint Opacity

The dll is monitored by your script, to pick up the changed values, and pass them onto whatever item it is you wish to control.. The test script use the results in the following manner.

OUT_0 = getSliderValue(0);  //particles frequency
OUT_1 = getSliderValue(1);  //particles lifetime
OUT_44 = getSliderValue(3); //text opacity

You can either rename the test script and modify it for your own needs, or you can delete the test script after using it's code for a reference.

Happy sliding :)
« Reply #1 on: July 03, 2010, 05:34:51 AM »
Very nice Jestermon. It's a nice resource. :)
Have one request if I may :
If you're moving the cursor too fast the slider stops and I need to go back to pick it up. So you need to be very careful and move cursor slowly.
It should move even if you're not at mouseover until you release the mouse button or you're way off range.

jestermon

« Reply #2 on: July 03, 2010, 05:37:26 PM »
Done.
New version allows sliders to be dragged as fast as you wish..
As long as the mouse button is held in, you can drag the mouse all over the screen, but the slider bar is bound within the slider limits.
Also added a scalable fish to the slider test script.
Slide On !!
« Reply #3 on: July 04, 2010, 03:35:00 AM »
Perfect!
Thanks :)

EDIT: Also RadScriptGlobals.dll, very useful :)
« Last Edit: July 04, 2010, 04:07:54 AM by shadmar »

jestermon

« Reply #4 on: July 04, 2010, 08:17:01 AM »
Perfect!
Thanks :)
EDIT: Also RadScriptGlobals.dll, very useful :)
I don't think everyone realizes that RadScriptGlobals.dll allows one to pass strings and floats between scripts and levels.(1024 of each).. The final fix to this question... For those that are interested ... And it WORKS .. lol
« Reply #5 on: July 04, 2010, 12:21:00 PM »
I don't think everyone realizes that RadScriptGlobals.dll allows one to pass strings and floats between scripts and levels.(1024 of each).. The final fix to this question... For those that are interested ... And it WORKS .. lol

Great DLL, this will also help making addons, just hide main scripts and use globals, then you only need a configure script that can set globals :)

jestermon

« Reply #6 on: July 04, 2010, 01:29:06 PM »
Another thought occurred to me. One can build persistence into the Gloabals as well. By setting a flag of some sort, it can save and load to a "named" configuration file, in order to maintain this persistence. Almost like a counter object with text and values; but 1024 of them, all in one go :)
« Reply #7 on: July 04, 2010, 01:35:08 PM »
Yeah that would be a great addition. :)

jestermon

« Reply #8 on: July 05, 2010, 07:28:43 PM »
......just hide main scripts.....
You mean there is a way of "hiding" scripts.. I don't quite follow this statement.
« Reply #9 on: July 05, 2010, 10:01:37 PM »
......just hide main scripts.....
You mean there is a way of "hiding" scripts.. I don't quite follow this statement.
in 6.48 you can author 3drad addons so that means you can permanently hide objects you don't need/want the user to modify. This and here explains it better, but it is a massive improvement in keeping the object list free of clutter aswell. you should be able to go crazy with all your contributions jestermon  :).
using 3Drad 7.22

system specs:
Windows 7 Home Premium 64-bit
Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz (4 CPUs), ~3.2Ghz
8 gig ram
Geforce GTX 650 1024 MB GDDR5
DirectX 11

jestermon

« Reply #10 on: July 05, 2010, 10:36:06 PM »
Aha.. Thanks genetransfer.. My "super-addons" will have to wait a few months then, But I'll still release tools others can apply with this ... As psikoT says "i love this (....)"
« Last Edit: July 05, 2010, 10:38:05 PM by jestermon »
« Reply #11 on: July 11, 2013, 10:31:30 PM »
Here I am trying to make a game that's not too complicated but every time I look up a new resource, its just what I need!  This is the absolute thing I need for making a vehicle editor.

Question though:  If I used a slider to change, say, the width of a vehicle, would I need to use a save function to let the character use the modified version of their vehicle upon exiting the editor? (it would be a separate 3drad project obviously)
Pages: [1]