PATCH_GAM & ADD_STORE_ITEM
#1
Posted 08 September 2003 - 09:44 AM
PATCH_GAM
I coded PATCH_GAM in response to the various threads I've read where people need to get their BG1 NPC's into the game.
Here's the syntax:
COPY ~mymod/mynpc.cre~ ~override/mymod/mynpc.cre~
(Do your SAY/WRITE_BYTE/whatever else here)
PATCH_GAM ~mynpc~ ~ar2600~ #123 #456
Where ~mynpc~ is the name of your cre file *without* the .cre extension, ~ar2600~ is the area name that you want your NPC to start in *without* the .are extension, #123 is the x co-ordinate and #456 is the y co-ordinate.
It will then splice in your cre file into any saved games (in the save and mpsave directories) and it will also add your NPC entry into the default baldur.gam (for starting new games).
Note however, that there is absolutely *no* way of backing this up other than backing up all saves in the save and mpsave directory to a backup folder.
I haven't wrote any code to backup the saves yet since I can't figure what variable Wes uses for the backup folder. (Wes, maybe you could add this?)
PATCH_GAM will only work with BG1 baldur.gam files. If you try it with any other IE game, WeiDU will choke.
ADD_STORE_ITEM
ADD_STORE_ITEM is just something I did out of boredom.
Here's the syntax:
COPY_EXISTING ~ribald.sto~ ~override/ribald.sto~
ADD_STORE_ITEM ~myitem~ #20 #0 #0 #1 #5
Where ~myitem~ is the name of your item file *without* the .itm extension, #20 is the first extension header's # of charges, #0 is the second extension header's # of charges, #0 is the third extension header's # of charges, #1 are the item flags (more on this below) and #5 are the # of items in stock.
The flags work as follows:
#1 Identified
#2 Stealable
#4 Unstealable
#3 Identified & Stealable
#5 Identified & Unstealable
In most cases putting #1 for the flags is fine.
I could code up some more feature like ADD_STORE_ITEM if people think there's a need for them. (e.g. Like ADD_TRIGGER for areas or something.)
I'll post the diffs for this when I get a chance to get on my laptop this afternoon.
#2 -jcompton-
Posted 08 September 2003 - 09:49 AM
Ghrey was just wondering about this for BoB last night.I could code up some more feature like ADD_STORE_ITEM if people think there's a need for them. (e.g. Like ADD_TRIGGER for areas or something.)
#3
Posted 08 September 2003 - 09:58 AM
Ah, he needs something like ADD_TRIGGER?Ghrey was just wondering about this for BoB last night.I could code up some more feature like ADD_STORE_ITEM if people think there's a need for them. (e.g. Like ADD_TRIGGER for areas or something.)
Oh, and I should also note that ADD_STORE_ITEM will work on any .sto version.
#4 -jcompton-
Posted 08 September 2003 - 10:02 AM
Might want to call it ADD_AREA_TRIGGER or something, since we already have TRANS and STATE trigger adding...
#5 -bt_igi-
Posted 08 September 2003 - 10:05 AM
Nice feature Japh, will be nice to see trigger insertion too :-) And expanded weidu's support of bg1 is always nice to see.
On a side note (ok, maybe this is the main note I wrote a small tool to insert items into stores (also drinks, and spells), unless they already exist there, and remove them as well (based only on item name, or entire item (ie. name + flags).
Its available at www.teambg.net/~igi along with my other tools (SIIE, iirc). I also plan to develop a .are insertion tool, and a WMP one etc.
Have a browse around, and feel free to drop me comments, queries or questions.
/igi (TeamBG)
#6
Posted 08 September 2003 - 10:11 AM
Nice point about checking to see if it's already there. I'll write that out today or tonight sometime.
#7
Posted 08 September 2003 - 11:13 AM
#8
Posted 08 September 2003 - 11:28 AM
1) ADD_CREATURE_ITEM ~newitem~ (#flags)
- this would work like ADD_STORE_ITEM and would add the new item into the first available inventory slot.
2) OVERWRITE_CREATURE_ITEM ~itemslot~ ~newitem~ (#flags)
- self explanatory, I think.
3) ADD_CONTAINER_ITEM ~containernumber~ ~newitem~ (#flags)
- as you are playing with area files, I thought I'd throw this in. It can be done with scripting but this would be much more elegant.
Also, I wonder if you could look into "this" for me? If I am doing something wrong I'd like to know. Otherwise, make it work. Pretty please.
Have fun, and as Wes says; you are a god.
#9 -Ghreyfain-
Posted 08 September 2003 - 02:20 PM
As you are asking; I have some of suggestions:
1) ADD_CREATURE_ITEM ~newitem~ (#flags)
- this would work like ADD_STORE_ITEM and would add the new item into the first available inventory slot.
GiveItemCreate() in scripts works fine for this.
2) OVERWRITE_CREATURE_ITEM ~itemslot~ ~newitem~ (#flags)
- self explanatory, I think.
TakeItemReplace() works fine for this, in ToB at any rate.
3) ADD_CONTAINER_ITEM ~containernumber~ ~newitem~ (#flags)
- as you are playing with area files, I thought I'd throw this in. It can be done with scripting but this would be much more elegant.
GiveItemCreate() works for this too, I'm fairly sure.
Oh, and yeah, cool stuff japh. ADD_AREA_TRIGGER would make you both a force for GOOD and for AWESOME.
#10
Posted 08 September 2003 - 03:03 PM
EDIT: Casting my vote for ADD_AREA_TRIGGER
#11
Posted 08 September 2003 - 04:41 PM
The great wolf Fenrir gapes ever at the dwelling of the gods.
#12
Posted 08 September 2003 - 05:45 PM
#13
Posted 09 September 2003 - 06:11 AM
It works like this now:
ADD_STORE_ITEM [optional_plus] ~myitem~ #10 #0 #0 ~IDENTIFIED~ #5
The [optional_plus] is for overwriting items already in the store. So... if you're worried that the item might already be in there, just stick the + in there and it will do one of the following:
a) Overwrite the item if it's there .
b) Add the item if it isn't there.
I've made adding the flags a bit easier as well. Here's the list of valid flags you can use:
- IDENTIFIED
- UNSTEALABLE
- STOLEN
- IDENTIFIED&STOLEN
- IDENTIFIED&UNSTEALABLE
#14
Posted 10 September 2003 - 11:19 AM
From Ghreyfain:2) OVERWRITE_CREATURE_ITEM ~itemslot~ ~newitem~ (#flags)
- self explanatory, I think.
TakeItemReplace() works fine for this, in ToB at any rate.
The problem with doing this by script is that you (or at least I) can't then equip the item. (I have tried a whole host of commands to try and do this.) Hence my suggestion. I would revise my suggestion a little though:
OVERWRITE_CREATURE_ITEM ~itemslot~ ~olditem~ ~newitem~ (#flags)
Another suggestion: READ_ASCII, is detailed "here".
#15
Posted 14 October 2003 - 03:47 PM
Plus I would like to make a request that added things like this would be put up some where or put into the Weidu ReadMe as a tutorial. Looking for something that was added to Weidu in these forums is timeing.
#16
Posted 15 October 2003 - 03:55 AM
The first 3 #'s are the number of charges of the extended headers. The last # is for the number in stock.