Jump to content

[Updated 2022] List of Buttons[Commands] for GUI session


Lion.Kanzen
 Share

Recommended Posts

In Age of Kings... Handbook I found the definition.
 

Quote

Follow

Following units follow an allied or enemy unit by trailing it at the maximum distance
allowed by their sight. For example, you might set a Scout Cavalry unit, which has a long
line of sight, to follow a foot soldier, which has a short line of sight, so you can spot an
enemy unit sooner.


 

Quote

Guard/Escort
Guard units position themselves so the unit or building they are protecting is within their
sight. Guards attack any units that attack or enter the sight of the unit or building they
are protecting. However, they only attack if they can do so without losing sight of the
unit or building they are protecting.

 

Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...
  • 2 years later...

@Freagarach

There is not currently such function in IcmpRangeManager. But CmpRangeManager has tools to pretty fast say if given position is explored by given player.

You need to add this into ccmprangemanager and bind it with interface call in icmprangemanager

Should do the trick

virtual bool isTileExplored(CVector2D pos, player_id_t player)
{
int i = (pos.X / (int)TERRAIN_TILE_SIZE).ToInt_RoundToNearest();
int j = (pos.Y / (int)TERRAIN_TILE_SIZE).ToInt_RoundToNearest();
CLosQuerier los(GetSharedLosMask(player), m_LosState, m_TerrainVerticesPerSide);
return los.IsExplored(i, j);
}


 

  • Like 1
Link to comment
Share on other sites

Thank you for your help @Angen! However, it fails to build if I add that to the CCmpRangeManager.

Spoiler

I've added to the ICmpRangeManager.cpp:


DEFINE_INTERFACE_METHOD_CONST_2("IsTileExplored", bool, ICmpRangeManager, IsTileExplored, CVector2D, player_id_t)

to the ICmpRangeManager.h:


	/**
	 * Get whether a tile is explored for specified player.
	 */
	virtual bool IsTileExplored(CVector2D pos, player_id_t player) = 0;

 

It gives an error during "make":

CCmpAIManager.cpp
In file included from ../../../source/simulation2/components/CCmpAIManager.cpp:38:0:
../../../source/simulation2/components/ICmpRangeManager.h:425:30: error: ‘CVector2D’ has not been declared
  virtual bool IsTileExplored(CVector2D pos, player_id_t player) const = 0;
                              ^~~~~~~~~
simulation2.make:243: recipe for target 'obj/simulation2_Release/CCmpAIManager.o' failed
make[1]: *** [obj/simulation2_Release/CCmpAIManager.o] Error 1
Makefile:98: recipe for target 'simulation2' failed
make: *** [simulation2] Error 2

Do you have any ideas what I'm doing incorrect? I've tried to include "maths/CVector2D.h" in the .h, but that does not exist, as well as changing "CVector2D" in the .h to something similar as I saw in other functions, but all to no avail.

Edited by Freagarach
Fixed ICmpRangeManager.h code (removed const).
Link to comment
Share on other sites

Okay, I fixed the above by changing "CVector2D" to "CFixedVector2D"; I do not know whether that makes it a completely different function, but I'll see ;)

I now get the following error during make:

Spoiler

ICmpRangeManager.cpp
In file included from ../../../source/simulation2/components/ICmpRangeManager.cpp:22:0:
../../../source/simulation2/system/InterfaceScripted.h:31:2: error: no matches converting function ‘callMethodConst’ to type ‘JSNative {aka bool (*)(struct JSContext*, unsigned int, class JS::Value*)}’
  }; \
  (...)
  simulation2.make:405: recipe for target 'obj/simulation2_Release/ICmpRangeManager.o' failed
make[1]: *** [obj/simulation2_Release/ICmpRangeManager.o] Error 1
Makefile:98: recipe for target 'simulation2' failed
make: *** [simulation2] Error 2

 

Could you help me out here @Angen?

Edit: I've updated D1851 so perhaps you can help me there? Would keep this topic kindof clean ;)

Edited by Freagarach
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 years later...
On 30/05/2016 at 5:41 AM, Lion.Kanzen said:

In Age of Kings... Handbook I found the definition.
 

Follow

 

Following units follow an allied or enemy unit by trailing it at the maximum distance

allowed by their sight. For example, you might set a Scout Cavalry unit, which has a long

line of sight, to follow a foot soldier, which has a short line of sight, so you can spot an

enemy unit sooner.
 

 

This still missing, is a simply follow.

Link to comment
Share on other sites

  • Lion.Kanzen changed the title to [Updated 2022] List of Buttons[Commands] for GUI session
  • 5 months later...
  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...