Jump to content

Home

Few Q about TSL scripts


oldflash

Recommended Posts

I have look over files from script.bif/script source and I got some questions:

 

a_camera_view.nss (Y/N) is used for focusing camera on target object?

 

a_destroy.nss (Y/N) can be used for any object on the area? (Y/N) can be used for objects on other area?

 

a_exit.nss If I use this script on a npc and leave area when I come back that npc will be spawn again or remain destroyed?

 

a_fab_spawn.nss If I use this script on a npc and leave area when I come back that npc will be where I spawned?

 

a_flourish.nss (this will be nice) can be modifyed to:

case1:check if current weapon is certain dblLsaber and if is true destroy item, create and equipp both hands with certain lightsabers then flourish weapon

case2: same as previous but check if in both hands have certain lightsabers and if true destroy both create and equipp dblLightsaber than flourish weapon

 

a_geeda_set.nss (y/n) can be set to recive from geeda unique items as bonus for making new route aviable?

 

a_master_teach.nss/a_give_form.nss (y/n) beside forms can recive special items like crystals?

 

a_givelight.nss/a_givedark.nss (y/n) can be "adjusted" do recive 2x or 3x points?

 

a_givepower.nss (y/n) can be combined with giveforcepoints?

 

a_global_fadein.nss/a_global_fadeout.nss Affect only camera? or can be used for items/creatures?

 

a_hostile.nss (y/n) can be used on certain npc/creature/droid to be turned on hostile and attack pc?

 

a_influence_dec.nss/a_influence_inc.nss same as ls/ds points can be adjusted?

 

a_leaveparty.nss What is good for?

 

a_makejedi.nss This is uset to turn npc's in jedi? can I change jedi class and give some items to npc's like robes or/and crystals?

 

a_pc_jedi.nss With this can I get some special items when I get prestige class?

 

a_play_anim.nss Can I use this on handmaiden/disciple to do some "dance at request"? (and call music play)

 

k_inc_q_crystal.nss/c_q_cryst_change.nss/a_q_cryst_change.nss Can I use (which one?) similar script on Bao-Dur to upgrade for me ls upgrade parts? and since I have modifyed exptable to reach lv 48-50 at the end of the game can I increase number of fullname crystals? (original 1=>9)

 

a_setinfluence.nss can be used to multiply influence points? 2x;3x...

 

a_sisteratk.nss This was cut from game?

 

a_speed_set.nss can be used as custom force for "bulett time effect"

 

c_chkcredits.nss can be used as cheat to gain credits if I don't have enought?

 

fightback.nss This script is used for automatic attack?

 

k_def_buff.nss can be used to make combat more "interesting"?

 

k_inc_hawk.nss Can be edited to show starmap instead of current planet?

 

k_inc_item_gen.nss can be edited to gain more items from t3m3, mira, mandalore, disciple? I also saw there something about bao-dur and atton...

 

k_workbench_bd.nss Bao-Dur: portable workbench? This was also cut from game?

 

Thanks

Link to comment
Share on other sites

...:eyeraise: just a few questions? hehe it's much longer than my usual grocery list :p

 

a_camera_view.nss (Y/N): yes and no. It does not determine the camera angle but which camera you are using. You must first have a camera placed in a decent location in your module (via the .git file ). To find the cameras in the module, you can use the script provided by xcom in this thread: http://lucasforums.com/showthread.php?t=145924 and attach it to the whereami armband. Then you can play with the camera angle in the .dlg file

 

a_destroy.nss: you can use it to destroy objects in the area you are in.

