I finally found out how to use locations and points with triggers in your random map script (RMS). This is useful for
conditions and deploying units at a player/unit sensitive location.
As an Example: You can also use this with some other trigger effects and conditions and surely place variables! Happy deploying in your RMS [This message has been edited by M0nTy PyTh0n (edited 12-18-2002 @ 02:53 PM).]
You create a unit (here: Arkantos) and place it on the map for Player"i" at Player"i" Location:
int myUnit = rmCreateObjectDef("My Arkantos");
rmAddObjectDefItem(myUnit,"Arkantos",1,0.0);
rmPlaceObjectDefAtLoc(myUnit,i,rmPlayerLocXFraction(i),rmPlayerLocZFraction
Now you created an Army for it, called myArmy:
int myArmy = rmCreateArmy(i,"My ArmyName");
rmAddUnitsToArmy(i,myArmy,myUnit);
Now the trigger part of Army Deploy Effect:
rmAddTriggerEffect("Army Deploy");
rmSetTriggerEffectParamArmy("SrcArmy",i,myArmy);
rmSetTriggerEffectParam("ProtoName","Arkantos");
float X1 = rmXFractionToMeters(rmPlayerLocXFraction(i));
float Y1 = 1; /* This is the elevation - leave it at 0 or 1 */
float Z1 = rmZFractionToMeters(rmPlayerLocZFraction(i));
string myArmyLocation = ""+X1+","+Y1+","+Z1;
rmSetTriggerEffectParam("Location",myArmyLocation);
rmSetTriggerEffectParamInt("Count",1);
rmSetTriggerEffectParamInt("Heading",0);
rmSetTriggerEffectParam("Clear","true");
The location variable has its default at "0,0,0". This is at the bottom of the map which is the origin of the coordinate system.
The orientation is:
X1 = distance from lower left map edge
Y1 = height
Z1 = distance from lower right map edge
X1, Y1 and Z1 are float variables in Meters (=Tiles*2) !
MP
RM Scripter - Utility Programmer - Music/Sound Composer/Creator
HYENA STUDIOS
Also on YouTube and MySpace
Partner of Tsunami Studios - Sound and Music Composer