So for the Cep gloves which you will not be using I had this onenter or buildings:
//Put this script OnEnter call it nomount
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
object oItem;
oItem = GetItemInSlot(INVENTORY_SLOT_ARMS, oPC);
if(GetLocalInt(oPC, "Mounted") != 1)
return;
if (GetIsObjectValid(oItem))
{
AssignCommand(oPC, ActionUnequipItem(oItem));
FadeToBlack(oPC, FADE_SPEED_FASTEST);
DelayCommand(2.8, FadeFromBlack(oPC, FADE_SPEED_FASTEST));
}
}
Then I would just put a line in the on enter of the area which restricts mounts:
ExecuteScript("nomount",GetModule());
Now with the advent of horse support non Cep you have the functions that check for mount restricted areas selected by a variable. Thus:
if (!GetLocalInt(oAreaTarget,"X3_MOUNT_OK_EXCEPTION"))
{ // check for global restrictions
if (GetLocalInt(GetModule(),"X3_MOUNTS_EXTERNAL_ONLY")&&GetIsAreaInterior(oAreaTarget)) bNoMounts=TRUE;
else if (GetLocalInt(GetModule(),"X3_MOUNTS_NO_UNDERGROUND")&&!GetIsAreaAboveGround(oAreaTarget)) bNoMounts=TRUE;
} // check for global restrictions
etc... but since Cep does not use the same method the module does not know you are mounted, so you just have to do it manually. Of course some clever soul could probably just use these functions through Cep by adding a variable like the MountI which was really something internal which I still use. Thus it covers those in my Orilion Nights module that either dismount properly or just click on the door while mounted. That's where those above functions come in the player will they be auto dismounted at that point if they just click on the door.
Modifié par ffbj, 05 février 2013 - 06:48 .