a_exit.nss: it depends on how the npc is spawned and on the conditions. If you set no conditions to spawn him, then the npc will be created again each time you enter the module. Per example, if you use a script with those lines and set no conditions the npc will be re-created each time you enter the module as the code checks if the object exists and if not tells the game to create it:

 if  (!GetIsObjectValid(GetObjectByTag("my_npc")))
          {
         CreateObject(OBJECT_TYPE_CREATURE, "my_npc", Location(Vector(0.00,0.00,0.00), 0.0));

a_fab_spawn.nss : you still have to place a waypoint somewhere if you want to use it.

a_flourish.nss : this script only makes an npc flourish the weapon that is currently equipped. I don't suggest you edit the existing a_flourish.nss but You can make your own script however to unequip and reequip weapons (no need to destroy) .

     void main()
{ 
     object oTarget = GetObjectByTag("my_npc");
     object oOlditem = GetItemInSlot(INVENTORY_SLOT_*,oTarget);
     object oNewitem = GetItemPossessedBy(oTarget, "item_resref");
     AssignCommand(oTarget,ActionUnequipItem(oOlditem));
     if (GetIsObjectValid(oNewitem)) 
     {
       AssignCommand(oTarget,ActionEquipItem(oNewitem, INVENTORY_SLOT_*,TRUE));
       DelayCommand(0.5, ActionDoCommand( CreatureFlourishWeapon(oTarget) ));
     }
    else
     {
       object oNew= CreateItemOnObject("item_resref",oTarget);
       AssignCommand(oTarget,ActionEquipItem(oNew, INVENTORY_SLOT_*,TRUE));
       DelayCommand(0.5, ActionDoCommand( CreatureFlourishWeapon(oTarget)));
     }
}

If you want to destroy:

void main() 
{ 
object oNPC=GetObjectByTag("npc_name"); 
object oOldobject = GetItemInSlot(INVENTORY_SLOT_*,oNPC); 
object oNewobject = CreateItemOnObject("my_item_name",oNPC); 
if (GetIsObjectValid (oOldobject)) {
DestroyObject(oOldobject); 
} 
AssignCommand(oNPC,ActionEquipItem(oNewobject, INVENTORY_SLOT_*,TRUE)); 
DelayCommand(0.5, ActionDoCommand( CreatureFlourishWeapon(oNPC) ));
}

 

a_geeda_set.nss : the scripts simply checks for plot advancement to set journal entries but if you wish, you can always edit the script to add a CreateItemOnObject function to give your pc more items according to plot advancement. You can do whatever you want, even turn your PC into a rancor once he reaches a certain point in the quest :xp:

a_givelight.nss/a_givedark.nss: yes, just specify the value in parameter 1

 

That's all for tonight as it's pretty late and that was far more than a few questions. But have a look at nwscript.nss: you have a description of what each function does and also, don't be afraid to experiment. Instead of making a grocery list of scripts you'll eventually use or not use, why don't you come up with a list of what you really need for your mod? The answers can be much more satisfying and appropriate as there are several ways of doing things and some may be more appropriate than others depending on what you want to do.

Link to comment
Share on other sites

k_workbench_bd.nss Bao-Dur: portable workbench? This was also cut from game?

 

Thanks

 

That would more or less summarize how that script works. Using a variant on this script your able to call up a custom itemcreate.2da file as I have done in many of my TSL mods such as the Painted Droid Armor mod or the [TSL] Holowan Plugin. If I recall properly T3M4 also uses a script similiar to this for the same purpose.

 

The scripts that begin with "k_inc_(rest of script name).nss" are include files. So any changes you make to these will only become useful when you compile other scripts that use these scripts.

 

Such as the k_inc_q_crystal.nss/c_q_cryst_change.nss/a_q_cryst_change.nss situation. When you make a change to k_inc_q_crystal.nss and recompile the c_q_cryst_change.nss or a_q_cryst.nss files you will need to have the changed k_inc_q_crystal.nss file in the same folder as the other 2 but you will only end up with 2 ncs files for overide c_q_cryst_change.ncs & a_q_cryst_change.ncs.

Link to comment
Share on other sites

Thanks Darkkender.

Ok, maybe I have exagerated with so many questions but I really want to use most of this scripts or parts.

First: I want to gain some special items from jedi masters when I learn new forms and from Geeda.

Next: Kreia give to pc one unique color crystal when this one gain prestige class.

That crystal will be grow just like "fullname" crystal. Fullname crystal have only 9 variations of stats. I will like to have 12.

With same kind of scripts Bao-Dur will upgrade my lightsaber (lens, emiter, power cell).

A new lightsaber. Unique. Made by Bao-Dur special for pc. Double bladed breakable in 2 lightsabers when flourish weapon is called (same to join back in one piece). Full upgradable at workbench upgrade parts changeable in same time as fullname crystal (s).

All npc which I convert to jedi will get a robe and npc's color crystal.

 

New market place/pazak den on Nar-Shaddaa.

 

http://q-net.netfirms.com/work/01.html => http://q-net.netfirms.com/work/04.html

Small quest for free jedi stuff merchant (ls) or buy-it as slave (ds).

Case 1 (ls)

New merchand stand (new model) in that place

case2 (ds)

This guy will stay on ebon hawk near to exit only when you go to new places. At that time it will give you free items finded on previous planet and will disapear until you go to new one.

On this new place you can play pazak at high stack with Kaalah-Nah's brother.

 

Do you think will be possible?

 

Thanks again for precious help.

Link to comment
Share on other sites

Yes, all this is possible :) However, I don't have time to tell you how right now but I'll get back to you on this later today or tomorrow.

