Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,306 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Still can't build screensaver [Re: Felixsg] #265319
05/12/09 00:05
05/12/09 00:05
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK.
Ive managed to get an empty level to trigger sucessfully as a screen-saver in XP-pro.
I havent tried more complex than that yet as I only have commercial and cant create WRS's.
Heres how Ive done it.

I copied my EXE(renamed to SCR), my WDL, and acknex.dll to the C:\WINDOWS folder. (not system32)
The SCR file IS still found here automatically by Display-Properties, and it tries to activate it fine.
But my scr died from "twain.dll invalid image" error, so in the WDL, I put PLUGINDIR = "%";,
that way I needed no empty dummy directory, and it fires up OK.
Ive only got commercial, so it does a mini-compile splash-screen everytime something changes, or every time the
mini-preview window tries to draw, because our SCR app is being called separately each time.
I dont know if this will affect PRO users though. Suppress the winstart window should do the trick.

OK, thats got it going as a screen-saver. Heres the code I used in mine, its very rudimentary,
but you will easily see where to insert your code, as this following code is largely just
to show how to handle the different paramaters windows will pass in as a screensaver application.

Any questions or issues, just ask.
Click to reveal..
Code:
///////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////////////////////////////////////
//
//
void config_popup()
{
	//open a configuration panel of some kind
	//remember to do a level_load unless you are using APIs
	//also, the hWnd of the display properties MAY be available
	//on the command line so you can get a window-position
	sys_exit("");	
}
//
//
void mini_preview()
{
	//Open a mini-screensaver version to display the the "virtual"
	//monitor in the Display Properties / ScreenSaver panel.
	//You can retrieve a size from the hWnd that IS on the command-line
	//and then do a video_set to that size and position it I suppose.
	//Ive never tried anything like that before.
	sys_exit("");	
}
//
//
void ScreenSaver()
{
	video_set(sys_metrics(0),sys_metrics(1),0,1);
	level_load(NULL);	wait(5);
	VECTOR old_mouse;
	vec_set(old_mouse, mouse_cursor);
	while(1)
	{
		if(vec_dist(old_mouse,mouse_cursor))	sys_exit("");
		wait(1);
	}
	sys_exit("");
}
//
//
function main()
{
	//      From Display Properties panel
	//      /p 123456        show in little monitor    123456 = Preview D3DWindow hWnd (size is resolution dependant)
	//      /s               run or preview
	//      /c:987654        configure                 987654 = DisplayProperties/ScreenSaver Tab-Dialog hWnd
	//
	//      From RightClick Menu	
	//      /S            Test = Instant run
	//                    Configure - no hWnd passed
	//                    Install - does nothing but start DisplayProperties/ScreenSaver panel
	//
	//
	if(str_stri(command_str,"/s"))            {    ScreenSaver();    }        //execute the actual screensaver
	else if(str_stri(command_str,"/p"))       {    mini_preview();    }        //show preview in mini-panel
	else                                      {    config_popup();    }        //otherwise show my config panel
}





"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Still can't build screensaver [Re: EvilSOB] #265323
05/12/09 01:19
05/12/09 01:19
Joined: Jul 2005
Posts: 38
N
ngisiger Offline OP
Newbie
ngisiger  Offline OP
Newbie
N

Joined: Jul 2005
Posts: 38
Thanks a million for your help EvilSOB!

It's late. So I will check it in detail tomorrow.

Thanks again! grin

Thomas

PS: If you ever need any help with particle programming or anything, let me know. smile

Re: Still can't build screensaver [Re: ngisiger] #265334
05/12/09 05:30
05/12/09 05:30
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Footnote:

Since my last post, Ive tested with a real, multi-entity animated level.
Steps required, leaving off from my previous posts ending point.
1> Created a sub-directory off my projects called "whatever".
2> Dumped WMB and all MDL's into the folder "whatever".
3> Added #define PRAGMA_PATH = "whatever" to source file.
4> Added PATH = "whatever" to WDL file.
5> Publish EXE (no ideas about resources or binding, I have no PRO)
6> Move newly-created EXE(as SCR), WDL, Acknex.dll to WINDOWS folder.
7> Copy whole "whatever" folder into WINDOWS folder, as a folder. (C:\WINDOWS\whatever)
Enable screensaver and level is visible and ALIVE!
(till I hit the mouse at least)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Still can't build screensaver [Re: EvilSOB] #265641
05/13/09 13:33
05/13/09 13:33
Joined: Jul 2005
Posts: 38
N
ngisiger Offline OP
Newbie
ngisiger  Offline OP
Newbie
N

Joined: Jul 2005
Posts: 38
Ok, I'm trying to retrace your steps.

