PDA

View Full Version : kotor2 How can I script an appearance change?


Randydgx
05-05-2007, 01:33 PM
kotor2 How can I scrpt an appearance change?

for example I want to script it when fired it changes rusted hk-47 into an hk-50 model. So i can put an option like "HK-47, mind if I repair your outer shell of its rust?" "HK-47: Observation: You seem to have the skills, I will let you"
So the script would then fire and change from model hk-47 to hk-50

thanks for any help,
Randy

stoffe
05-05-2007, 02:20 PM
kotor2 How can I scrpt an appearance change?

for example I want to script it when fired it changes rusted hk-47 into an hk-50 model. So i can put an option like "HK-47, mind if I repair your outer shell of its rust?" "HK-47: Observation: You seem to have the skills, I will let you"
So the script would then fire and change from model hk-47 to hk-50


Something like this should work:


void main() {
object oHK = GetObjectByTag("hk47");

if (GetIsObjectValid(oHK) && (GetAppearanceType(oHK) == 3)) {
ChangeObjectAppearance(oHK, 538);
}
}


It will check if HK47 uses his old appearance, and if so switch the appearance type to HK50.

(Though for storyline reasons he wouldn't want to, since he says he much prefers his fear-inspiring rust red armor to the plain steel chassi of his cheap clones. :))

Randydgx
05-05-2007, 02:24 PM
actualy that was an example, im trying to do one for mandalore for the no_helmet mandalore

stoffe
05-05-2007, 02:29 PM
actualy that was an example, im trying to do one for mandalore for the no_helmet mandalore

Another example script that toggles Mandalore's helmet on/off each time it's run:

void main() {
object oCandy = GetObjectByTag("mand");

if (GetIsObjectValid(oCandy)) {
if (GetAppearanceType(oCandy) == 639) {
ChangeObjectAppearance(oCandy, 462);
}
else if (GetAppearanceType(oCandy) == 462) {
ChangeObjectAppearance(oCandy, 639);
}
}
}