Jump to content

Home

Moving placeables with scripts?


tk102

Recommended Posts

IM not sure if this will work, but it does when i want to move a charcter around. You dont see it move though!

 

Have you tried using a destroy/spawn script. I.e. you destroy the original and then respawn it in differant coordinates, all in one script. I gues you could give it a go.

 

void main() 
{
 DestroyObject(GetObjectByTag("placeablename"), 0.0, FALSE, 1.0);
float x=33.34; 
float y=147.71; 
float z=0.00; 
float r=0.0f; 
vector vecNPC=Vector(x,y,z); 
location locNPC=Location(vecNPC, r); 
object oNPC=GetObjectByTag("placeable'stag"); 
object oTarget=CreateObject(OBJECT_TYPE_PLACEABLE(???)),"placeablename",locNPC); 
object oPC=GetFirstPC(); 
SetLocalBoolean(oTrigger,0,TRUE);

}

 

- replacing the appropriate npc bits with placeable info

 

i seriously dout that will work, its basically a copy/paste and i cant really test it.

Link to comment
Share on other sites

Hello Doom_Dealer, thanks for responding.

 

I suspected the Destroy/Create Object combo may be the only way to move a placeable, but I was hesistant to use that technique since creating an object is an intensive function. Trying to simulate movement through multiple create/destroy calls would at best be very slow and at worst not work at all or only appear as a teleportation.

 

I have tried using AssignCommand functions on a placeable following a SetCommandable call. This works*, however, placeables appear to be immobile as such. The ActionForceMoveToLocation, ActionForceMoveToObject, and JumpToLocation functions do not work unfortunately on placeables.

 

Edit *=works on creatures

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...