• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Editor launches game in sized window - possible and how ?

Status
Not open for further replies.

Ardenian

A

Ardenian

How can I make my editor lauch a test game in a sized window ?
I managed to do so with the normal game, but if I launch a test game from the world editor it is full-screen.
Is there a way to change that ?
 

Ardenian

A

Ardenian

Depend on ur Warcraft 3 Screen window resolution I think
Hm, I think a lower resolution will result into black borders, as far as I know

JassNewGenPack does this--it runs the game in -window mode.

I don't think there is an easy way to make the default editor do this. iirc JNGP uses Grimoire to hook the test map button and it runs Wc3 via command line with -window enabled. You can always write your own batch script to do that, though.
I don't use JNGP, but shouldn't it somewhere give a line where I can add -window ?
 

Ardenian

A

Ardenian

World Editor uses war3.exe to launch the game, but adding -window there sadly creates an error message that he could not find war3.exe ( as I renamed it)
 
Level 4
Joined
Feb 12, 2016
Messages
71
One could possibly write some .exe file (could be a simple batch script "converted" to exe with Windows tools) and make it start war3.exe (which you renamed before) with the given parameters and add -windowed, if the works.

But why this hassle if you can simply download JNGP and work with that? What's keeping you?
 

Ardenian

A

Ardenian

Why is editing the shortcut not an option?
Well, what shortcut ?
As I wrote before, WE launches the game, appearently, ofer war3.exe, adding -window to it prevents the editor from finding it.
Have you checked the Registry of Warcraft III?
After you wrote that, yes, but I cannot find a link there which launches the game from the editor and additionally I do not know what to look for.
 

Ardenian

A

Ardenian

Thanks, but I think resolution and display mode are different things
 
Level 4
Joined
Feb 12, 2016
Messages
71
Despite you ignoring my post, here is a working C++ program that would do the job for you.

You need to rename the original war3.exe to war3Foo.exe and name the resulting .exe file from this C++ code to war3.exe.
You place the resuling .exe file in the same folder that the original war3.exe is also in.

Also, as you can see i was using an absolute path, because, for some reason, relative paths didnt work and i was not motivated to spend time trying to figure out why.

All it does, is to call war3Foo.exe with the given paramets and adds -window to it.

Here is the code

JASS:
#include <iostream>
#include <string>
#include <Windows.h>

int main(int argc, char* argv[]) {


	std::string commandLine;
	for (int i = 0; i < argc; i++) {
		if (i == 0)
			continue;
		commandLine += argv[i];
		commandLine += " ";
	}

	commandLine += "-window";

	wchar_t parameters[1024];
	std::mbstowcs(parameters, commandLine.c_str(), strlen(commandLine.c_str()) + 1);
	LPWSTR pParameters = parameters;

	std::cout << "Command line is : " << commandLine << "\n";

	
	int ret = (int)ShellExecute(NULL, L"open", L"C:\\Program Files (x86)\\Warcraft III\\war3Foo.exe", pParameters, NULL, SW_SHOWDEFAULT);

	if (ret <= 32) {
		std::cout << "There was an error with ShellExecute, error code is " << ret << "\n";
		std::cin.get();
	}

	return 0;

}

It's compiled using Visual Studio, keywords like "L" would probably not be known within other IDE's.

If you dont know how to compile this or dont want to acquire Visaul Studio, then i can supply a release version of the .exe upon request. That would also require you to give me the full path to your war3.exe directory, so i can compile it accordingly.

All this is assuming that you are using windows, since it does calls to the WinApi.

This is still more hassle than simply working with JNGP, since you have to rename both files back if you want to stop using window mode, but since you supply no information what hinders you from using JNGP there is probably no better solution.
If you want, the little programm can ask you whether or not you want to use -window before it finally launches war3Foo.exe. Then, you wouldnt have to rename anything back, but instead make the choice each time you launch Test-Map.
 

Ardenian

A

Ardenian

Mercious, I did not react to your comment as your suggestion about a batch file was already suggested by PurgeandFire in his first post.
About the JNGP question, I don't understand why people don't respect if someone does not want to use a program. Every time this topic rises, it is always the same 'Why don't you use it, I don't understand, just go for it' and so on.

Thanks a lot for taking the time and effort to write it. The whole topic does not matter that much to me that I would start calling people writing programs for me to just have a windowed world editor launch. It is only a little little convenience.
If you were able to write a stand-alone converter from obj/3ds to mdx or mdl, even if it only supports mesh and texture coordinates, then I would kiss your feed, but that's another story.
 
Level 4
Joined
Feb 12, 2016
Messages
71
True, but that part of the post you left uncommented and us wondering what you think of such solution.

You might think that the solution i provided is something large scale, but the truth is that it took me about 10 minutes to write the programm and a few more to test the whole thing - probably about as much time spent as for every average answers to threads that i give on here.

I take it, however, that you don't like the solution as you dislike the idea of renaming files etc. - that's OK.

For the JNGP thing:
You see, if you go and tell someone that you have problems eating your soup as the strokes you take keep rinsing through the gaps of your fork, this someone will likely tell you to use a spoon instead.
If you answer that with "I am not using a spoon.", it will likely make the other person seriously wonder about the reasoning for this.

I take it that you have some kind of personal aversion against this tool, and that's it. But it should not surprise you when people take a few posts to realize that there will be no convincing.

As for your problem:
I think all possible solutions have been listed and discussed. There will be no part of the standard WE that allows you to add "-window" to it in order to achieve what you desire.
I guess at this point its up to you to decide which route to go, be it using one of the suggested solutions or just forgetting about the gimmick.

If you were able to write a stand-alone converter from obj/3ds to mdx or mdl, even if it only supports mesh and texture coordinates, then I would kiss your feed, but that's another story.

Hehe, backed up by the time of internet such thing would definitely be possible, but as with everything, time is the lacking factor. That, or money.
However, are you sure there havent been solutions to this provided somewhere?
If this is a somewhat common thing to do then it should be somewhere out there - at least a quick google search has suggested so.
But there might be more to it than i am aware of - when it comes to moddeling etc. i am more than clueless.
 

Ardenian

A

Ardenian

Well, I tried to focus on my aim, a solution with adding a line somewhere so it runs in a windowed mode.

Oh, I did not know that.
I personally dislike, as you correctly guessed, re-naming, adding or modifying files, as it usually starts getting messy or irreversible.
I hoped I can simply add a line -window somewhere, everything bigger than that is a solution I don't aim for right now.

For JNGP, why would I go buying a spoon when i can take the soup itself and drink ?
As said, I hoped for an 'intern' solution.

Thanks a lot, I appreciate you took the time!

Thank you all guys, I will live with it then
 
Status
Not open for further replies.
Top