Jump to content

Home

give item in dialog


Master Orran

Recommended Posts

what script would i do to give the exile a item/alignment points/influence in a dialog. eg if i wanted to give the exile a lightsaber, revan robe and a stealth generator by talking to kreias dead body how would i do it?

 

thanks

-Master O

 

There are standard scripts in KotOR2 that can handle this:

  • a_give_item - Gives the player an item. Set the string param field to the ResRef (name of UTI file without the .uti extension) of the item to give, and the P1 field to the amount of this item to give.
  • a_givelight - Gives the player lightside points, set the P1 field to the number of lightside points to give.
  • a_givedark - Gives the player darkside points, set the P1 field to the number of darkside points to give.
  • a_influence_inc - Increases influence with a party member, set P1 to the party member number (see below) to raise influence with.
  • a_influence_dec - Decreases influence with a party member, set P1 to the party member number (see below) to lower influence with.

 

This is assuming you use tk102's DLG Editor, where you put the name of the script in one of the input boxes labeled Script #, and then the mentioned parameters in one of the boxes to the right of that script name with the above mentioned label (P1 or String Param in these cases).

 

Party member numbers used as parameters by the influence scripts:

0 -Atton

1 - Bao-Dur

2 - Mandalore

3 - G0T0

4 - The Handmaiden

5 - HK-47

6 - Kreia

7 - Mira

8 - T3M4

9 - Visas

10 - Hanharr

11 - The Disciple

 

Note that in the case of the a_give_item script it will only give one item per call, since you can only specify the ResRef of one item template at a time. So if you want to give multiple items you'll need to put it on several dialog entries with different String Param values. Or you could just create your own script that gives all the items in one go, like:

void main() {
   object oPC = GetFirstPC();
   CreateItemOnObject("[color=Yellow]MyFirstItem[/color]", oPC, 1, TRUE);
   CreateItemOnObject("[color=Yellow]MySecondItem[/color]", oPC, 1, TRUE);
   [color=PaleGreen]// ...etc,  Repeat for all the items to give...[/color]
}

 

Where you set the part in yellow to the ResRef of an item to spawn, and then copy/paste that line, changing the yellow part, for as many items as you wish to spawn.

Link to comment
Share on other sites

And for the items themselves you can just edit the placeable for Kreia's corpse, and pick it up during the prologue. (Although i think that those items are destroyed, so it would be better to put them on the plasma torch guy in the morgue.)

 

If you do that though and modify the UTP file directly and put it in the override folder, be very careful to check (using FindRefs) that the name of that UTP file is unique otherwise it will overwrite all other instances using the same name. Which in worst case scenarios may break quests, or lead the player to find the items a hundred times over in every corpse on Peragus, where the items that normally would be found there are gone. :)

 

If you want to place the item in the inventory of such a placeable (corpse) instead of giving them to the player directly I'd recommend using a script to put them there, it's usually a bit safer when there might be naming conflicts involved. Unless you put the modified UTP file back in the RIM or MOD file you got it from.

Link to comment
Share on other sites

  • 6 months later...
Stoffe, it did not work. When I compiled it it just sayed:

 

Aborted with errors.

 

Too many arguments specified in CreateItemOnObject

 

Please post the script you've just tried :). It will be much easier to point out where you've gone wrong that way :).

Link to comment
Share on other sites

void main() {

object oPC = GetFirstPC();

CreateItemOnObject("g_w_vbroshort02", oPC, 1, TRUE);

}

 

If you are trying to compile the script for KOTOR 1 that would explain it. The script is for KOTOR2:TSL, and there have been some changes to the scripting language between the games. In this case the last parameter was added to TSL and does not exist in KOTOR 1. You'll have to remove that value assignment (, TRUE) for it to compile.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...