Aller au contenu

Photo

SotZ - Trading scripts


  • Veuillez vous connecter pour répondre
25 réponses à ce sujet

#1
Friar

Friar
  • Members
  • 293 messages

So I've been wanting to explore the scripts from Storm of the Zehir expansion that surround the mini game for trading and trade bars. I didn't necessarily want to start a new topic on this, but I was having trouble drawing the script from the toolset. I can't find it anywhere on the side, so I decided to manually type it here in case I might have question... or when I have questions.

 

This script is titled ka_show_minimarket. I found it in module G_X2 and it is used for small trade in Samarach. I decided this was the most useful for what I wanted to accomplish in the adventure I'm trying to create.

//ka_show_minimarket
//shows the minature market ui for samarach
//NLC 07/30/08

#include "kinc_trade"
#include "ginc_overland"

void main (int nLocation)
{

object oPC = (GetPCSpeaker()==OBJECT_INVALID?OBJECT_SELF:GetPCSpeaker());
ShowMiniMarketUI(oPC, nLocation);
SetGlobalInt( VAR_ENC_IGNORE, TRUE);
}

I'm not sure why I simply can't find this script in the left sidebar with the other scripts but now that I have it and can look at it more easily I'm thinking this script counts on the directions from another script.

 

The nLocation int is puzzling to me because I am wondering how the writer associated the location with a number.

Also I'm wondering how I will be able to rename the trade goods, or use something other trade bars.



#2
Tchos

Tchos
  • Members
  • 5 042 messages

I've found that if I add a script to the campaign folder outside of the toolset, the toolset won't show it in the sidebar, but will show it when I use the "open script" option.

 

Kamal did some fine work in extracting the trade system from SoZ and turning it into a resource for builders to include in their mods.

http://www.nexusmods...inter2/mods/280



#3
kamal_

kamal_
  • Members
  • 5 240 messages

I've found that if I add a script to the campaign folder outside of the toolset, the toolset won't show it in the sidebar, but will show it when I use the "open script" option.

 

That.


Kamal did some fine work in extracting the trade system from SoZ and turning it into a resource for builders to include in their mods.

http://www.nexusmods...inter2/mods/280

 

Also that. I did a demo module and complete documentation on everything (I could have missed something I suppose) including how to add resources, locations, caravans etc.



#4
Friar

Friar
  • Members
  • 293 messages

Good that saves me some time.

I just need it for 4 "resources"

and I might change the trade bar concept if I can't get it to award gold outright.

 

Kamal I don't mean to be a stinker but I'm curious as to where the demo is in the toolkit. The Test_Overland file is a zip file with a lot of stuff that looks like data but I see no .mod file and when I try to open it as a directory it doesn't appear.



#5
kamal_

kamal_
  • Members
  • 5 240 messages

Good that saves me some time.

I just need it for 4 "resources"

and I might change the trade bar concept if I can't get it to award gold outright.

 

Kamal I don't mean to be a stinker but I'm curious as to where the demo is in the toolkit. The Test_Overland file is a zip file with a lot of stuff that looks like data but I see no .mod file and when I try to open it as a directory it doesn't appear.

The download has a module folder and a campaign folder. It looks like I stuck 7z files in them (7z inside 7z), but everything is there. I don't use .mod, I use directory mode. You can play modules distributed in directory mode and it's easier to look at the individual files. I also have extensive written documentation in there.



#6
Friar

Friar
  • Members
  • 293 messages

Thanks Kamal,

 

I'll have to go back into SotZ and play the beginning again to verify this, but isn't the trade ui a more simplistic version of the trade system when the character gets to Neverwinter?

 

For example, the trade system in Neverwinter has the caravans the trade routes etc.

Whereas the Samarach version you can collect goods from a city and then trade them with another city, and that's about it.

right?

 

 

EDIT

Actually I'll just recreate the market on the test module you provided! duh! lol!



#7
kamal_

kamal_
  • Members
  • 5 240 messages
The samarach version is a bit simplified, no caravans for instance, but thats more because its probably intended as an introduction to the full system you see in the sword coast. There is no difference in the scripts used, just in the sword coast you are presented with options you didnt have while in samarach.

My demo and documentation covers modifying things, so you could mod soz to allow caravans between locations in Samarach if you wanted. I dont remember working out multi-om map caravans, but Iit would probably be doable with help from any system allowing multi-area creatures.

#8
Friar

Friar
  • Members
  • 293 messages

Well, aside from importing/exporting the scripts in .erf to another module what else would you suggest I do to get them to work?

Here's what I've done so far

- export scripts in .erf from test_overland

- opened desired module

- import .erf

- set conversation action to ka_show_market

- set nLocation to 13 (or whatever)

 

What am I missing?



#9
Tchos

Tchos
  • Members
  • 5 042 messages

You may need to compile the scripts.



#10
Friar

Friar
  • Members
  • 293 messages

So maybe 79 scripts to compile and save. Do I open them individually and compile them one by one or would you perhaps have another method to suggest?



#11
Tchos

Tchos
  • Members
  • 5 042 messages

There's an option under the File menu called "Compile", from which you can select to compile all open scripts, or all scripts in the module.  Easiest, especially assuming you don't have many scripts imported, is to compile all scripts in the module.



#12
Friar

Friar
  • Members
  • 293 messages

I wonder if I noticed that before.

 