Thanks Darth333. I always knew I will get help here. Still, no need for rush. There is a lot of graphic and modeling work and I will apreciate all help I can get (still want to crack my head by making one script otherwise I will continue to look at the scripts like cat at calendar <local expresion>). I just start to see scripts as text and not as pictures and this is a big step for me.

 

Thanks again for great help and support.

Link to comment
Share on other sites

A few more answers. For the other I have to look at the game files and I can't do it right now.

 

With same kind of scripts Bao-Dur will upgrade my lightsaber (lens, emiter, power cell).

 

To open a conversation option that will make Bao-Dur build your saber, you just need a script that checks if your pc is in possession of the required items:

In the conditional field of your .dlg branch, attach something like this:

 

int StartingConditional()
{
   object oPC= GetPCSpeaker(); 
   object oItem1= GetItemPossessedBy(oPC, "item1resref");
   object oItem2= GetItemPossessedBy(oPC, "item2resref");
   object oItem3= GetItemPossessedBy(oPC, "item3resref");

   if ((GetIsObjectValid(oItem1)) && (GetIsObjectValid(oItem2)) && (GetIsObjectValid(oItem3)))

   {
       return TRUE;
   }
   return FALSE;
}

This will make a conversation branch available only if your pc has the required items in the inventory.

 

Then, to give the saber, you remove the items from the inventory (or the conversation branch will remain available all the time and you'll get an infinite quantity of lightsabers) and you give the new lightsaber:


void main()
{

object oPC = GetPCSpeaker();

//identify items to destroy
object oItem1= GetItemPossessedBy(oPC, "item1resref");
object oItem2= GetItemPossessedBy(oPC, "item2resref");
object oItem3= GetItemPossessedBy(oPC, "item3resref");

//create the new item:
CreateItemOnObject("item_resref", oPC);

//destroy unneeded items
DestroyObject(oItem1);
DestroyObject(oItem2);
DestroyObject(oItem3);
}

 

Double bladed breakable in 2 lightsabers when flourish weapon is called (same to join back in one piece).

 

I am not too sure of what you want here. The flourish script you asked about earlier on is for use during cutscenes. The way to do it, is simply to unequip the single bladed saber and equip two lightsabers. There's no real way to really make a breakable item.

 

New market place/pazak den on Nar-Shaddaa.

To start a pazaak game, it's very simple: fire the a_playpazaak script and set your parameters in the .dlg file (if you look at a_playpazaak.nss, you'll see what I mean)

Link to comment
Share on other sites

I am not too sure of what you want here. The flourish script you asked about earlier on is for use during cutscenes. The way to do it, is simply to unequip the single bladed saber and equip two lightsabers. There's no real way to really make a breakable item.

Most important: Thanks for aswers.

I just find out that script doesn't help me. Is called only from game and is not used when weapon's change, equip or called from keyboard to flourish.

My intention was first of all to use this script to fire other scripts by pressing one key. :) Now I must find another way to do this and since T3M4 was helping me from the begining (it was takeed nice screenshots to my sabers) I think I will edit dialog and add new option: to fire custom script for test.

Also I have try to "clean up" my place (on nar-shaddaa) and after recomp model the lights go off (I think their hiding in refrigerator :( ).

But I'm not give-up, after all, one kick in the b... means one step forward. :D

I just make 2 steps.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...