PDA

View Full Version : Door question...


Ferc Kast
07-24-2008, 05:12 PM
I was setting up a cutscene when I had a question that I couldn't answer. My question is: Can a sealed door be scripted open like a normal door? I already know how to script open a door; I just wanted to verify before I tried it out.

ChAiNz.2da
07-24-2008, 05:16 PM
If it's an actual "door" (not just a skinned wall) then yes :)

I used a script to open the sealed Medical doors in my Kreia Robes mod ;)

EnderWiggin
07-24-2008, 05:56 PM
D3's whereami armband opens any door you'd like - that's just a script attached to the item.

_EW_

Ferc Kast
07-24-2008, 09:43 PM
Thanks for answering that question. That got me started with everything else in my cutscene. However, now that I've gotten most of my cutscene's scripts made & working, I have another question.


Where I have multiple friendlies & multiple hostiles fighting each other, is there a way so that a specific friendly fights only a specific hostile?

Istorian
07-25-2008, 04:59 AM
Yeah, with a script:

void main ()
{
object oNPC = GetObjectByTag("YOUR_TAG_HERE");
object oOPP = GetObjectByTag("YOUR_TAG_HERE");

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);
}


I tried it to see if it works, and it works for me!;)

Ferc Kast
07-25-2008, 01:34 PM
I tried it to see if it works, and it works for me!;)

That worked; But, since I set my utcs to minimum 1 hp, they only fight for a few seconds.

Is there a way to keep them fighting infinitely?

EnderWiggin
07-25-2008, 01:39 PM
Are you saying that once they reach 1hp they stop attacking?

How long is infinitely? I know that's a self-explanatory question, but is it really necessary to be continuous?

You could always pump up their defense and their hp if that's the case.

_EW_

Ferc Kast
07-25-2008, 02:00 PM
Are you saying that once they reach 1hp they stop attacking?

How long is infinitely? I know that's a self-explanatory question, but is it really necessary to be continuous?

You could always pump up their defense and their hp if that's the case.

_EW_

After a few seconds, they stop fighting. But, I want them to keep fighting until and unless I tell to stop. I'd prefer it to continuous b/c i'm gonna have cameras showing each jedi/sith pair fighting. And, I dunno how long I'll want to show them fighting.

Istorian
07-25-2008, 02:14 PM
I think there is....Uncheck the minimum 1 hp of your utcs, and use this script:

void main ()
{
object oNPC = GetObjectByTag("YOUR_TAG_HERE");
object oOPP = GetObjectByTag("YOUR_TAG_HERE");

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);

int nCurrentHP1;
nCurrentHP1=GetCurrentHitPoints(oNPC);
if (nCurrentHP<=40) {
effect EffectHeal(200);
}


int nCurrentHP2;
nCurrentHP2=GetCurrentHitPoints(oOPP);
if (nCurrentHP<=40) {
effect EffectHeal(200);
}

}



Haven't tested this one, though....

Ferc Kast
07-25-2008, 02:25 PM
I'm getting the following error message when I try to compile that script:
http://c.imagehost.org/0341/error.png

Looking at it, those lines are the effect heal lines.

EnderWiggin
07-25-2008, 02:36 PM
I'm getting the following error message when I try to compile that script:
http://c.imagehost.org/0341/error.png

Looking at it, those lines are the effect heal lines.

Try removing the "(200)" afterward on each one. I think it might be because the heal effect doesn't take a parameter like that.

_EW_

Istorian
07-25-2008, 02:52 PM
Try removing the "(200)" afterward on each one. I think it might be because the heal effect doesn't take a parameter like that.

_EW_

When I do that, I have a syntax error at the if:

void main ()
{
object oNPC = GetObjectByTag("YOUR_TAG_HERE");
object oOPP = GetObjectByTag("YOUR_TAG_HERE");

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);

int nCurrentHP1;
nCurrentHP1=GetCurrentHitPoints(oNPC);
if (nCurrentHP<=40) {
effect EffectHeal;
}


int nCurrentHP2;
nCurrentHP2=GetCurrentHitPoints(oOPP);
if (nCurrentHP<=40) {
effect EffectHeal;
}

}

At the green-colored if

EnderWiggin
07-25-2008, 03:28 PM
When I do that, I have a syntax error at the if:

void main ()
{
object oNPC = GetObjectByTag("YOUR_TAG_HERE");
object oOPP = GetObjectByTag("YOUR_TAG_HERE");

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);

int nCurrentHP1;
nCurrentHP1=GetCurrentHitPoints(oNPC);
if (nCurrentHP<=40) {
effect EffectHeal;
}


int nCurrentHP2;
nCurrentHP2=GetCurrentHitPoints(oOPP);
if (nCurrentHP2<=40) {
effect EffectHeal;
}

}

At the green-colored if


Your second if checks a variable that doesn't exist.

Add a "2" after that (as I've shown) to refer to the right thing and it should work ;)

_EW_

Exile007
07-25-2008, 03:38 PM
If I may add, it doesn't look like the NPC's will actually be doing any healing, so here's what I'd put.

void main ()
{
object oNPC = GetObjectByTag("YOUR_TAG_HERE");
object oOPP = GetObjectByTag("YOUR_TAG_HERE");

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);

int nCurrentHP;
nCurrentHP=GetCurrentHitPoints(oNPC);
if (nCurrentHP<=40) {
int nMax=GetMaxHitPoints(oNPC);
effect eHeal=EffectHeal(nMax);

ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHeal, oNPC, 0.0);
}


int nCurrentHP2;
nCurrentHP2=GetCurrentHitPoints(oOPP);
if (nCurrentHP2<=40) {
int nMax2=GetMaxHitPoints(oOPP);
effect eHeal2=EffectHeal(nMax2);

ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHeal2, oOPP, 0.0);
}

}

That should make each NPC heal each time they go below 40 HP. ;)

EnderWiggin
07-25-2008, 04:32 PM
That should make each NPC heal each time they go below 40 HP. ;)

Darn. That's what I get for trying to script away from my computer :(


_EW_

Istorian
07-26-2008, 04:08 AM
@Exile Great script!!

@EW Don't worry, EW!! We all know you're a great scripter!!!:xp: