View Single Post
Old 10-25-2013, 09:22 PM   #318
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by Taunger View Post
Say, can anyone enlighten me on the exact difference between the ActionDoCommand and AssignCommand functions (in K1)?

I found someone saying that ActionDoCommand works for assigning actions, and AssignCommand for non-actions. If that is true, then what exactly is an action and what is a non-action (that is still assignable)?
I'm pretty certain you have to always use AssignCommand whenever you're making an object do something. However, ActionDoCommand is used to add commands to the object's action queue that would not be added just by using an AssignCommand. For example, in a script like this:

Code:
void main()
{


   AssignCommand(GetObjectByTag("Carth"), ActionForceMoveToObject(GetObjectByTag("Bastila")));
   AssignCommand(GetObjectByTag("Carth"), SetFacing(325.5));

}
SetFacing is not a command that is inherently added to the action queue, thus Carth's walking command would most likely be messed up by his trying to face 325.5 degrees.

However, if you set it up like this:

Code:
void main()
{


   AssignCommand(GetObjectByTag("Carth"), ActionForceMoveToObject(GetObjectByTag("Bastila")));
   AssignCommand(GetObjectByTag("Carth"), ActionDoCommand(SetFacing(325.5)));

}
It adds SetFacing to the action queue, so Carth will finish walking to Bastila before he turns to face 325.5 degrees.

You can read up on ActionDoCommand, and all things scripting, here.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,