QUE/ - Scripting

Post » Wed May 04, 2011 8:43 am

Is it possible to script an NPC to always track his position in relation to an object, then move by himslef to a certain spot in relation to the same object. Even while the object moves around with "setposition" ??



Thanx in advance!
User avatar
Big Homie
 
Posts: 3479
Joined: Sun Sep 16, 2007 3:31 pm

Post » Wed May 04, 2011 12:46 am

Yes, just make sure that the object whose position you are recording doesn't get deleted as I think the game crashes on null references. Pseudo script would be:

1) Copy coordinates of object in question
2) Copy coordinates of NPC
3) Fancy trig to calculate NPC's new postion
4) Set NPC's new position.
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Wed May 04, 2011 5:09 am

yes, might need MWSE to use an extended function rather than writing a whole trigonometry script. store the moving objects coordinates as globals, and use xaitravel.
User avatar
Maya Maya
 
Posts: 3511
Joined: Wed Jul 05, 2006 7:35 pm

Post » Wed May 04, 2011 10:54 am

Thank you both. You have given me some things to think about.
User avatar
Tyler F
 
Posts: 3420
Joined: Mon Aug 27, 2007 8:07 pm


Return to III - Morrowind