PDA

View Full Version : Making things compatiable


JediKnight707
09-18-2005, 08:19 PM
I was thinking of making my mod (http://pcgamemods.com/mod/15957.html) compatiable with other modded force powers. I couldn't find any tutorials for this, so any help would be great. And also I was wondering how you put a placeable workbench (like in the TSL Holowan Plugin in the Ebon Hawk) and made different categories (like in the TSL Holowan Pluging workbench)

Jeff
09-18-2005, 09:21 PM
Your link doesn't work.

As for making .2da files compatible, you just open up all the 2da files you want to make compatible and copy the lines all over into one of them. That is, of course, if the mod doesn't use stoffe's awesome patcher tool. Annoying, isn't it?

JediKnight707
09-18-2005, 10:20 PM
The link works just PCGM isn't up right now, and whats stoffe's awesome patcher tool?

Darth333
09-18-2005, 11:52 PM
You'll find it on our website: http://www.starwarsknights.com/tools.php

You'll find more details in this thread: http://lucasforums.com/showthread.php?t=149285

JediKnight707
09-19-2005, 01:31 AM
My internet is being difficult and won't let me onto starwarsknights.com :(!!!! But thanks anyway :)

General Kenobi
09-19-2005, 11:15 PM
Aah (from what I know) Stoffe~mkb~'s custom utility that will make an installer for your mod and take care of "adding" your entries into whatever 2da files and the like (say spells.2da) automatically.

That way if I have stoffe's force powers V1 and Darth333's both installed AND you have Stoffe's V2 force powers only; your new installer would work installing with both setups.

I'd highly suggest trying it out as more and more of us are using it for mods since it literally makes compat. a thing of the past. ;) I've not used it yet (but then again I've been lazy mod makin').

Hope that helps a bit :thumbsup:

:ben:
General Kenobi

Darth333
09-20-2005, 12:04 AM
btw, if you click on the link above, you shoud now be able to access starwarsknights.com: i made a typo earlier on and this is why you couldn't get there. You can also click on the banner at the top of the forums (the one with Malak and Visas) and follow the modding tools link.

JediKnight707
09-20-2005, 12:58 AM
It wasn't your link, my computer was being really wierd and just wasn't letting me on to starwarsknights, but it will now :). Thanks for the help as well and congrats d3 on your 4500 post :)

JediKnight707
09-20-2005, 02:01 AM
Well I got TSL Patcher and everythings good, though it's a little confusing...and I'm not sure if its compatiabitating (i tried it with stoffe -mkb-'s High Level Force Powers (http://xfer.lfnetwork.com/starwarsknights.com/sthlforcep2.rar) and I'm not sure if it even changed it :p)

Do you guys know how to put a workbench somewhere though?

Darkkender
09-20-2005, 02:32 AM
I figured I would field your second question in the original post above that hasn't been addressed in regards to the custom workbench.

I simply had a script attached to the on_enter script for the Ebon Hawk. The script that gets fired creates a placeable where I wanted it to go. In order to get the menu to choose from with the workbench I simply assigned it a dialogue. Finally to get the whole custom itemcreate factor I created a set of different custom item create.2da files that are launched via script from the dialogue.

To make things even better here is a link to a tut I wrote in regards to custom itemcreate.2da files. It can also be found in the main tutorials under 2da editing.
http://www.lucasforums.com/showthread.php?t=148587

JediKnight707
09-20-2005, 02:42 AM
Alright thanks for that DK! However, I know absolutly NOTHING about script, and I was wondering if you could help me. This is my scenario that I want to do: Inside the Ebon Hawk, I want their to be a workbench, and I don't really care where, but lets just say I want it in the security room (where the cameras are :)). There I want to do like exactly what you did; have seperate selections like yours. And thats about it...

Darkkender
09-20-2005, 05:49 PM
the easist way would be to go through the plugin files and locate a dlg file named dkwrkbench.dlg and change the name and change the dialogues. simply change the location entries for your placeable in the script. I'll upload my custom include for holowan which helps scripting go easier tonight.

JediKnight707
09-20-2005, 08:11 PM
Thanks for that Darkkender

:jedijawa:

Darkkender
09-21-2005, 01:59 AM
Alright here goes for the placeable scripting simply copy and paste the scripting as presented in there code blocks.

k_inc_holowan.nss

//::///////////////////////////////////////////////
//:: Holowan Labs Include
//:: k_inc_holowan
//:://////////////////////////////////////////////
/*
This contains the functions for custom modding scripts.
*/
//:://////////////////////////////////////////////
//:: Created By: Darkkender
//:: Created On: August 4, 2005
//:://////////////////////////////////////////////

#include "k_inc_debug"

