Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

kotor2 How can I script an appearance change?

Page: 1 of 1
 Randydgx
05-05-2007, 1:33 PM
#1
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, 2:20 PM
#2
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, 2:24 PM
#3
actualy that was an example, im trying to do one for mandalore for the no_helmet mandalore
 stoffe
05-05-2007, 2:29 PM
#4
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);
}
}
}
Page: 1 of 1