Jump to content

Home

Three scripts I need


Warlord664

Recommended Posts

Alright I just tested the credit one and it works Ty har. However the attack one doesn't seem to work. Can you guys take a look and see what I did wrong?

 

void main() {

object oObject1=GetObjectByTag("to'ggar");

object oObject2=GetObjectByTag("degar");

 

ChangeToStandardFaction(oObject1, 12);

ChangeToStandardFaction(oObject2, 13);

 

ExecuteScript("k_ai_master",oObject1,1005);

ExecuteScript("k_ai_master",oObject2,1005);

 

DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE _TEMPORARY,eStun, oTarget));

effect eStun = EffectDeath();

object oTarget = GetObjectByTag("degar");

 

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun, oTarget);

 

 

}

 

Ty.

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Okay, I played around with your script and it boils down to the way you made it. Anyways here's a working script that should do what you want, I made sure that it compiles on my computer:

 

void main() {

 

effect eStun = EffectDeath();

object oTarget = GetObjectByTag("degar");

object oObject1=GetObjectByTag("to'ggar");

object oObject2=GetObjectByTag("degar");

 

ChangeToStandardFaction(oObject1, 12);

ChangeToStandardFaction(oObject2, 13);

 

ExecuteScript("k_ai_master",oObject1,1005);

ExecuteScript("k_ai_master",oObject2,1005);

 

DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun, oTarget));

 

}

Link to comment
Share on other sites

The problem I had with that line is that there is for some God awful reason a space between "TYPE" and "_TEMPORARY" I thought I removed that but now that I look at it for some reason it's still there. I edited the script in the post so that you should now be able to compile it, sorry about that.

 

-----EDIT-----

Hmmm, I went in to edit the script but it shows that there is no space where I said there was, but looking at the script it looks like there is a space. You'll have to go in manually and remove the space right where I mentioned above. I don't know why Lucasforums is doing this but as I upload the script it's fine but when I copied it, there's a space. Any just remove the space and you should be able to compile it.

Link to comment
Share on other sites

It doesn't look like there is a space

 

void main() {

 

effect eStun = EffectDeath();

object oTarget = GetObjectByTag("degar");

object oObject1=GetObjectByTag("to'ggar");

object oObject2=GetObjectByTag("degar");

 

ChangeToStandardFaction(oObject1, 12);

ChangeToStandardFaction(oObject2, 13);

 

ExecuteScript("k_ai_master",oObject1,1005);

ExecuteScript("k_ai_master",oObject2,1005);

 

DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE _TEMPORARY,eStun, oTarget));

 

}

Theres just a _ and thats it.
Link to comment
Share on other sites

I downloaded it doesn't seem to have a .nss with it and when i try to open the the ncs I downloaded it just brings up kotor tool with no script. soo..I guess im not understanding something here.

 

 

Edit:Ok i opend it and i was like what??? its like ten millions miles long I would post it but...its ten million miles long.

Link to comment
Share on other sites

Very interesting indeed... the whole added " " near that"_" is quite strange.

 

Another workaround for this is to simply use the number constants that correspond to the DURATION_TYPE_*'s.... specifically 0,1 & 2.

 

From the lexicon:

DURATION_TYPE_* Constant Group

 

Duration types for ApplyEffectAtLocation and ApplyEffectToObject functions.

 

 

Constants

Constant Value Description

DURATION_TYPE_INSTANT 0

Instantaneous. This would apply to any effect that is both immediate and permanent and cannot be removed. EffectDamage would be one example, as well as any of the 'fire-and-forget' visual effects.

DURATION_TYPE_PERMANENT 2

Permanent duration. This is as it sounds... the effect lasts until removed or dispelled

DURATION_TYPE_TEMPORARY 1

A temporary duration means that the effect must have a duration specified in the command (and is the only time this is so). Once the time has expired, the effect will be removed.

 

This brings about a potential explanation for a failed compilation, although harIII has it working. Essentially, you have applied a temporary effect, but you have not removed it... It should, according to definition, need a time limit.

 

Also, it is worth looking at what type of effect you are dealing with. Some effects should only be used as FNF, which means an instant duration should ONLY be applied.

Link to comment
Share on other sites

Ok the downloadthe sript ty Har . I just had the chance to try the script out. when I started the conversation it gets to the part where its activates the trigger. All it does is make the guy who was soppose to get killed by the other hostile and after the conversation ends he trys to attack me but fails because of the drop dead script and the other guy is still normal. If I make the conversation longer he just drops dead. Sooo...Now what did I do wrong? I didn't mess with the script.

