View Single Post
Old 04-08-2012, 01:47 PM   #11
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 571
Example... part of k_503_enter.nss from TSLRCM 1.8;
Code:
void sub3() {
	object oSittingRodian = GetObjectByTag("SittingCommMale", 0);
	DelayCommand(0.1, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingSwoopganger", 0);
	DelayCommand(1.3, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingCommFemale", 0);
	DelayCommand(0.7, AssignCommand(oSittingRodian, ActionPlayAnimation(38, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingSwoopganger", 1);
	DelayCommand(0.3, AssignCommand(oSittingRodian, ActionPlayAnimation(36, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingAlien", 0);
	DelayCommand(1.0, AssignCommand(oSittingRodian, ActionPlayAnimation(36, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingCommFemale", 1);
	DelayCommand(2.1, AssignCommand(oSittingRodian, ActionPlayAnimation(38, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingCommMale", 1);
	DelayCommand(2.2, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingWalrusman", 0);
	DelayCommand(0.1, AssignCommand(oSittingRodian, ActionPlayAnimation(36, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingBith", 0);
	DelayCommand(1.3, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingBith", 1);
	DelayCommand(0.1, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingRodian", 0);
	DelayCommand(2.2, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingCommMale", 2);
	DelayCommand(0.1, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingCommMale", 3);
	DelayCommand(0.8, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingCommFemale", 2);
	DelayCommand(1.2, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
	oSittingRodian = GetObjectByTag("SittingCommFemale", 3);
	DelayCommand(0.3, AssignCommand(oSittingRodian, ActionPlayAnimation(37, 1.0, (-1.0))));
}
IIRC 37 is drinking, 36 is just sitting and 38 is playing pazaak.

And here's the start of the main part;
Code:
void main() {
	if ((GetEnteringObject() != GetFirstPC())) {
		return;
	}
	sub1();
	sub3();
	if (GetLoadFromSaveGame()) {
		return;
	}
You can do it without sub (most do), but it was already the case here... and it's a bit too much to do without.
Also make sure the tags match (in vanilla, this was NOT the case)
Hassat Hunter is offline   you may: quote & reply,