Contributing to Ares: Difference between revisions

Updating again
Electro (talk | contribs)
Line 1: Line 1:
{{HorizontalBar|{{W}}This is relatively unpolished. As the wrapper library and the project matures, simpler ways to create custom code will be created. {{tt|Don't panic.}}}}
{{HorizontalBar|{{W}}This is relatively unpolished. As the wrapper library and the project matures, simpler ways to create custom code will be created. {{tt|Don't panic.}}}}


{{HorizontalBar|{{W}}At this moment, you will not be able to run the DLLs you compiled - the sources in SVN have been updated to work with a more recent, development-version of Syringe which is not publicly vailable just yet. Don't try runnning them on the old public version.}}
{{HorizontalBar|{{W}}At this moment, you might not be able to run the DLLs you compiled - the sources in SVN have been updated to work with a more recent version of Syringe which is distributed along with LaunchBase. Don't try running them on the old public version.}}
 
[http://marshall.strategy-x.com/LaunchBase/LB_Setup.exe LaunchBase Download Link]


Contributing to Ares is relatively simple, if you know at least the basics of C++:
Contributing to Ares is relatively simple, if you know at least the basics of C++:
Line 7: Line 9:
== What you'll need ==
== What you'll need ==
; A knowledge of C++ : Yes, you'll need this.
; A knowledge of C++ : Yes, you'll need this.
; A C++ compiler/IDE : Right now, [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Microsoft Visual Studio] <span style="text-decoration: line-through;">and [http://www.bloodshed.net/devcpp.html Dev-C++]/[http://wxdsgn.sourceforge.net/ WxDev-C++] (gcc-based) are</span> is supported.
; A C++ compiler/IDE : Right now, only [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Microsoft Visual Studio] is supported. Due to [http://forums.renegadeprojects.com/showthread.php?tid=1043&pid=12314#pid12314 binary layout issues], gcc-based compilers/IDEs like [http://www.bloodshed.net/devcpp.html Dev-C++]/[http://wxdsgn.sourceforge.net/ WxDev-C++] can '''not''' be used to create useful DLLs.  If you want a free solution, try Microsoft Visual C++ 2008 Express Edition (highly recommended).
; The Microsoft Visual C++ 2008 Redistributables : You can't run Syringe without these...
; The Microsoft Windows SDK : The [http://en.wikipedia.org/wiki/Microsoft_Windows_SDK Microsoft Windows SDK] is required to contribute to and compile Ares. Microsoft Visual Studio (not Express Edition) comes with it, but if you don't have it, you can freely download it from Microsoft's site.
; A Subversion (SVN) client : [http://tortoisesvn.tigris.org/ TortoiseSVN] is recommended.
; A Subversion (SVN) client : [http://tortoisesvn.tigris.org/ TortoiseSVN] is recommended.


Line 16: Line 20:


Each of them has its own SVN repository:
Each of them has its own SVN repository:
*Create a folder on your hard drive where you'll be keeping the code, for example, {{Tt|C:\My Documents\Visual Studio Projects\Ares}} or {{Tt|f:/source/ares}}, whatever suits you.  
*Create a folder on your hard drive where you'll be keeping the code, for example, {{Tt|C:\My Documents\Visual Studio Projects\Ares}} or {{Tt|F:\source\Ares}}, whatever suits you.  
*Create two subfolders in it, one for yrpp and one for Ares.
*Create two subfolders in it, one for yrpp and one for Ares.


; {{tt|yrpp}}
; {{tt|yrpp}}
::*Right click yrpp's folder, and select {{Tt|SVN Checkout...}} from the context menu.
::*Right click yrpp's folder, and (as of this point we are assuming that you have successfully installed TortoiseSVN) select {{Tt|SVN Checkout...}} from the context menu.
::**Enter {{Tt|svn://www.renegadeprojects.com/yrpp/trunk}} as the {{Tt|Repository}} address.
::**Enter {{Tt|svn://www.renegadeprojects.com/yrpp/trunk}} as the {{Tt|Repository}} address.
::**Leave the other options as they are, and press {{Tt|OK}}.
::**Leave the other options as they are, and press {{Tt|OK}}.


; Ares:
; Ares:
:*Right click Ares's folder, and select {{Tt|SVN Checkout...}} from the context menu.
:*Right click Ares' folder, and select {{Tt|SVN Checkout...}} from the context menu.
:**Enter {{Tt|svn://www.renegadeprojects.com/Ares/trunk}} as the {{Tt|Repository}} address.
:**Enter {{Tt|svn://www.renegadeprojects.com/Ares/trunk}} as the {{Tt|Repository}} address.
:**Leave the other options as they are, and press {{Tt|OK}}.
:**Leave the other options as they are, and press {{Tt|OK}}.
Line 33: Line 37:
== Code Layout ==
== Code Layout ==
The files in the {{tt|yrpp}} folder are parts of the wrapper library. The Ares code is in the {{Tt|Ares}} folder. There are other repositories for other DLLs using {{tt|yrpp}} - {{Tt|ExceptChecker}} contains the code for the current ExceptChecker DLL. The {{tt|yrpp}}/{{Tt|Examples}} folder contains some examples of using the more complex functionality in {{tt|yrpp}}.  
The files in the {{tt|yrpp}} folder are parts of the wrapper library. The Ares code is in the {{Tt|Ares}} folder. There are other repositories for other DLLs using {{tt|yrpp}} - {{Tt|ExceptChecker}} contains the code for the current ExceptChecker DLL. The {{tt|yrpp}}/{{Tt|Examples}} folder contains some examples of using the more complex functionality in {{tt|yrpp}}.  
{{HorizontalBar|{{I}}The ExceptChecker DLL is currently outdated and cannot be run on the latest Syringe.}}


Assuming you're familiar with C++, you should create a new {{tt|.cpp}} file in the {{Tt|Ares}} folder.
Assuming you're familiar with C++, you should create a new {{tt|.cpp}} file in the {{Tt|Ares}} folder.


Also, take the time to at least gloss over the existing code, including the wrapper library - knowing what is possible already and how is always good.
Also, take the time to at least skim over the existing code, including the wrapper library - knowing what is possible already and how is always good.


== Writing A Function ==
== Writing A Function ==
Line 73: Line 79:
  EXPORT_FUNC(_Temporal_AvoidFriendlies) {
  EXPORT_FUNC(_Temporal_AvoidFriendlies) {
  ''// '''(ASM knowledge)''' the ESI register contains a pointer to an instance of TemporalClass, let's get it''
  ''// '''(ASM knowledge)''' the ESI register contains a pointer to an instance of TemporalClass, let's get it''
  TemporalClass *m = (TemporalClass *)R->GetESI();  
  GET(TemporalClass *, Temp, ESI);
   
   
  ''// House that owns the unit firing this weapon''
  ''// House that owns the unit firing this weapon''
Line 79: Line 85:
   
   
  ''// House that owns the unit being erased''
  ''// House that owns the unit being erased''
  HouseClass *ho = m->get_OwningUnit()->get_Owner();
  HouseClass *ho = m->get_OwningUnit()->get_Owner();
''// proceed normally unless the two houses are allied with each other''
RET_UNLESS(ho->IsAlliedWith(hv));
   
   
''// if the two houses are allied with each other,''
  ''// '''(ASM knowledge)''' force the game to jump over the experience-granting code''
  ''// '''(ASM knowledge)''' force the game to jump over the experience-granting code''
  if(ho->IsAlliedWith(hv)) {
  return 0x71A97D;
return 0x71A97D;
}
''// '''(ASM knowledge)''' else there's nothing to fix''
return 0;
  }
  }


Line 105: Line 108:
  71A92A = _Temporal_AvoidFriendlies, 5
  71A92A = _Temporal_AvoidFriendlies, 5


That's all. Now, running YR via Syringe will invoke that functionality and prevent the units from gaining experience this way.
That's all. Now, running YR via Syringe will invoke that functionality and prevent units from gaining experience this way.