Hello, I just wanted to say, that GemRB or/and the Infinity Engine is awesome and I'm going through the code structure every day for hours. I must admit I'm a BG/IWD fanatic which leads to my goal to create a very similar game experience just in 3D, so I'm developing "this nameless game" with Unity3D which I'm using for 12 years now and am trying to adopt some of the ideas that I find in GemRB/IE. Along the way I'm learning about bits and bytes as much as possible to better understand the dynamics of the engine.
But I'm still struggling to grasp certain things here and there, i.e. identifying what functions are used inside a loop and what is called once.
To be a little more detailed. I'm currently trying to integrate the attacking loop that happens if I command an actor via mouse click (or 'TryToAttack' in GameControl.cpp). What happens next?
-> CommandActor(action) -> Stop actors current action and pathing -> Set to current action and execute -> if(pc) if(target) ??
That's where I lose it. In the game when I click an enemy, the PC attacks continuously. But in the GameScript.ExecuteAction function I see nothing that would lead to that behaviour, other than copying the action and putting the copy in the queue. Does the attack action itself contain the loop or can a queued action be repeated automatically?
Can anyone shed some light on this?
I'd be really interested to learn more about the engine's inner workings.