Mouse Coordinates Code

正在查看此主题的用户

Shadowclaimer

Sergeant
There was an older version of this, but I'm curious on specifically how to implement this. With the release of the module system has anyone managed to resurrect it? I could really really use it about now.
 
Astral 说:
Do you mean in presentations?

Yea but I have no idea where to begin in presentations, and what I have done with it always results in it not compiling due to errors, needless to say the only documentation for that was "Put this in start, put this in triggers" needless to say "Triggers" doesn't exist in the file (anymore?) and for those of us with zero knowledge of python and the presentations section its a mess.
 
What do you want exactly? There is an operation for it.

mouse_get_position             = 75  # (mouse_get_position, <position_no>), #x and y values of position are filled
then you can just use that position or use
position_get_x                  = 726 # (position_get_x,<destination_fixed_point>,<position_no>), #x position in meters * fixed point multiplier is returned
position_get_y                  = 727 # (position_get_y,<destination_fixed_point>,<position_no>), #y position in meters * fixed point multiplier is returned
to get the separate x and y values.
 
MountainBlade 说:
What do you want exactly? There is an operation for it.

mouse_get_position             = 75  # (mouse_get_position, <position_no>), #x and y values of position are filled
then you can just use that position or use
position_get_x                  = 726 # (position_get_x,<destination_fixed_point>,<position_no>), #x position in meters * fixed point multiplier is returned
position_get_y                  = 727 # (position_get_y,<destination_fixed_point>,<position_no>), #y position in meters * fixed point multiplier is returned
to get the separate x and y values.

But how can I implement this into something I can see ingame is the problem, I need to be able to find out locations for which to place cities etc.

I guess I should note I realize I'm stepping into a land of code I haven't yet begun to understand, my knowledge doesn't extend beyond advanced VB and basic Python/C#
 
Do you realize that "coordinates of cities" are conceptually different from "Mouse Coordinates" ?

Use Thorgrim's editor to draw your map in 1.003 version of M&B, then copy map.txt to warband, and copy party coordinates from parties.txt generated by thor's editor. Or just type them in by hand, using editors tool that shows coords
 
GetAssista 说:
Do you realize that "coordinates of cities" are conceptually different from "Mouse Coordinates" ?

Use Thorgrim's editor to draw your map in 1.003 version of M&B, then copy map.txt to warband, and copy party coordinates from parties.txt generated by thor's editor. Or just type them in by hand, using editors tool that shows coords

No I wasn't aware, I assumed Mouse Coordinates and Map Coordinates were the same bit (Assuming, makes an ass out of u and me). Completely forgot that actual mouse coordinates are needed for some UI element modifications.

Problem being my Thorgrim's doesn't move cities or even select them correctly, let me try reinstalling it.. (Also it would crash on the placement of rivers)

Edit: Nope, 0.9 is latest version and reinstalling it didn't fix it, I don't have the actual icons of cities (just the text), placing rivers still crashes me, and I can't move cities because selecting them doesn't work correctly.
 
Shadowclaimer 说:
Edit: Nope, 0.9 is latest version and reinstalling it didn't fix it, I don't have the actual icons of cities (just the text), placing rivers still crashes me, and I can't move cities because selecting them doesn't work correctly.
That's why I:
1) use 1.003 native module and icons, so they show up
2) draw rivers by hand
3) move cities just fine here. They are selected a bit awkwardly, yes.
 
GetAssista 说:
Shadowclaimer 说:
Edit: Nope, 0.9 is latest version and reinstalling it didn't fix it, I don't have the actual icons of cities (just the text), placing rivers still crashes me, and I can't move cities because selecting them doesn't work correctly.
That's why I:
1) use 1.003 native module and icons, so they show up
2) draw rivers by hand
3) move cities just fine here. They are selected a bit awkwardly, yes.

Actually this entire post got solved anyway.. pressing Z shows the map coordinates of your mouse in the map editor xD
 
后退
顶部 底部