Well I compiled it but that didn't seem to be the answer.

 

Now I am wondering if it has something to do with the way I'm trying to implement the trade system. I don't have physical map locations and I'm trying to implement this to work from NPC to NPC. That wouldn't present an issue would it?



#13
Tchos

Tchos
  • Members
  • 5 042 messages

At least one possibility is ruled out.  Unfortunately, I haven't used the trade system, so I can only troubleshoot things that would be common to all scripts.



#14
kamal_

kamal_
  • Members
  • 5 240 messages

I wonder if I noticed that before.

 

Well I compiled it but that didn't seem to be the answer.

 

Now I am wondering if it has something to do with the way I'm trying to implement the trade system. I don't have physical map locations and I'm trying to implement this to work from NPC to NPC. That wouldn't present an issue would it?

Have you tried the demo module I released. Does it work for you? You can step through it since it's completely stripped of SoZ stuff and the tlk references of the 2da lookups for things have been replaced for easier readability.



#15
Friar

Friar
  • Members
  • 293 messages

Hey kamal,

I have been playing with it today and it's been very insightful.

I even created an NPC inside the interior area and made a conversation to test and see if I can pull up the trade ui.

I noticed how you were able to change the name of one location to timber town test. I really liked that.

 

So I decided I wanted to use the trade scripts you have, pack them into an .erf, and then send them all over to my module. Strangely when I tried to reproduce the conversation I created in you module it was not working.

 

Im not sure why but when you mention 2da a bell goes off. I didn't change any 2da lines.



#16
Friar

Friar
  • Members
  • 293 messages

Where is the .2da file for the market scripts.

The scripts still aren't firing and I'm thinking this is the only thing I haven't looked at.



#17
kamal_

kamal_
  • Members
  • 5 240 messages

Where is the .2da file for the market scripts.

The scripts still aren't firing and I'm thinking this is the only thing I haven't looked at.

Everything necessary is included in the demo. The pdf documentation lists what every related 2da does.



#18
Friar

Friar
  • Members
  • 293 messages

Okay sorry to trouble you.

It does look like I left out the .2DAs

I'm going to read for some way to get those .2das into other mods.

 

EDIT:

 

Actually, I noticed that when I went into your module and hit view 2DA I had the option to, of course save, add rows.. etc.

Well when I hit "save" in the 2DA screen I actually saved it to all modules.

 

I was actually looking at making some new 2DAs and then flipping back and forth between your PDF and the toolkit.



#19
Friar

Friar
  • Members
  • 293 messages

Any idea why the trade UI wont open?

 

I included the scripts kam_onenter_firstmap into the oncliententer box

 

ka_show_market_kamal is the action that occurs on a conversation line. The location (int) is 6

 

Could I be overlooking anything else?



#20
kamal_

kamal_
  • Members
  • 5 240 messages
Do you know if those scripts are even running? Put some debug ststements into them that will give you some text indicating if the script is running though various points.

Do you have the ui stuff? I forget if it's kept in the main game folders or kept in the campaign folders.

#21
Friar

Friar
  • Members
  • 293 messages

I haven't run debug statements in your scripts because I don't see why they wouldn't work.

 

I'll try and do that, but first I want to look at the UI. I assumed the UI stuff would be there because I have the SoZ expansion. I didn't realize there was anything I needed to do with UIs.

 

My UIs are located in

C:\Program Files (x86)\Atari\Neverwinter Nights 2\Campaigns\Neverwinter Nights 2 Campaign_X2\UI

So maybe I need to copy them to the Campaign folder?

 

In other words copy them to

C:\Users\Andrew\Documents\Neverwinter Nights 2\Campaigns\AlQadim1

 

EDIT: Tried it, and it's not working. I'll need to make some debug lines in the scripts afterall



#22
Tchos

Tchos
  • Members
  • 5 042 messages

The trade system is a campaign-level resource (in the SoZ campaign folder), and isn't in the toolset without importing scripts.  However, Kamal's package should have everything you need in it, already imported.



#23
Friar

Friar
  • Members
  • 293 messages

I didn't start with his module though. I was trying to import his scripts into my module.

 

I wish I didn't even have to ask these questions.

I wish I could poke around and find the answers in a snap.

 

I poked around and read over the very well written documentation he included.

 

But there is something very small I'm missing that I think everyone probably expects everyone to know.

Then I wonder if the problem is similar to me not being able to get the World Map to come up on a trigger. Maybe it's the way I placed the UI.

 

I don't believe there is anything wrong with Kamal's scripts and I hope that doesn't seem to be what I'm implying.

I just thought that after being at this for so long I would have caught on to things by now and wouldn't have to come to you guys for what seems like everything.



#24
Tchos

Tchos
  • Members
  • 5 042 messages

There's no need to apologise for asking questions.  I believe anyone who knows the answer is happy to help out a fellow builder who is clearly trying things himself before asking for help, even if only for the self-serving reward of getting more fun modules to play.  I haven't used the system myself, so I can't offer any specific advice.



#25
kamal_

kamal_
  • Members
  • 5 240 messages

I simply have too many projects to remember all the details about every one. When I can't remember, I can only point someone in a helpful direction, especially so when it's a question about something I think not too many other people have used so there's unlikely to be too many answers coming from elsewhere. That's why I try to do documentation, and make self help suggestions. In this case self help is debug statements to see if the code is running.