Jump to content

Home

Emergency Supplies/Ebon Hawk


CaptainPike

Recommended Posts

Okay, From the top:

 

The object in question is:

- kiosk004.utp

 

In kiosk.utp, script

- Calls k_pebn_kiosk for OnOpen

- Calls k_pebn_kiosk for OnUsed

 

k_pebn_kiosk script contents:

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

 

{

 

 

int iQuest = GetJournalEntry("k_pebo_stowaway");

 

if(iQuest == 0) // Quest not started at all...

 

{

 

OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);

 

}

if(iQuest >= 10) // She was found

 

{

 

if(iQuest != 40) // Not by Dantooine Twilek

 

{

 

OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);

 

}

 

 

}

 

else

 

{

ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);

 

}

 

}

 

Mercant File:

- File name: supplies.utm

- Tag: supplies

 

 

The following files are in my Override folder:

kiosk004.utp

supplies.utm

k_pebn_kiosk.ncs

 

Sasha quest is not active.

 

Annnnd .... it's not working, LoL ...

 

Clarification:

Show spoiler
(hidden content - requires Javascript to show)

.nss = Neverwinter Source Script

.ncs = Neverwinter Compiled Script

 

(Correct?)

Link to comment
Share on other sites

Correct, but the .nss files aren't used by the game at all; it only uses the .ncs files and the .nss files are just used by the programmers.

 

As to your script, try just using the OnUsed slot. Also, just before the first OpenStore, add this line:

 

SendMessageToPC(GetFirstPC(), "I fired: 1st one");

 

And just before the second OpenStore:

 

SendMessageToPC(GetFirstPC(), "I fired: 2nd one");

 

The messages will appear in your feedback screen if the scripts are working. Also worth noting, the .utp edits will only take effect if you've never entered the area before(ie, you'll need a save from before the Ebon Hawk, say just after Davik's dead).

Link to comment
Share on other sites

OK.

 

I have been working at it. I see your troubleshooting attempt and will follow through.

 

I have tried several methods at opening the store, but nothing is opening the store, even when I remove all conditional statements.

 

I feel so stupid! I was thinking you had the store spawned already...

 

void main()
{
   int iQuest = GetJournalEntry("k_pebo_stowaway");
   object oStore = GetObjectByTag("supplies");
   if(GetIsObjectValid(oStore) == 0)
   {
       oStore = CreateObject(OBJECT_TYPE_STORE, "<template>", GetLocation(GetFirstPC()));
   }

   if(iQuest == 0) // Quest not started at all...
   {
       OpenStore(oStore, GetFirstPC(), 0, 100);
   }
   if(iQuest >= 10) // She was found
   {
       if(iQuest != 40) // Not by Dantooine Twilek
       {
           OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);
       }
   }
   else
   {
       ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);
   }
}

 

That should work, though you'll have to substitute "<template>" with the Template Resref(hence why I advised making the tag, template, and filename all the same) and keep the "".

Link to comment
Share on other sites

I started over from the very beginning to make sure I didn't miss anything.

 

Cleaned out override folder

- From starting point, all that exists there is nwscript.nss

 

Created .utm file

- Name: Supplies.utm

- ResRef, LocName and Tag are all "supplies"

- Gave some low value, nonsensical items to the store to "prime" it.

- Placed that in "Override" folder

 

Extracted kiosk004.utm

- Made sure the only trigger active is OnUsed

- OnUsed calls script k_pebn_kiosk

- Placed that in "Override" folder

 

 

Extracted the script file, k_pebn_kiosk.ncs

- Viewed Decompiled code with DeNCS and copied

- Created file k_pebn_kiosk.ncs and pasted script

- Compiled

- From this point forward, for each compiling, I moved (rather than copied) k_pebn_kiosk.ncs to Override rather than copied to prevent any confusion; that the compiled code matched the source code.

 

Override contains from here throughout:

Show spoiler
(hidden content - requires Javascript to show)

k_pebn_kiosk.ncs

kiosk004.utp

nwscript.nss

supplies.utm

 

- With KSE, created a lavishly equipped supercharacter and played through the game until landing on Dantooine.

 

Show spoiler
(hidden content - requires Javascript to show)

I have a shrinkwrapped version of KOTOR which came from "Best of PC" collection; I do not have access to cheat codes through this product. I have tried EnableCheats, EnableCheats=1, Cheats=1; in conjunction with Console=1, EnableConsole, EnableConsole=1; I can't get cheat codes through this product.

 

RESULT: Accomplished. As expected, clicking Kiosk results in "[This is a store of emergency food and supplies]".

 

