Hopefully Blizzard will add a MouseGetX(int player) function in some later release. There is absolutely no reason why this should not be added. Stuff like CameraForceMouseRelative already causes the mouse position to be tracked, the only problem is that the camera moves too. The best solution I have found so far is to set the mouse sensitivity very low so that the camera doesn't move much after using CameraForceMouseRelative. Then, I manually recenter the camera and use how much the camera move to compute the mouse movement. This is works okay at low speeds, but if your centered position moves quickly, then performance degrades. Honestly, it would be so simple to have a trigger do the exact same thing as CameraForceMouseRelative, just not have the camera move and update some value instead.
Vermore, from my experience the best way to learn a programming language is to get a book on the subject. For example, I taught myself Java using the book called "The Java Programming Language" by the same people who created Java. To get a better understanding of Galaxy, I would recommend learning C, since Galaxy is just a reduced version of C. I actually learned it by porting a C program into Java, since once you know one language well, you can easily pick up others. Andromeda is just way to get Java/C++ object-oriented functionality on top of Galaxy. The syntax is pretty much identical to Java, although it really works more like C++ (since it is implemented on top of C--).
Vermore, it appears to me that you do not quite have a solid understanding computer programming. I would highly recommend a foundation based on C and C++ or Java before delving into Andromeda. Andromeda is really meant for those who are proficient in such programming languages, as well as Galaxy (which is really just C--). You will find plenty of information online on how C, C++, and Java work.
As AzothHyjal said, sc2mod.com is the home of Andromeda. There, you will find the full documentation, instructions for use, coding guidelines, etc... as well as forums for asking any Andromeda specific questions you may have. As I mentioned before, however, users are generally expected to be familiar with at least Galaxy and an object-oriented language such as C++ or Java.
Despite all my criticism, I applaud your efforts to go beyond the clumsy tools Blizzard has given us in their Galaxy Editor. I think that scripting is the way to go when making custom maps, as it is the most powerful and the most efficient, in the hands of a skilled programmer. You have a ways to go, and I wish you luck.
@caspersc:
That is the way any program works. It allocates a large pool, called the heap, and then allocates from there. This is true of C, Java, etc... The size of the pool can be set at compile-time by the user to meet the program's needs.
Basically, you can think of Galaxy as C--. That is, it is the same as C, except without extremely important features such as pointers, raw casts, and dynamic allocation. All of the native non-numerical/boolean types are implicitly pointers, so you can use them efficiently. Unfortunately, there is no way to get the actual pointer value from the native type.
I don't see why the lag has to be so large. I regularly play a third-person shooter game on a European server (I live on US East coast) with lag at most 150ms, which is very acceptable. I actually coded my own client for the game, so I know how its protocol works: the client simply sends any mouse/key movements that occur to the server, which then incorporates them appropriately. The changes are then noticeable on the next frame that the server sends to the client. This is not a client-side protocol at all: the game state is completely determined by the server, the client is only responsible for sending player inputs and receiving game state frames from the server. I don't see why Blizzard doesn't do this, as it's probably the simplest server-client architecture possible, besides being much more efficient than whatever is currently done.
There is no such option. The only options are Grey Mask, Black Mask, and Black Mask (Reduced Radius). Perhaps they removed that option after release? I don't see why they would do that though...
There are ways to do this using CameraForceMouseRelative and CameraSetMouseRotates, but there are unfortunate side effects: the camera moves :( It is clearly within Blizzard's capacity to have a way to directly get the mouse location, and the fact that they have not done so is just pathetic.
The best method I have found so far is to use CameraForceMouseRelative and a very small mouse sensitivity so that the camera does not move much. Every frame (1/16th of a second) I move the camera back to where it should be, and use the difference between where the camera is and where it should be to calculate how much the mouse has moved.
I know about escape characters, everything is properly escaped (with "\\"), so that's not the problem. In fact, if the escapes were not properly done, the script itself would fail to load (since "\U" is an invalid escape sequence). Thanks, though.
I actually can't find a single example anywhere of ActorCreate working properly :(
I posted this in a separate thread, but it is really a topic of its own.
Currently, I can create an actor using:
unitgroup group = UnitCreate(1, "Carrier", c_unitCreateIgnorePlacement, 1, Point(50, 50), 0);
unit ship = UnitGroupUnit(group, 1);
actorscope as = ActorScopeFromUnit(ship);
actor act = ActorFromScope(as, "::Main");
Looking at TriggerLibs/NativeLib, I have figured out how to move the actor and do all kinds of other cool stuff. The only problem is that I have to create a new unit for every such actor... I would prefer to just create the actor itself. There is a function in NativeLib that seems to do just that:
actor libNtve_gf_CreateModelAtPoint (string lp_model, point lp_position) {
// Variable Declarations
actor lv_a;
Unfortunately it doesn't do anything for me. I just can't seem to pass the right lp_model string. I've tried almost everything. Most of the time it just does nothing, but if you give it something ending in ".m3", such as "Assets\Units\Zerg\Mutalisk\Mutalisk.m3" , the trigger crashes with an "unable to create actor" error. Perhaps I'm on the right track... any ideas?
0
Apparently Blizzard has announced that they will add a MousePosition function. Yay!
0
Yay, a map that uses Andromeda!
0
Hopefully Blizzard will add a MouseGetX(int player) function in some later release. There is absolutely no reason why this should not be added. Stuff like CameraForceMouseRelative already causes the mouse position to be tracked, the only problem is that the camera moves too. The best solution I have found so far is to set the mouse sensitivity very low so that the camera doesn't move much after using CameraForceMouseRelative. Then, I manually recenter the camera and use how much the camera move to compute the mouse movement. This is works okay at low speeds, but if your centered position moves quickly, then performance degrades. Honestly, it would be so simple to have a trigger do the exact same thing as CameraForceMouseRelative, just not have the camera move and update some value instead.
0
Vermore, from my experience the best way to learn a programming language is to get a book on the subject. For example, I taught myself Java using the book called "The Java Programming Language" by the same people who created Java. To get a better understanding of Galaxy, I would recommend learning C, since Galaxy is just a reduced version of C. I actually learned it by porting a C program into Java, since once you know one language well, you can easily pick up others. Andromeda is just way to get Java/C++ object-oriented functionality on top of Galaxy. The syntax is pretty much identical to Java, although it really works more like C++ (since it is implemented on top of C--).
0
Or use Andromeda, which performs lots of casts for you :)
0
Vermore, it appears to me that you do not quite have a solid understanding computer programming. I would highly recommend a foundation based on C and C++ or Java before delving into Andromeda. Andromeda is really meant for those who are proficient in such programming languages, as well as Galaxy (which is really just C--). You will find plenty of information online on how C, C++, and Java work.
As AzothHyjal said, sc2mod.com is the home of Andromeda. There, you will find the full documentation, instructions for use, coding guidelines, etc... as well as forums for asking any Andromeda specific questions you may have. As I mentioned before, however, users are generally expected to be familiar with at least Galaxy and an object-oriented language such as C++ or Java.
Despite all my criticism, I applaud your efforts to go beyond the clumsy tools Blizzard has given us in their Galaxy Editor. I think that scripting is the way to go when making custom maps, as it is the most powerful and the most efficient, in the hands of a skilled programmer. You have a ways to go, and I wish you luck.
0
@caspersc:
That is the way any program works. It allocates a large pool, called the heap, and then allocates from there. This is true of C, Java, etc... The size of the pool can be set at compile-time by the user to meet the program's needs.
0
I have already implemented dynamic arrays in Andromeda, a Galaxy language extension made by geX. To learn more, go to http://sc2mod.com/board/index.php?page=Thread&threadID=13.
Also, structs are useless, since they cannot be passed as arguments or returned. Before, you could use pointers, but those were removed.
0
Basically, you can think of Galaxy as C--. That is, it is the same as C, except without extremely important features such as pointers, raw casts, and dynamic allocation. All of the native non-numerical/boolean types are implicitly pointers, so you can use them efficiently. Unfortunately, there is no way to get the actual pointer value from the native type.
Another major flaw is the very small memory limit, about 2.5MB. A comprehensive list of flaws can be found at http://sc2mod.com/board/index.php?page=Thread&postID=2846. Fortunately, geX has made a language extension to Galaxy called Andromeda, which is basically a mix of Java/C++ that is compiled to Galaxy. More information can be found at http://sc2mod.com/board/index.php?page=Thread&threadID=13.
0
I don't see why the lag has to be so large. I regularly play a third-person shooter game on a European server (I live on US East coast) with lag at most 150ms, which is very acceptable. I actually coded my own client for the game, so I know how its protocol works: the client simply sends any mouse/key movements that occur to the server, which then incorporates them appropriately. The changes are then noticeable on the next frame that the server sends to the client. This is not a client-side protocol at all: the game state is completely determined by the server, the client is only responsible for sending player inputs and receiving game state frames from the server. I don't see why Blizzard doesn't do this, as it's probably the simplest server-client architecture possible, besides being much more efficient than whatever is currently done.
0
@WraithChaser: Go
There is no such option. The only options are Grey Mask, Black Mask, and Black Mask (Reduced Radius). Perhaps they removed that option after release? I don't see why they would do that though...
0
So does anyone have a working map that successfully uses ActorCreate? I would be very interested in such an example.
0
There are ways to do this using CameraForceMouseRelative and CameraSetMouseRotates, but there are unfortunate side effects: the camera moves :( It is clearly within Blizzard's capacity to have a way to directly get the mouse location, and the fact that they have not done so is just pathetic.
The best method I have found so far is to use CameraForceMouseRelative and a very small mouse sensitivity so that the camera does not move much. Every frame (1/16th of a second) I move the camera back to where it should be, and use the difference between where the camera is and where it should be to calculate how much the mouse has moved.
0
@s3rius:
I know about escape characters, everything is properly escaped (with "\\"), so that's not the problem. In fact, if the escapes were not properly done, the script itself would fail to load (since "\U" is an invalid escape sequence). Thanks, though.
I actually can't find a single example anywhere of ActorCreate working properly :(
0
I posted this in a separate thread, but it is really a topic of its own.
Currently, I can create an actor using:
unitgroup group = UnitCreate(1, "Carrier", c_unitCreateIgnorePlacement, 1, Point(50, 50), 0);
unit ship = UnitGroupUnit(group, 1);
actorscope as = ActorScopeFromUnit(ship);
actor act = ActorFromScope(as, "::Main");
Looking at TriggerLibs/NativeLib, I have figured out how to move the actor and do all kinds of other cool stuff. The only problem is that I have to create a new unit for every such actor... I would prefer to just create the actor itself. There is a function in NativeLib that seems to do just that:
actor libNtve_gf_CreateModelAtPoint (string lp_model, point lp_position) {
// Variable Declarations
actor lv_a;
// Variable Initialization
lv_a = null;
// Implementation
ActorCreate(null, "Model", (lp_model), null, "null");
lv_a = libNtve_gf_LastCreatedActor();
ActorSend(lv_a, libNtve_gf_ActorMsg1("SetPositionH", libNtve_gf_ConvertXYToString(PointGetX(lp_position), PointGetY(lp_position))));
ActorSend(lv_a, libNtve_gf_SetHeight(PointGetHeight(lp_position)));
return lv_a;
}
Unfortunately it doesn't do anything for me. I just can't seem to pass the right lp_model string. I've tried almost everything. Most of the time it just does nothing, but if you give it something ending in ".m3", such as "Assets\Units\Zerg\Mutalisk\Mutalisk.m3" , the trigger crashes with an "unable to create actor" error. Perhaps I'm on the right track... any ideas?