Aller au contenu

Photo

Getting a creature to spawn at the EXACT location of a placeable - Can this be done?


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

I'm working on Baba Yaga's Hut for the current CCC challenge and I need the creature version of the model to spawn at the exact location as the placeable. Currently, no matter what delays settings I use to destroy the placeable, the creature spawns to the right of the placeable's location. I think it might be because of the pwk associated with the placeable. Is there a way to get this to work that does not require removing the pwk geometry from the hut placeable?

 

Here's my script:

 

//Placeable OnUsed

 

void main()
{
    object oHut = CreateObject(OBJECT_TYPE_CREATURE, "qc_babayagahut", GetLocation(OBJECT_SELF));
    SetPlotFlag(OBJECT_SELF, FALSE);
    DestroyObject(OBJECT_SELF, 0.5);
}


#2
Shadooow

Shadooow
  • Members
  • 4 471 messages

Try custscene ghost the creature before spawning placeable.

 

If that wont work try adjust the locations Z position by -1.


  • WhiteTiger aime ceci

#3
henesua

henesua
  • Members
  • 3 883 messages

is there a way to cut a hole in the PWK so that the creature can spawn into the center of the donut?



#4
Proleric

Proleric
  • Members
  • 2 361 messages

Try custscene ghost the creature before spawning placeable.

If that wont work try adjust the locations Z position by -1.


... or cutscene ghost the placeable.

Nuance - if the placeable is in an inaccessible location, the creature can never spawn there. One workaround is to create a null creature at the proposed location of the placeable, then use its exact location, which will always be legal.

Another nuance - cutscene ghost will bake on a placeable when the last player leaves the area, so, if that can happen, OnExit must remove the effect, setting a flag to reapply it when a player next enters.

Modifié par Proleric, 03 juin 2014 - 10:29 .


#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
void main()
{
    object oHut = CreateObject(OBJECT_TYPE_CREATURE, "qc_babayagahut", GetLocation(OBJECT_SELF));
    SetPlotFlag(OBJECT_SELF, FALSE);
    DestroyObject(OBJECT_SELF, 0.5);
}
 

Is that not backwards?
 
Should you not be destroying the object and then creating the creature.
 
void vObj(object oObj) {}

void main()
{
  location lLoc = GetLocation(OBJECT_SELF);
  AssignCommand
  (
    GetArea(OBJECT_SELF),
    DelayCommand
    (
      0.5,
      vObj
      (
        CreateObject
        (
          OBJECT_TYPE_CREATURE,
          "qc_babayagahut",
          lLoc
        )
      )
    )
  );
  DestroyObject(OBJECT_SELF);

}



  • Proleric et Pstemarie aiment ceci

#6
Pstemarie

Pstemarie
  • Members
  • 2 745 messages
void main()
{
    object oHut = CreateObject(OBJECT_TYPE_CREATURE, "qc_babayagahut", GetLocation(OBJECT_SELF));
    SetPlotFlag(OBJECT_SELF, FALSE);
    DestroyObject(OBJECT_SELF, 0.5);
}
 

Is that not backwards?
 
Should you not be destroying the object and then creating the creature.
 
void vObj(object oObj) {}

void main()
{
  location lLoc = GetLocation(OBJECT_SELF);
  AssignCommand
  (
    GetArea(OBJECT_SELF),
    DelayCommand
    (
      0.5,
      vObj
      (
        CreateObject
        (
          OBJECT_TYPE_CREATURE,
          "qc_babayagahut",
          lLoc
        )
      )
    )
  );
  DestroyObject(OBJECT_SELF);

}


 

Works like a charm. Thanks a lot!