Navid Posted February 28, 2016 Report Share Posted February 28, 2016 I'm trying to locate where does the player sends the attack command in source files .... is there any one can help me ? 2 Quote Link to comment Share on other sites More sharing options...
fcxSanya Posted February 28, 2016 Report Share Posted February 28, 2016 1 hour ago, Navid said: I'm trying to locate where does the player sends the attack command in source files Here: unit_actions.js#L117 2 Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted February 28, 2016 Report Share Posted February 28, 2016 @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 3 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted February 28, 2016 Report Share Posted February 28, 2016 (edited) 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 February 28, 2016 by Lion.Kanzen Pasting info. 1 Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted February 29, 2016 Report Share Posted February 29, 2016 Attack and defense statistics are defined in the simulation. See http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/Attack.js , http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/Armour.js and http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/helpers/Damage.js 2 Quote Link to comment Share on other sites More sharing options...
Navid Posted February 29, 2016 Author Report Share Posted February 29, 2016 (edited) Thanks for responding .... i was reading UnitAI.js and unit-action.js .... are they related to each other ? where is the connection ? TY Edited February 29, 2016 by Navid Quote Link to comment Share on other sites More sharing options...
fcxSanya Posted February 29, 2016 Report Share Posted February 29, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
Navid Posted February 29, 2016 Author Report Share Posted February 29, 2016 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 Quote Link to comment Share on other sites More sharing options...
Navid Posted March 5, 2016 Author Report Share Posted March 5, 2016 (edited) 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 March 5, 2016 by Navid Quote Link to comment Share on other sites More sharing options...
fcxSanya Posted March 5, 2016 Report Share Posted March 5, 2016 1 hour ago, Navid said: what action does "apply()" function performs in "EcmaScript.js" ? This is a standard JS method, you can see its detailed description and usage examples on MDN: Function/apply Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.