Link to comment
Share on other sites

void main() 
{
  object oObject1=GetObjectByTag("to'ggar");
  object oObject2=GetObjectByTag("degar");
  effect eStun = EffectDeath();

  ChangeToStandardFaction(oObject1, 12);
  ChangeToStandardFaction(oObject2, 13);
  ExecuteScript("k_ai_master",oObject1,1005);
  ExecuteScript("k_ai_master",oObject2,1005);
  DelayCommand(5.0,ApplyEffectToObject(0,eStun, oObject2));
}

This is a redo of your original script, Warlord664. The main difference is that I used the integer value of 0 instead of the word constant DURATION_TYPE_TEMPORARY. If you read my earlier post, using 0 changes this into a FNF, or fire-and-forget, effect, which is correct for the EffectDeath() function. This compiles fine, although I cannot guarantee that the results will be what you are looking for. You may also want to play with the length of the DelayCommand.

 

EDIT: To make this all happen according to how you want it to play out, you may want to simply build the combat into the dialog, and make the dialog fire the effect of death when you want it to. You can have a dialog with no words but plenty of animation calls and camera views...

Link to comment
Share on other sites

What I wanted was in the conversation to have To'ggar swing his weapon at degar and kill him. but these script just make to'ggar sit there while degar drops dead. Is there an attack animationin the conversation that I can give to'ggar?

 

Edit: And I also realised that npcs that are aleady in game have alot more animation options in the dlg editer then npcs i put down. Is there a way to get these extra animations on my npcs?

Link to comment
Share on other sites

If you want To'ggar to swing his weapon and kill Degar here is the script for that:

 

void main ()

{

      object oShooter = GetObjectByTag("to'ggar");
object oTarget = GetObjectByTag("degar", OBJECT_SELF, 1);

      ActionPauseConversation();

ChangeToStandardFaction(oShooter, 2);
ChangeToStandardFaction(oTarget, 4);

ApplyEffectToObject(1, EffectAssuredHit(), oShooter, 0.3); 
DelayCommand(0.3, AssignCommand(oShooter, ActionAttack(oTarget, 0))); 
}

 

That should make To'ggar do a default attack and kill Degar. Of course, you'd have to have Degar's health set to be something very low or time out how long it takes for To'ggar to run over to Degar and kill him and then have a delaycommand that applies instant death to Degar when To'ggar swings his weapon. As to the animation you would need a script that looks something like this:

 

AssignCommand(OBJECT_SELF, ActionPlayAnimation(25, 1.0, (-1.0)));

 

Of course you'd have to add in voidmain at the beginning as well as put the correct animation number in the place of 25 but that's the main gist of it.

 

Hope this helped.

Link to comment
Share on other sites

void main ()

{

  object oShooter = GetObjectByTag("to'ggar");
  object oTarget = GetObjectByTag("degar"[color=darkorange], OBJECT_SELF, 1[/color]); 
  [color=darkorange]// Here is the problem, either need to declare oTarget as OBJECT_SELF or by tag, but not both[/color]

  ActionPauseConversation();
  ChangeToStandardFaction(oShooter, 2);
  ChangeToStandardFaction(oTarget, 4);
  ApplyEffectToObject(1, EffectAssuredHit(), oShooter, 0.3); 
  DelayCommand(0.3, AssignCommand(oShooter, ActionAttack(oTarget, 0))); 

}

By cutting out the orange part in the oTarget line, you will have a functional .nss that will compile fine :)

Nice work Fallen Guardian! You are working things out quite nicely :clap2:

Link to comment
Share on other sites

void main ()

{

  object oShooter = GetObjectByTag("to'ggar");
  object oTarget = GetObjectByTag("degar"[color=darkorange], OBJECT_SELF, 1[/color]); 
  [color=darkorange]// Here is the problem, either need to declare oTarget as OBJECT_SELF or by tag, but not both[/color]

  ActionPauseConversation();
  ChangeToStandardFaction(oShooter, 2);
  ChangeToStandardFaction(oTarget, 4);
  ApplyEffectToObject(1, EffectAssuredHit(), oShooter, 0.3); 
  DelayCommand(0.3, AssignCommand(oShooter, ActionAttack(oTarget, 0))); 

}

By cutting out the orange part in the oTarget line, you will have a functional .nss that will compile fine :)

Nice work Fallen Guardian! You are working things out quite nicely :clap2:

 

 

Thanks, I'm still not great at scripting as seen by my error though.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...