Welcome! Please Login or Register!
April 26, 2024, 01:53:43 PM
Home Login Register
pftq Forums  |  Main  |  General Discussion  |  RM functions developer help files? 0 Members and 1 Guest are viewing this topic. « previous next »
Latest News!Lunar Trigger(Aug 27, 2023)
Pages: [1] Print
Author Topic: RM functions developer help files?  (Read 9236 times)
Neuron
Member
*****
Offline Offline

Posts: 30

« on: March 31, 2013, 07:00:43 AM »

Hi. I know I should have made this topic in the aoe section, but since I noticed nobody posted there in the last 2-3 years, I posted here where there still seem to be visitors.

I want to understand some random map scripting stuff because I want to write some scripts for fun and to learn more scripting (which is quite similar in syntax to some types of C). I am familiar with most of the RMSs which were made when the game was much more popular (by you and others). Recently I found a script which uses outcommented references to an Aoe manual, such as:

/* rmTerrainInitialize(string validTerrainName, float height );
// See AoE III Help Files\Random Map Functions\rmTerrainInitialize\arguments.rtf */


Topic is here:
http://aoe3.heavengames.com/downloads/showfile.php?fileid=2935&f=1&st=0&ci

Do you know of any help files for RM functions which were somehow available to this guy? Maybe he asked the game makers for these files, because they are nowhere to be found on a casual search. In the same script he used quite complicated vector functions, which are easy to screw up with, such as:

vector vctHotSpot = xsVectorSet(327.000000,4.000000,286.000000);         // approx. (0.7,0.5)
/* xsVectorSet(float x, float y, floatz); */

I'm still trying to understand how these coordinates work. My guess is that the x and z coordinates correspond to specific tile number on the axes. But if you modify these values, including the y coordinate for height, the position of the vector varies a lot with no apparent logic.  Shocked

So my questions are: do you know of any aoe3 help files for developers which this guy references in his script and do you know how the vector coordinates work (for example, to modify map viewing angle pitch)?
Thanks.
Logged
pftq
Administrator
*****
Offline Offline



Posts: 4198

WWW
« Reply #1 on: March 31, 2013, 02:49:51 PM »

I don't remember too much as it was a long time ago, but the xs functions generally operate on a different scope/plane to the rm ones so to speak.  A way to think of it is that they are functions/code that operate on the layer underneath the usual tr/rm functions (1 level closer to the base code of the game).

You can convert from xs coordinates to rm coordinates and back from using functions like this:
double vectorX = xsVectorGetX(kbGetBlockPosition(unit));

where unit is the object you created and placed on the map (say, a cinematic block) to give you a reference.

The xs functions were mainly used in the .ai scripts but were usable in RMS as well.  You just have to do some digging into the existing ai and RMS files to get an idea of what they do.  There used to be a community-compiled reference list of all these functions but alas I cannot find it anymore (my bookmark points to a dead site).
Logged
Neuron
Member
*****
Offline Offline

Posts: 30

« Reply #2 on: March 31, 2013, 05:35:04 PM »

Thanks for the reply.

I thought that the vector coordinates must point to a tile number corresponding to a certain point on the X and Z axes (plus the Y coordinate for height/perspective). So if the map has 409 tiles per player per each axis, then a vector defined as:

Code:
xsVectorSet(327.000000,4.000000,286.000000);

could be approximated in X and Z fraction coordinates as (0.7, 0.5). I will try your formula too and see if I get better results, though.

There still are a few sites which keep RMS functions lists and still work. One is an AoM reference site, but many functions from the older game were kept in AoE3 too, so it's still useful:

http://aomcodereference.googlecode.com/svn/trunk/doc/aom/scripting/xs/rm/package-summary.html

Another japanese site keeps mostly the Aoe list:

http://tournament.jpn.org/modules/xpwiki/397.html

There's also a copy of the old site made by Monty Python, but some functions from his list didn't work in Aoe and the guide was incomplete.

Even the lists from these sites are incomplete. I have a list of all the RMS commands, variables and constants, but there are some which no one ever used or explained on any site (such as rmSetMapClusteringObjectParams or as rmCreateCliffRampMaxDistanceConstraint).

The code I quoted from in my OP was from a map template made by a user from heavengames who quoted on each line the syntax help for each command. He had lots of references to Aoe3 Help files in which random map functions were explained in separate files. So I thought he had access to developer manual from the game makers, I thought. Well, I couldn't find that user so that's why I asked you. Thanks for the answer, anyway.
Logged
pftq
Administrator
*****
Offline Offline



Posts: 4198

WWW
« Reply #3 on: March 31, 2013, 06:41:24 PM »

Oh yeah the RM functi0ns are easy to find.  I meant the xs, kb, and other functions.  They're much less documented.

I don't know about a developer manual though, sorry.
Logged
Pages: [1] Print 
pftq Forums  |  Main  |  General Discussion  |  RM functions developer help files? « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines | RSS Feed Valid XHTML 1.0! Valid CSS!
Page created in 0.116 seconds with 21 queries.