Jump to content
gc8

Formation direction

Recommended Posts

Hi

can you change the formation direction somehow using zeus?

 

thx

Share this post


Link to post
Share on other sites
6 hours ago, RCA3 said:

 

ty for that but it only works inside editing area and it instantly sets the new direction. I need this outside the editing area and not instant but instead the soldiers should walk to new formation position

Share this post


Link to post
Share on other sites

You can select the leader and Lshift drag, the group will move by walking.

For outside editing area I tried Zeus Enhanced and you can execute code (_this setFormDir <direction>) on group leader and they will also walk.

  • Thanks 1

Share this post


Link to post
Share on other sites

I know where you're going with this gc8. If zeus enhanced doesn't do it for you, maybe a combination of getMousePosition and screenToWorld, used with a UI event handler for mouseButtonDown/Up to get the direction you want then to face, like you would any normal RTS when clicking and dragging to set formations and directions. Seems a little unnecessarily complex though 😁 so hopefully there's a better way.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

yep trying to use zeus for RTS... will see if I can figure some good way to rotate those squads , setFormDir  was just what I was looking for

 

not sure if zeus enchanted is for me because I need to disable some of the features already for RTS

  • Like 1

Share this post


Link to post
Share on other sites

I'm planning to implement this so that when you click on ground the group will face the position you clicked. This works well, except I cant seem to override the default zeus move on right click. 

 

I tried this:

finddisplay 312 displayAddEventHandler ["MouseButtonDown", { true } ];

tried "MouseButtonUp" too and with display 46 / 313

 

but to no avail

Share this post


Link to post
Share on other sites

What about using a shortcut key instead of mouse click?

Share this post


Link to post
Share on other sites
11 hours ago, beno_83au said:

What about using a shortcut key instead of mouse click?

 

I was thinking that too but mouse click would be better IMO. maybe I use both 🙂

 

Share this post


Link to post
Share on other sites

It seems that the zeus does not use onMouseButtonDown etc EH but the calls to CuratorWaypointPlaced etc come straight from the engine (addEventHandler).

 

I was able to get the squad rotation to work but had to use inputaction "curatorRotateMod" (Shift) because I couldnt get KeyDown to fire (but KeyUp does!)

 

Code that I couldn't get to work:

 

_display = finddisplay 312;
_display displayAddEventHandler ["KeyDown", 
{
params ["_displayorcontrol", "_key", "_shift", "_ctrl", "_alt"];

systemchat format["DOWN %1 %2", _key,_shift];

}];

 

Any ideas/workaround to get the keyDown to work?

 

Edited by gc8
addEventHandler

Share this post


Link to post
Share on other sites

@pierremgi thx for the link but I just cant get KeyDown EH to work...

 

Nvm I had another KeyDown EH which seems to have the priority 😄

 

got it working now...

 

Edit: I don't know why I cant have two KeyDown EHs but I guess I'll just put the code to one EH

 

Edit2: Got two Keydown EH working now, not sure what I did lol

 

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

As side note: For these EHs (keydown , keyUp but also inGameUISetEventHandler ) , it's important to end the code by FALSE (for added behavior) or TRUE (overriding the key binding) Best example.

Share this post


Link to post
Share on other sites
On 3/14/2021 at 3:03 PM, pierremgi said:

As side note: For these EHs (keydown , keyUp but also inGameUISetEventHandler ) , it's important to end the code by FALSE (for added behavior) or TRUE (overriding the key binding) Best example.

 

I have tried to override some of the zeus camera behaviour by using "MouseMoving" & "MouseButtonDown" EHs and returning true from them but to no avail. is zeus unmodifiable then in this case?

Share this post


Link to post
Share on other sites

still trying to do this (override zeus cam turning), I have this code running:

 

{
(finddisplay _x) displayAddEventHandler ["MouseMoving",
{
 true
}];

} foreach [0,12,46,312,313];

 

But zeus still turns the camera when holding right mouse button down and moving.

 

any tips of what to try?

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×