I think I understand the lite-c script you C/P in your post: according to the value of command_str, your application either displays a preview, the level or a configuration panel. From what I gathered on a few web sites, these options are a requirement for windows to consider an application a screensaver. So far so good.

I am stuck here however: where does the wdl file you mention enter the picture? How can I mix c-files and wdl files in a single project? Is it in the wdl file that command_str is set? How does Windows set the value of command_str?

Thanks again for your help and patience.

Re: Still can't build screensaver [Re: ngisiger] #265744
05/13/09 21:48
05/13/09 21:48
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Preview and Execution of screensaver are actually the same.
The mini pre-view ("/p xxxx" parameter) needs to display IN the little monitor image displayed on the
DisplayProperties/Screensaver control panel. Im still working on this, and on a savable(to resgistry) control panel.
More on that when Im closer.

Its just a publish WDL. All it contains are two lines. (for this project anyway)
It has the same filename as your application filename.
Code:
Example of a complete screensaver project.
Files to copy:
Acknex.dll                  (as generated by publish process)
Folder _scrsave             (contains all PROJECT files besides the main EXE)     
MyProject.EXE               (Renamed as MyProject.SCR)
MyProject.WDL               (contains only the following two lines)
                            PLUGINDIR = "_scrsave";
                            PATH "_scrsave";
The WDL file is (as far as I can tell) needed by commercial version to control the compiled application in some way.

Im only using it for two things ::
PLUGINDIR is aiming the app at our folder as the only place to look for DLL's.
PATH is telling the app to look for all files in the folder we have supplied.

Finally, command_str is an engine function. It gets set by A7 itself when the engine starts.

ngisiger : this post changes nothing I said in my PM


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Eureka: finally... It WORKS!! [Re: EvilSOB] #266073
05/15/09 20:01
05/15/09 20:01
Joined: Jul 2005
Posts: 38
N
ngisiger Offline OP
Newbie
ngisiger  Offline OP
Newbie
N

Joined: Jul 2005
Posts: 38
Alright, as usual the problem was somewhere between the chair and the keyboard: me. crazy

Apparently, I did not know how to change the extension of a file in Windows, or to be more precise, to change myProject.EXE into myProject.SCR.

Just in case I am not the last Windows-challenged person to get his hands on Gamestudio, here is the rename procedure:

1) make sure that you can actually SEE the extensions of the files. (e.g. myProject.exe, and not simply myProject).

If you don't, go in the menu of the folder which contains the files of your project, select Tools, Folder Options, then in View, uncheck the checkbox entitled Hide extensions for known file types (which seems to be the default Windows setting). Click on OK.

Now, when you go back to the folder holding the files of your project, you should see myProject.exe, etc.

2) Select the executable of the project you want to turn into a screensaver, select its name, erase the characters "exe" and replace them by "scr". Press ENTER.

3) Now, you should get a warning message saying that you're about to change the file type. Click OK to continue.

4) Now, your file type should have changed from "Application" to "Screen Saver".

5) Now do what EvilSOB said (to handle the resources of the level, the folder where to look for dlls, etc. smile ), and it should work.

Many thanks to EvilSOB for his help and patience, and everybody who participated to this thread.

Thomas

Re: Eureka: finally... It WORKS!! [Re: ngisiger] #266104
05/16/09 00:43
05/16/09 00:43
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
hehehe, so you were renaming your file from screensaver.exe to screensaver.scr.exe
Been there done that myself in the past too.

Keep your eyes on the lite-c contributions for my upcoming Screensaver-Template.
Or it may even me a Screensaver-Adapt4er_Include...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Eureka: finally... It WORKS!! [Re: EvilSOB] #266109
05/16/09 02:50
05/16/09 02:50
Joined: Jul 2005
Posts: 38
N
ngisiger Offline OP
Newbie
ngisiger  Offline OP
Newbie
N

Joined: Jul 2005
Posts: 38
Yeap, screensaver.scr.exe. Avast warned me, but hey, what does it know, right? wink

I look forward to getting my paws on that template! How is it coming along? Do you plan to write some doc for it? I'd be happy to help if I can (writing, proofreading, etc.).

Cheers

Re: Eureka: finally... It WORKS!! [Re: ngisiger] #266113
05/16/09 03:03
05/16/09 03:03
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ive just posted it in Lite-C Contributions a few minutes ago.
Much easier to use and more advanced than anything Ive posted on this thread.
Its no longer a "template" as such, its nowmore of an adapter.
It is an include for your EXISTING project, rather than something to need to
transfer your project into.

Read the instructions and see...

Hope you like it....


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Eureka: finally... It WORKS!! [Re: EvilSOB] #266115
05/16/09 03:07
05/16/09 03:07
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Moderators, I vote towards this thread as closed.
A new THREAD exists to carry on this subject.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 2 of 3 1 2 3

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1