PDA

View Full Version : Various Miscellaneous Questions (Scripting and Item Creation)


Lord Hydronium
08-16-2005, 08:10 AM
All of these questions are for KOTOR I, although if there are different solutions in TSL I'd like to hear them.

1. Is it possible to have a droid utility item with multiple "Activate Spell" effects? If it can't be done directly, like it's hardcoded that each utility item can only grant one spell or something of that nature, is there any way to kludge it to get the same effect?

2. How can I do something like Zaalbar being removed from your party on Kashyyyk? I get SetNPCSelectability to make him inaccessible, but in Zaalbar's case it takes him off the Ebon Hawk as well.

3. How can I make an NPC the sole party member, like in the Leviathan escape? I tried looking through the compiled scripts, but I couldn't even find the script that triggers it.

4. A problem: I'm using tk201's Traveling to Custom Planets tutorial (http://www.lucasforums.com/showthread.php?t=127001), but after I compile k_pebn_galaxy, put the ncs into the Override folder, and load up a game on the Hawk and try to access the galaxy map, it simply doesn't open. I click, and nothing happens. k_inc_ebonhawk is changed and everything.

Thanks for any answers.

Darth333
08-16-2005, 10:34 PM
1. Is it possible to have a droid utility item with multiple "Activate Spell" effects? If it can't be done directly, like it's hardcoded that each utility item can only grant one spell or something of that nature, is there any way to kludge it to get the same effect?
yes, just modify k_sup_droid.nss to add all the effects you want :) You can also create your own droid utility and add your own custom script. It works very much like force powers. In the .uti file for your utility, in Subtype field of the Properties list, you have to point out to a new line in spells.2da. Then, in the spells.2da column called impact script, just refer to your custom script.

Apart from a few additional colums in spells.2da, TSL works the same way as K1 in that respect .

You have an explanation of what the spells.2da fields are used for in this thread: http://www.lucasforums.com/showthread.php?t=130898

2. How can I do something like Zaalbar being removed from your party on Kashyyyk? I get SetNPCSelectability to make him inaccessible, but in Zaalbar's case it takes him off the Ebon Hawk as well.
As far as I remember I used SetNPCSelectability(NPC_BLABLA, FALSE); and it worked fine. Could you post the script you are using?


3. How can I make an NPC the sole party member, like in the Leviathan escape? I tried looking through the compiled scripts, but I couldn't even find the script that triggers it.
You can use the function SwitchPlayerCharacter


4. A problem: I'm using tk201's Traveling to Custom Planets tutorial (http://www.lucasforums.com/showthread.php?t=127001), but after I compile k_pebn_galaxy, put the ncs into the Override folder, and load up a game on the Hawk and try to access the galaxy map, it simply doesn't open. I click, and nothing happens. k_inc_ebonhawk is changed and everything.
It's been a while. I would have to check this one.

Lord Hydronium
08-17-2005, 03:28 AM
OK, problem 4 is solved. It turns out I wasn't compiling with the -v1.00 switch. I recompiled with that, and the galaxy map works fine. Thanks for the help on 3.

yes, just modify k_sup_droid.nss to add all the effects you want :) You can also create your own droid utility and add your own custom script. It works very much like force powers. In the .uti file for your utility, in Subtype field of the Properties list, you have to point out to a new line in spells.2da. Then, in the spells.2da column called impact script, just refer to your custom script.

Apart from a few additional colums in spells.2da, TSL works the same way as K1 in that respect .

You have an explanation of what the spells.2da fields are used for in this thread: http://www.lucasforums.com/showthread.php?t=130898

But even with this it's still only possible to have one spell per utility item, right? If I wanted, say, a device that allows a droid to activate either the flamethrower or stun ray spells (individually), I don't seem to be able to add two "Activate Item" (sorry, I got the name wrong earlier) fields to the uti and get them both to work. Only the first one displays in attack mode.

As far as I remember I used SetNPCSelectability(NPC_BLABLA, FALSE); and it worked fine. Could you post the script you are using?
Sorry, I guess I wasn't clear. SetNPCSelectability makes it impossible to put them in your party, but I think they're still on the Ebon Hawk. If it's a case like Bastila on Korriban, where she simply stays on the ship and you just can't take her with you, that's no problem. But I want something like Zaalbar's scenario (except using T3-M4 in this case), where not only is he unselectable, but he isn't on the Ebon Hawk either. And removing them from the party doesn't really work, either, since that doesn't allow you to bring them back in the same state they were removed.

However, I think I figured it out. It seems to be in the k_pebn_pophawk script that loads when you enter the Ebon Hawk. I believe it makes sure not to load Zaalbar if the global for his capture is set. I was thinking I could use ExecuteScript and insert a DestroyObject command after it, but that doesn't seem to be working. Any ideas on how to make one of the NPCs on the Hawk not appear?

Darth333
08-17-2005, 10:52 AM
But even with this it's still only possible to have one spell per utility item, right? If I wanted, say, a device that allows a droid to activate either the flamethrower or stun ray spells (individually), I don't seem to be able to add two "Activate Item" (sorry, I got the name wrong earlier) fields to the uti and get them both to work. Only the first one displays in attack mode.
I see. Sorry, I misunderstood the question.

Well you could always have a script that fires randomly this or that effect. If you prefer, you could also set conditions in your script. Per example, if the target is a human, then do this and if it's a droid then do that.

The other possibility, if you want to have the choice when you control the droid is to make a dialogue with the armband where you can select the effect. Just use a script that fires the .dlg

ActionStartConversation(GetFirstPC(), "my_dlg");

Check the whereami armband if you want an example: http://www.starwarsknights.com/tools.php

However, it is not very practical to see a dialogue during a battle...

For the rest, I would have to check it. I don't have the game with me right now.