ATTEMPT #1:

 

Trying again with our first attempt:

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

{

int iQuest = GetJournalEntry("k_pebo_stowaway");

if(iQuest == 0) // Quest not started at all...

{

OpenStore("supplies", GetFirstPC(), 0, 100);

}

if(iQuest >= 10) // She was found

{

if(iQuest != 40) // Not by Dantooine Twilek

{

OpenStore("supplies", GetFirstPC(), 0, 100);

}

}

else

{

ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);

}

}

 

RESULT: Type mismatch, as before.

 

ATTEMPT #2:

Using OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

{

int iQuest = GetJournalEntry("k_pebo_stowaway");

if(iQuest == 0) // Quest not started at all...

{

OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);

}

if(iQuest >= 10) // She was found

{

if(iQuest != 40) // Not by Dantooine Twilek

{

OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);

}

}

else

{

ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);

}

}

 

[/i]Starting in the Jedi Enclave, going into the Ebon Hawk.

 

RESULT: "[This is a store of emergency food and supplies]".

 

ATTEMPT #3:

Adding the "fired" notification scripts.

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

{

int iQuest = GetJournalEntry("k_pebo_stowaway");

if(iQuest == 0) // Quest not started at all...

{

SendMessageToPC(GetFirstPC(), "I fired: 1st one");

OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);

}

if(iQuest >= 10) // She was found

{

if(iQuest != 40) // Not by Dantooine Twilek

{

SendMessageToPC(GetFirstPC(), "I fired: 2nd one");

OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);

}

}

else

{

ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);

}

}

 

RESULT: No message. "[This is a store of emergency food and supplies]".

 

ATTEMPT #4:

Removing conditional statements; attempting to go straight to the store.

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

{

OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);

}

 

RESULT: Literally nothing happens.

 

ATTEMPT#5:

This is a method I picked up from one of the "Tutorials" forums.

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

{

object oStore = GetObjectByTag("Supplies");

object oSpeaker = GetPCSpeaker();

 

if (!GetIsObjectValid(oStore))

oStore = CreateObject(OBJECT_TYPE_STORE, "Supplies", GetLocation(OBJECT_SELF));

 

if (GetIsObjectValid(oStore))

DelayCommand(0.5, OpenStore(oStore, oSpeaker));

}

 

RESULT: Nothing happens. Literally.

 

ATTEMPT #6:

Trying to simply send myself a message when the object is used.

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

{

SendMessageToPC(GetFirstPC(), "Captain, you're an idiot!");

}

 

RESULT: Nothing happens.

 

Now that I see your post above, I will try that script ...

Link to comment
Share on other sites

Yech. No luck.

 

I tried this:

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

{

object oStore = GetObjectByTag("supplies");

if(GetIsObjectValid(oStore) == 0)

{

oStore = CreateObject(OBJECT_TYPE_STORE, "<template>", GetLocation(GetFirstPC()));

}

OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);

}

 

Removing all conditionals, just trying to get it to open the darned store; then fill in the conditionals later!

 

What is supposed to go in "<template>"? I assume that is some kind of placeholder for something I'm supposed to fill in?

 

If that's not the case, then I don't know what is!

Link to comment
Share on other sites

... AND, you would think that THIS ...

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

{

SendMessageToPC(GetFirstPC(), "Captain, you're an idiot!");

}

 

... would present something! There are no objects or conditionals to worry about; just a simple message ...

Link to comment
Share on other sites

... AND, you would think that THIS ...

 

Show spoiler
(hidden content - requires Javascript to show)

void main()

{

SendMessageToPC(GetFirstPC(), "Captain, you're an idiot!");

}

 

... would present something! There are no objects or conditionals to worry about; just a simple message ...

 

In that case, please contact me on Skype. I sent you it in a PM; do you still have it?

Link to comment
Share on other sites

Well, whadyaknow ....

 

I used a tool called KOTOR Script Generator and it gave me a script that when I go to the supplies of the Ebon Hawk, it actually opens a store!

 

Show spoiler
(hidden content - requires Javascript to show)

// Generated bt jmac7142's KotOR Script Generator

// Open Merchant

 

#include "k_inc_debug"

#include "k_inc_utility"

 

void main()

{

object oStore = CreateObject(OBJECT_TYPE_STORE, "supplies", GetLocation(GetFirstPC()));

AssignCommand(GetFirstPC(), OpenStore(oStore, GetFirstPC()));

}

 

