Aller au contenu

Photo

CreateObject (creature) on a walkmesh helper


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

#1
Darin

Darin
  • Members
  • 282 messages
 Used an art pedistal and a sef to make a caryatid column (sef on a collision ball sans collision), with a pillar and merchant tent roof to make the top of the pillar.  Other than the sef'd ball, all are envirnmental.  Trying to set a ramp and walkmesh platform to allow the caryatid, when swapped out for a creature, to spawn in on the pedistal and still be able to walk down and attack...problem is, in spite of specifying the loaction with Location(), still spawns on the floor, NOT on the walkmesh.  Tried this:


case 71:
if( (GetTag(GetItemPossessedBy(oPC,"drl_coldrest_caryatid"))=="drl_coldrest_caryatid") && !(GetTag(oPC)=="co_miior") )
{
oPlate = GetObjectByTag("hh_caryatid_column");
lLoc = Location(GetArea(oPlate),Vector(88.55173, 101.8507, 0.485),ConvertHeading(-180.0));
DestroyObject(oPlate);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE,"drl_caryatid_column",lLoc);
oBow = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oSpawn);
eVis = EffectNWN2SpecialEffectFile("fx_stone_skin_smooth.sef");
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,oBow);
AssignCommand(oSpawn,ActionAttack(oPC,FALSE));
}
break;

(this is inside a Switch command in a generic onenter trigger that uses the tag to determin the number)

This works, but the Caryatid always spawns on the floor, not at the height specified. Advice?

#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
Does the baked walkmesh look right?
Try using a placed waypoint with a unique tag to get your location instead of vector math.

#3
Darin

Darin
  • Members
  • 282 messages
I had used the Placeable on it to get the location, tried the vector math in case that didn't capture height. it's probably the walkmesh, but it's hard to tell if it baked right or not...

#4
Morbane

Morbane
  • Members
  • 1 883 messages
turn on c2 collisions - it will show the walkmesh in 3d

#5
Morbane

Morbane
  • Members
  • 1 883 messages
oh - like Lugaid said - just use a waypoint - the walkmesh is empirical to where a creature spawns - it will appear in the x,y coordinates and on the z where ever it may be - think of an exterior area...

#6
Dann-J

Dann-J
  • Members
  • 3 161 messages
Creatures might also require a certain minimum amount of walkmesh area to spawn into. Otherwise they might spawn in the nearest available part of the walkmesh that has enough room.

#7
Morbane

Morbane
  • Members
  • 1 883 messages

DannJ wrote...

Creatures might also require a certain minimum amount of walkmesh area to spawn into. Otherwise they might spawn in the nearest available part of the walkmesh that has enough room.


exactly

B)

#8
Darin

Darin
  • Members
  • 282 messages
DannJ nailed it. I made the walkmesh a bit bigger (it was between a wall and stairs, but only half of the that space was art ped...but since the rest of the space was irrelevant, I filled it) now it works great.