Jump to content

Where is attack defined in the code?


Recommended Posts

@Navid the command comes from the GUI and get passed on to the simulation, which in turn sets states on the indivudual entities.

fcxSanya gave you the start point of the command, but it follows quite a few function calls to arrive at the entities. If you want more info, please explain what you want to change. Then we can tell you if it belongs in the GUI or in the simulation.

You're also welcome on IRC to ask questions: https://kiwiirc.com/client/irc.quakenet.org/0ad-dev

  • Like 3
Link to comment
Share on other sites

Quote

hi ... i'm trying to analyze the attack and defence part of the game ...  but the problem is that i cannot find where should i start ... can you tell me how does a player sends an attack request ...

@Navid now I get what you are asking, sorry if I can't ask you the private message  properly.

but I'm not programmer. If you are trying to analyzing 0 A.D this the place where you can ask about how the attack and defense is work.

Edited by Lion.Kanzen
Pasting info.
  • Like 1
Link to comment
Share on other sites

1 hour ago, Navid said:

i was reading UnitAI.js and unit-action.js .... are they related to each other ? where is the connection ?

As Sander said "the command comes from the GUI and get passed on to the simulation".
Engine.PostNetworkCommand call in unit_actions.js (which I linked in my previous comment) performs the transition; you can look at PostNetworkCommand method itself and related code, but it's not necessary to work with scripts, you only need to know that the command shows up on the simulation scripts side in Commands.js and UnitAI methods are called from there.

  • Like 1
Link to comment
Share on other sites

2 hours ago, fcxSanya said:

As Sander said "the command comes from the GUI and get passed on to the simulation".
Engine.PostNetworkCommand call in unit_actions.js (which I linked in my previous comment) performs the transition; you can look at PostNetworkCommand method itself and related code, but it's not necessary to work with scripts, you only need to know that the command shows up on the simulation scripts side in Commands.js and UnitAI methods are called from there.

Thanks for your helpful comments

Link to comment
Share on other sites

I have another question ... what action does "apply()" function performs in "EcmaScript.js" ? 

I was reading FSM.ProcessMessage and it leads me to this function ... 

it would be better if anyone could tell  what is the use of "EcmaScript.js"

Thanks

 

Edited by Navid
Link to comment
Share on other sites

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...