Now, the conditionals aren't in there; AND, altering MarkUp/MarkDown aren't making any difference (and my KOTOR tool won't let me adjust either!)

 

Basically, that's what I want; the store to sell at 0 and buy at 0; this is the closest so far ...

Link to comment
Share on other sites

Well, whadyaknow ....

 

I used a tool called KOTOR Script Generator and it gave me a script that when I go to the supplies of the Ebon Hawk, it actually opens a store!

 

Show spoiler
(hidden content - requires Javascript to show)

// Generated bt jmac7142's KotOR Script Generator

// Open Merchant

 

#include "k_inc_debug"

#include "k_inc_utility"

 

void main()

{

object oStore = CreateObject(OBJECT_TYPE_STORE, "supplies", GetLocation(GetFirstPC()));

AssignCommand(GetFirstPC(), OpenStore(oStore, GetFirstPC()));

}

 

Now, the conditionals aren't in there; AND, altering MarkUp/MarkDown aren't making any difference (and my KOTOR tool won't let me adjust either!)

 

Basically, that's what I want; the store to sell at 0 and buy at 0; this is the closest so far ...

 

In that case, try this:

 

Show spoiler
(hidden content - requires Javascript to show)
[code]void main()
{
   int iQuest = GetJournalEntry("k_pebo_stowaway");
   object oStore = GetObjectByTag("supplies");
   if(GetIsObjectValid(oStore) == 0)
   {
       oStore = CreateObject(OBJECT_TYPE_STORE, "<template>", GetLocation(GetFirstPC()));
   }

   if(iQuest == 0) // Quest not started at all...
   {
       AssignCommand(GetFirstPC(), OpenStore(oStore, GetFirstPC(), 0, 100)); 
   }
   if(iQuest >= 10) // She was found
   {
       if(iQuest != 40) // Not by Dantooine Twilek
       {
           OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100);
       }
   }
   else
   {
       ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);
   }
}

[/code]

Link to comment
Share on other sites

Actually, what we need is a reference to the quest "dwindling supplies".

 

When Zaalbar tells us that there is something wrong with the food stores, the quest "Dwindinding Supplies" becomes active with a value of 10.

 

After you "examine the supplies more closely", the quest has a value of 20; and then, when you find our little stowaway, it holds a value of 99 and is completed; then the "strange stowaway" quest becomes active.

 

How are we finding the tags for these quests?

Link to comment
Share on other sites

....

Through a hex editor, I was able to find this from the jrl:

 

.P˜..............ebo_supplies...

 

That looks to be it. An easier method is:

 

1. Go into the options menu for Kotor Tool.(Menubar->Tools->Options...)

2. Make sure the third option from the top, about opening GFF files as text, is clicked.

3. If using KotOR 1, go to BIFS->_newbif->Journal File->global.jrl

If using KotOR 2, go to BIFS->dialogs.bif->Journal File->global.jrl

4. Double-click it to open it in the Text Editor.

5. Hit Control-F and type in what you want to search for(Ideally, the name of the quest) and then pick whether it is case-sensitive or not.

6. If it doesn't find it right away, hit F3.

7. When you find the quest, look for the line that says "Label: Tag" and then use the "Value: "part in your script.

Link to comment
Share on other sites

Show spoiler
(hidden content - requires Javascript to show)

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fmodern\fprq1\fcharset0 Lucida Console;}}
{\colortbl ;\red255\green0\blue255;\red255\green0\blue0;\red0\green120\blue0;}
\viewkind4\uc1\pard\f0\fs16\par
\cf1 End of CExoLocString\cf0 - \cf2 Field\cf0 - \cf3 Type:\cf0 CExoLocString \cf3 Value:\cf0 Dwindling Supplies\par
\cf3 Label:\cf0 Priority \cf2 Field\cf0 - \cf3 Type:\cf0 dword \cf3 Value:\cf0 2\par
\cf3 Label:\cf0 Comment \cf2 Field\cf0 - \cf3 Type:\cf0 CExoString \cf3 Value:\cf0 \par
\cf3 Label:\cf0 Tag \cf2 Field\cf0 - \cf3 Type:\cf0 CExoString \cf3 Value:\cf0 ebo_supplies\par
\cf3 Label:\cf0 PlotIndex \cf2 Field\cf0 - \cf3 Type:\cf0 int \cf3 Value:\cf0 -1\par
\cf3 Label:\cf0 PlanetID \cf2 Field\cf0 - \cf3 Type:\cf0 int \cf3 Value:\cf0 -1\par
\cf3 Label:\cf0 EntryList \par
\cf1 List Contents\cf0 - \cf3 Struct Count:\cf0 3}



Kewl! Tx again!
Link to comment
Share on other sites

