Author Topic: Store Mods  (Read 1925 times)

Offline Ayce

  • Planewalker
  • *****
  • Posts: 26
Store Mods
« on: November 10, 2006, 04:31:43 PM »
I am attemping to create some simiple store mods that make the unloading of junk more convenient.  Specifically, I am trying to create a gemcutter (buys & sells gems), a jeweler (buys & sells rings and necklaces) and a militia organizer/trainer/equipper (will buy excess weapons/armor for the purpose of collecting arms and armor for to equip a local militia in light of the new threat, what with the iron shortage and all, he'll take whatever he can get - using a Flaming Fist Mercanary as the actor).

Here's what I got so far, I'm able to use a store editor to create a store with the correct inventory and all, I'm able to use an area editor (gorin's) to insert the new actor into the desired area at the desired locaton.  This is where my luck stops......................

1.  a.  I have no idea how to set up the triggers that will cause an actor to open a store.

1.  b.  for that matter, I have no idea how to trigger dialog strings when you "talk" to someone.

2.  When I create the modified areas and put them in the override folder.  For some reason, the modified area loses it's exit, in other words, I can enter the area, but I can't get out.  This has happened with other mods when I tried to alter treasure caches with custom items, etc.  I didn't change anything else, but adding the new treasure or actor, so why would the exit just disappear??

3.  I tried to use bentley mirrorshade as a template for the gemcutter.  I modified bentley's cre file, but he still used bentleys dialog and sto options (even with a new cre file name ?????).  Totally unintended consequence.


Help.......................... ???


Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: Store Mods
« Reply #1 on: November 11, 2006, 12:41:24 AM »
3. First of all, you have to choose the name of the dialog file for your creature. Let's say it's A.dlg. Now you have to modify your .CRE file further. Change the reference in the 'Dialog file' field to A
  I'd also recommend changing references in 'script' fields (for now, you may change them all to NONE; I'd also change the 'Death Variable')
  You must also choose the name of the store file and create it. Let's say it's S.sto

1a. Here's the XXX.d file, which you'll have to compile to get A.dlg

BEGIN ~A~

IF ~True()~ THEN BEGIN B
 SAY
 ~Have a look at my wares~
 IF ~~ THEN REPLY
 ~Show me what you have~
   DO ~StartStore("S",LastTalkedToBy())~ EXIT
 IF ~~ THEN REPLY
 ~Get lost~
   EXIT
 END

1b. When you approach the mercant and click, s/he will say to you 'Have a look at my wares'

2. Why do you have to modify existing areas? You can create creatures modifying area scripts (using CreateCreature() action)

4. If I were you, I'd ignore the post you are reading now and try to learn a bit about modding instead. There are many tutorials available
« Last Edit: November 11, 2006, 12:43:02 AM by Lu »

Offline Ayce

  • Planewalker
  • *****
  • Posts: 26
Re: Store Mods
« Reply #2 on: November 12, 2006, 12:00:21 PM »
Yeah, I don't really know much about scripting, I've made a lot of successful itm, spl & cre mods, but only so long as it doesn't involve scripting.  I've had less success with modifying rules and effect files.

Anyway, wouldn't I still have to modify and existing area to alter the contents of a container?  I can see how I could place a new actor with a script, but altering contents too??

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: Store Mods
« Reply #3 on: November 12, 2006, 06:26:08 PM »
  You can add/remove items to/from containers in scripts, too. Containers usually (not sure if always) have script names as well. The action would look like

  ActionOverride("Container",CreateItem("Item",N1,N2,N3))

 Here 'Container' is the container script name, 'Item' is the .ITM file name
 N1, N2, N3 are numbers (pretty often they can be 0; to learn more check the description of CreateItem() action)

  As for editing areas directly, for many reasons it's the last thing you'd want to do, I assure you

Offline jastey

  • Planewalker
  • *****
  • Posts: 1169
  • Gender: Female
Re: Store Mods
« Reply #4 on: January 03, 2012, 10:11:46 AM »
For placing a cre into an area, you need to append the according area script. Make a simple text file (ending on .baf), for example:

Quote
IF
  Global("MyCreatureSpawn","GLOBAL",0) //check variable - without, the cre would spawn infinitely
THEN
  RESPONSE #100
    SetGlobal("MyCreatureSpawn","GLOBAL",1)
   CreateCreature("mycre###",[xxx.yyy],0) // "mycre###" is the file name of the creature. xxx.yyy are the x- and y-coordinates, respectively.
END

For original BG without TotSC, the spawn syntax would be : CreateCreature("mycre###",[xxx.yyy]) (without the ",0").

To append the script, place a line in your tp2:

Quote
EXTEND_BOTTOM ~AR3300.bcs~ ~mymodfolder/scripts/myscript.baf~

The spawn script block now would get appended to the "AR3300.bcs" which is the Beregost city.

For more details, see the following tutorial (I should have linked to that right away, it's far better explained!):

Getting a non-joinable NPC in the game, by berelinde


 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: