Author Topic: How do I fix this problem?  (Read 341 times)

Legacy_ZugothNDeadly

  • Full Member
  • ***
  • Posts: 174
  • Karma: +0/-0
How do I fix this problem?
« on: June 05, 2015, 07:22:36 am »


               

How do I make it so that I can't pass through this placeable?World%20of%20Warcraft%20Cu_0001_zpsnpsbh



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
How do I fix this problem?
« Reply #1 on: June 05, 2015, 09:41:59 am »


               The best way is to make a .pwk walkmesh file in a modelling tool, if you have the skills. Or, take the .pwk for a similar object; rename it to match the .mdl you're trying to fix, and, using a text editor, change all the internal references to the model name. Or, use the invisible walls - CEP has a door-sized one that might suit.
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
How do I fix this problem?
« Reply #2 on: June 05, 2015, 04:43:57 pm »


               

Depending on the size of the area to block movement there are a few ways to do it.


 


1 - Do as Proleric suggested and make a .pwk that blocks movement.


 


2 - Also as Proleric stated, if using the CEP, use their invisible placeables to block movement. You set them to "activated" to see them when placing them and set them to "deactivated" afterwards so they are not seen IG.


 


3 - Place the script found below in the OnEntered event of a generic trigger that is drawn just outside of the perimeter of the placeable. It'll block movement for PCs only. Having it affect NPCs tends to break their AIs and they'll get stuck.



void MoveBackAction(location locBackLocation)
{
    SetCommandable(TRUE);
    ClearAllActions();
    ActionMoveToLocation(locBackLocation);
    ActionWait(0.6);
    ActionDoCommand(SetCommandable(TRUE));
    SetCommandable(FALSE);
}
void HitForceFieldAndForceBack(object oCreature, vector vLastPostion)
{
    vector vCurrentPosition= GetPosition(oCreature);
    vector vNewPosition= Vector();
    vNewPosition.x= vCurrentPosition.x - (vCurrentPosition.x - vLastPostion.x) * 1.75;
    vNewPosition.y= vCurrentPosition.y - (vCurrentPosition.y - vLastPostion.y) * 1.75;
    location locNewLocation= Location(GetArea(oCreature), vNewPosition, GetFacing(oCreature));
    AssignCommand(oCreature, MoveBackAction(locNewLocation));
}
void main()
{
    object oCreature= GetEnteringObject();
    if (!GetIsPC(oCreature)) return;
    AssignCommand(oCreature, ActionDoCommand(SetCommandable(FALSE)));
    vector vCreature= GetPosition(oCreature);
    DelayCommand(0.1, HitForceFieldAndForceBack(oCreature, vCreature));
}