void RecruitNewNPC(int NPCIndex, string TemplateName);
void SpawnNewNPC(float Xloc, float Yloc, float Zloc, float rotation, string TemplateName);
void SpawnNewPlaceable(float Xloc, float Yloc, float Zloc, float rotation, string TemplateName);
void NPCAttackTarget(string NPCTag, string TargetTag);
void PCAttackTarget(string TargetTag);
void RandomLootOnObject(object oContainer = OBJECT_SELF, string sTemp0 = "a_robe_03", string sTemp1 = "a_robe_03", string sTemp2 = "a_robe_03", string sTemp3 = "a_robe_03", string sTemp4 = "a_robe_03", string sTemp5 = "a_robe_03");
void SpawnASittingNPC(float Xloc, float Yloc, float Zloc, float rotation, string PlaceTemplateName, string NPCTemplateName);
void StopNPCDancing(string NPCTag);


void RecruitNewNPC(int NPCIndex, string TemplateName)
{
RemoveAvailableNPC(NPCIndex);
AddAvailableNPCByTemplate(NPCIndex, TemplateName);
}

void SpawnNewNPC(float Xloc, float Yloc, float Zloc, float rotation, string TemplateName)
{
vector vecNPC = Vector(Xloc,Yloc,Zloc);
location locNPC = Location(vecNPC, rotation);
object oNPC = CreateObject(OBJECT_TYPE_CREATURE, TemplateName, locNPC);
}

void SpawnNewPlaceable(float Xloc, float Yloc, float Zloc, float rotation, string TemplateName)
{
vector vecObj = Vector(Xloc,Yloc,Zloc);
location locObj = Location(vecObj, rotation);
object newObj = CreateObject(OBJECT_TYPE_PLACEABLE, TemplateName, locObj);
}

void NPCAttackTarget(string NPCTag, string TargetTag)
{
object oNPC = GetObjectByTag(NPCTag);
object oTarget = GetObjectByTag(TargetTag);
ChangeToStandardFaction (oTarget, STANDARD_FACTION_HOSTILE_1);
DelayCommand(0.5, AssignCommand(oTarget, ActionAttack(oNPC)));
}

void PCAttackTarget(string TargetTag)
{
object oPC = GetFirstPC();
object oTarget = GetObjectByTag(TargetTag);
ChangeToStandardFaction (oTarget, STANDARD_FACTION_HOSTILE_1);
DelayCommand(0.5, AssignCommand(oTarget, ActionAttack(oPC)));
}

void RandomLootOnObject(object oContainer = OBJECT_SELF, string sTemp0 = "a_robe_03", string sTemp1 = "a_robe_03", string sTemp2 = "a_robe_03", string sTemp3 = "a_robe_03", string sTemp4 = "a_robe_03", string sTemp5 = "a_robe_03")
{
string sTemplate;
int nRandom = Random(6);
switch(nRandom)
{
case 0: sTemplate = sTemp0;
break;

case 1: sTemplate = sTemp1;
break;

case 2: sTemplate = sTemp2;
break;

case 3: sTemplate = sTemp3;
break;

case 4: sTemplate = sTemp4;
break;

case 5: sTemplate = sTemp5;
break;

}

CreateItemOnObject(sTemplate,oContainer);
}

void SpawnADancingNPC(float Xloc, float Yloc, float Zloc, float rotation, string TemplateName)
{
vector vecNPC = Vector(Xloc,Yloc,Zloc);
location locNPC = Location(vecNPC, rotation);
object oNPC = CreateObject(OBJECT_TYPE_CREATURE, TemplateName, locNPC);
AssignCommand(oNPC,ActionPlayAnimation(17,1.0,-1.0));
AssignCommand(oNPC,ActionPlayAnimation(16,1.0,-1.0));
}

void StopNPCDancing(string NPCTag)
{
object oNPC=GetObjectByTag(NPCTag);
AssignCommand(oNPC,ActionPlayAnimation(0,1.0,1.0)) ;
}

void SpawnASittingNPC(float Xloc, float Yloc, float Zloc, float rotation, string PlaceTemplateName, string NPCTemplateName)
{
vector vecObj = Vector(Xloc,Yloc,Zloc);
location locObj = Location(vecObj, rotation);
object newObj = CreateObject(OBJECT_TYPE_PLACEABLE, PlaceTemplateName, locObj);
vector vecNPC = Vector(Xloc,Yloc,Zloc);
location locNPC = Location(vecNPC, rotation);
object oNPC = CreateObject(OBJECT_TYPE_CREATURE, NPCTemplateName, locNPC);
AssignCommand(oNPC, ActionPlayAnimation(36, 1.0, 1000.0));
}

jk707_wkbnch.nss (You can name this whatever you really want.)

]//::///////////////////////////////////////////////
//:: Custom Workbench Spawn script
//:: jk707_wkbnch
//::
//:: Created By: Darkkender
//:: Created On: September 20, 2005
//:://////////////////////////////////////////////

#include "k_inc_holowan"

void main()
{
void SpawnNewPlaceable(0.0, 0.0, 0.0, 0.0, "jk707_wkbnch");
/*
Replace above 0.0 coordinates with those obtained from using the
whereami armband. The first number is your Xloc, the 2nd is your Yloc,
the 3rd is your Zloc, & the 4th is your orientation.
You need to create a custom workbench utp file, I used "jk707_wkbnch"
as an example name for this.
*/
}