Making great headway; and some of this, I actually figured out on my own without bugging others to write it for me, LoL! :cool:

 

Show spoiler
(hidden content - requires Javascript to show)

// Created with help from jmac7142's KotOR Script Generator and Fair Strides 2

 

#include "k_inc_debug"

#include "k_inc_utility"

 

void main()

{

int iResult;

iResult = GetGlobalNumber("ebo_sasha_state");

if (iResult != 10)

{

object oStore = CreateObject(OBJECT_TYPE_STORE, "supplies", GetLocation(GetFirstPC()));

AssignCommand(GetFirstPC(), OpenStore(oStore, GetFirstPC()));

}

else

{

ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);

}

}

 

There seemed to be an oversight or bug that did not update the journal when Zaalbar warns us of dwindling supplies; but, I located a global that does the trick and researched/worked out the script to take advantage of it.

 

So, we are going to the Store unless Zaalbar has warned us of dwindling supplies; then, we are "examining the supplies more closely" then right after that, right back to the store.

 

Two things remain, however:

  • The store is being recreated each visit, so we have endless supplies of the items placed in there (need to incoroprate IsObjectValid)

  • And the most irritating thing of not being able to change the Markup/Markdown to 0,100!

 

But, I'll work on these things later; I'm a bit worn and need to find something else to do for a while.

Link to comment
Share on other sites

My script so far:

 

Show spoiler
(hidden content - requires Javascript to show)

// Created with help from jmac7142's KotOR Script Generator, Fair Strides 2 and

// a tutorial by StrangeJ

 

#include "k_inc_debug"

#include "k_inc_utility"

 

void main()

{

int iResult;

iResult = GetGlobalNumber("ebo_sasha_state");

if (iResult != 10)

{

object oStore = CreateObject(OBJECT_TYPE_STORE, "supplies", GetLocation(GetFirstPC()));

AssignCommand(GetFirstPC(), OpenStore(oStore, GetFirstPC(),-125,-25));

}

else

{

ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);

}

}

 

It opens when I want it to open, it allows me to inspect the supplies when the quest requires me to do so then goes right back to the store, and trades with me (buying and selling at 0 credits).

 

The only part of the puzzle left is that the store recreates itself each time; creating a neverending compliment of what's in there. Any condition I put in there; any "openstore" statement outside of what is in the script; just knocks me out of the script and there is no interactive response from the kiosk.

 

It's quite frustrating as I have used scripts provided by tutorials and experienced modders; I don't get it!

 

I'll work on it more next weekend.

Link to comment
Share on other sites

My script so far:

 

Show spoiler
(hidden content - requires Javascript to show)

// Created with help from jmac7142's KotOR Script Generator, Fair Strides 2 and

// a tutorial by StrangeJ

 

#include "k_inc_debug"

#include "k_inc_utility"

 

void main()

{

int iResult;

iResult = GetGlobalNumber("ebo_sasha_state");

if (iResult != 10)

{

object oStore = CreateObject(OBJECT_TYPE_STORE, "supplies", GetLocation(GetFirstPC()));

AssignCommand(GetFirstPC(), OpenStore(oStore, GetFirstPC(),-125,-25));

}

else

{

ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);

}

}

 

It opens when I want it to open, it allows me to inspect the supplies when the quest requires me to do so then goes right back to the store, and trades with me (buying and selling at 0 credits).

 

The only part of the puzzle left is that the store recreates itself each time; creating a neverending compliment of what's in there. Any condition I put in there; any "openstore" statement outside of what is in the script; just knocks me out of the script and there is no interactive response from the kiosk.

 

It's quite frustrating as I have used scripts provided by tutorials and experienced modders; I don't get it!

 

I'll work on it more next weekend.

 

This oughta work, as it checks for the item before recreating it. I had that earlier, but when you started mixing code, you didn't transfer it:

 

Show spoiler
(hidden content - requires Javascript to show)
// Created with help from  jmac7142's KotOR Script Generator, Fair Strides 2 and 
// a tutorial by StrangeJ

#include "k_inc_debug" 
#include "k_inc_utility" 

void main() 
{ 
   int iResult;
   object oStore = GetObjectByTag("supplies");

   iResult = GetGlobalNumber("ebo_sasha_state");
   if (iResult != 10)
   {
       if(GetObjectIsValid(oStore) == 0)
       {
           oStore = CreateObject(OBJECT_TYPE_STORE, "supplies", GetLocation(GetFirstPC()));
       }
      AssignCommand(GetFirstPC(), OpenStore(oStore, GetFirstPC(),-125,-25));
   }
   else
   {
        ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0);
   }
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...