Now there will need to be at least a couple of other scripts wrote as well. One script for launching the dialogue. Also you'll need to insert this into the existing on_enter script for the Ebon Hawk if you wish to place it there. Simply refer to the source scripts with the Holowan Plugin and locate the Ebon Hawks on_enter script add another ExecuteScript("jk707_wkbnch"); recompile and throw it in overide.

JediKnight707
09-21-2005, 02:21 AM
Thank you very much for that, but, (ALERT: N00B QUESTION) should I copy/paste this in notepad or what? Other than that I think I got it :)

One more: where it says '#include "k_inc_holowan" ' whould i include this or is that part of the script?

Darth333
09-21-2005, 02:23 AM
You don't need k_inc_holowan. For a single one liner script I think using k_inc_holowan is way overkill. Let's keep it simple.

You can simply use this script:

void main()
{
CreateObject(OBJECT_TYPE_PLACEABLE, "jk707_wkbnch", Location(Vector(0.00,0.00,0.00), 0.0));
}

replace the 0.00,0.00,0.00 by the xyz coordinates you can get using the whereami armband: http://www.starwarsknights.com/tools.php


You'll find more infos on how to attach your script to the OnEnter event of a module in this thread: http://www.lucasforums.com/showthread.php?t=143536

You'll find instructions on how to compile a script (http://www.lucasforums.com/showthread.php?t=143681) and more in the scripting tutorials: http://www.lucasforums.com/forumdisplay.php?f=597

edit: and yes, use notepad.

JediKnight707
09-21-2005, 02:56 AM
You don't need k_inc_holowan. For a single one liner script I think using k_inc_holowan is way overkill. Let's keep it simple.


Thx, but i think that you misunderstood what I meant, I meant do you need to include #include "k_inc_holowan" as words. Do I need to put that in there, or was that just part of this:
//::///////////////////////////////////////////////
//:: Holowan Labs Include
//:: k_inc_holowan
//:://////////////////////////////////////////////
/*
This contains the functions for custom modding scripts.
*/
//:://////////////////////////////////////////////
//:: Created By: Darkkender
//:: Created On: August 4, 2005
//:://////////////////////////////////////////////

And how do I save it as a .nss script (or do I even need to for that matter)? Whenever I save it, it tries to save it as a .txt.

Darth333
09-21-2005, 03:14 AM
No, you don't need any of this. You don't need k_inc_holowan and you don't need to include it in you script at all so no need for the #include line.

Just forget about that part.


The only thing you need is this script (don't forget to put your coordinates - btw, you may also need to replace jk707_wkbnch by the template of your placeable if it is not correct):

void main()
{
CreateObject(OBJECT_TYPE_PLACEABLE, "jk707_wkbnch", Location(Vector(0.00,0.00,0.00), 0.0));
}

Paste it in notepad and save it as jk707_wkbnch.nss (make sure you don't save it as jk707_wkbnch.nss.txt) - choose save as type "all files".

You can also add the line directly to the On_Enter script that the HL plug-in uses. I would post it for you but I don't have the mod.



--------------------------------
@ Darkkender, your k_inc_holowan as well as the other script you posted above have some mistakes:

k_inc_holowan has some mistakes in it at lines 109 (PlaceTemplateName) and 112 ( NPCTemplateName). And finally, remove the void here:

#include "k_inc_holowan"

void main()
{
void SpawnNewPlaceable(0.0, 0.0, 0.0, 0.0, "jk707_wkbnch");
}

But in the circumstances, I think this method just complicates the process for nothing. It's a bit like going through the chimney when the front door is opened ;)

Darkkender
09-21-2005, 03:17 PM
@ Darkkender, your k_inc_holowan as well as the other script you posted above have some mistakes:

k_inc_holowan has some mistakes in it at lines 109 (PlaceTemplateName) and 112 ( NPCTemplateName). And finally, remove the void here:

#include "k_inc_holowan"

void main()
{
void SpawnNewPlaceable(0.0, 0.0, 0.0, 0.0, "jk707_wkbnch");
}

But in the circumstances, I think this method just complicates the process for nothing. It's a bit like going through the chimney when the front door is opened ;)

Thanks for that catch Darth333 with the error that was the most recent addition to the include file. I hadn't tested that one recently. I only threw the k_inc_holowan in for the ease of use of some of the functions. I hadn't thought about the fact that it would be still really complex for a Newbie. "Darkkender" flamthro "Darth333". I had done a copy paste and forgot to delete the void out of there.

@JK_707 Darth333 is very correct My above posted include file is really overkill for newbies to scripting. My desire for that was to provide ease of use and not further confusion. Please go with her suggestion.

JediKnight707
09-21-2005, 11:38 PM
Alright I'll do that...are you guys going to release another version of TSL Plug-in?

Darkkender
09-22-2005, 02:26 AM
Alright I'll do that...are you guys going to release another version of TSL Plug-in?

Well I have been working on putting together an all inclusive updated one with all patches and some of the content that I cut from the original release. Maybe even a Installer. However this topic really should be discussed in The Plugins thread so we don't derail your own topic here.