Table of Contents

Things Done

Here are things that are done. New things done will be added to the end of this list.

Change Creatures from Plot to Immortal

There are a huge number of plot flagged creatures that I have been slowly changing to immortal. So a tool that would loop thorugh all creatures and check for plot and then change them to immortal and take away the plot flag.

plot-to-immortal.pl *.utc *.git

Add OnOpen To Doors

Loop through all doors and if there is no script assigned to onopen, place the default closing script. For extra credit make them plot. For even more extra credit if they are locked, they should have an extra script that locks them on close applied.

add-onopen.pl *.git

Find Mortal Creatures

Then I would need a loop through all placed creatures and check for immortal flags, reporting any that do not have.

find-mortals.pl *.git

Change Spawn Script of Creatures

A loop through all blueprints that have a script X in perception and set that script to be Y and also change the onspawn script of those creatures to be Z

gffmodify.pl -v -s '^/$' -f '^/ScriptOnNotice$:=:^X$' -m '/ScriptOnNotice=Y' -m '/ScriptSpawn=Z' *.utc

Change OnOpen of Placeables

Loop through all placeables with script X in the onopen slot and change that to Y

gffmodify.pl -v -s '^/Placeable List\[\d+\]/$' -f '/OnOpen$:=:^X$' -m '/OnOpen=Y' *.git

Change Tag of Creatures

Loop through all Blueprints, Looking for creatures with tag XXX (there are many) and replace that tag with YYY

gffmodify.pl -v -f '/Tag$:=:^CELIALIAMYN$' -m 'Tag=CELIASAD' Celia.utc

Change Fog Distance if Needed

List fog distances in all areas and prompt to change. (Partially done, listing of the fog distances can be done using gffmatch.pl, modify can be done using gffmodify.pl, but there is no prompting of changes)

gffmodify.pl -p 'Fog|Tag|@areaname@' -f '^/FogClipDist$:=:.' -m 'FogClipDist=@ask@' -v *.are 

Find Unused Scripts

Find all truly unused scripts (not in creatrues, creature blueprints, areas, placeables, placeable blueprints, other scripts, conversations)

$ list-scripts.pl * >| ../lists/list-of-scripts
$ for i in *.nss
do
a=`basename $i .nss`
if ! fgrep $a ../lists/list-of-scripts > /dev/null
then
        echo $i
fi
done > ../lists/list-of-possibly-unsed-scripts

Change Placeables to Plot

List of all placed placeables that are not plot (and routine to change them to plot).

gffmodify.pl -p 'Plot|Static|Useable|LocName|Tag|@areaname@' -s '^/Placeable List\[\d+\]/$' -f '/Plot$:=:^0$' -m 'Plot=@ask@' -v *.git

Add OnExit on Areas

Check for Cleanup script existance in areas, if not add.

add-onexit.pl *.are

List Items on area:

gffmatch.pl -s '^/List\[\d+\]/$' -p 'LocalizedName'  -f 'Plot$:=:.*' *.git

Find Placed NPCs with no Conversation

Placed npcs with no conversation? Check.

gffmatch.pl -s '^/Creature List\[\d+\]/$' -p 'FirstName|LastName|Tag'  -f '/Conversation$:=:^$' *.git

Rename Area ResRefs to Usable

Change all area resrefs away from area###

rename-areas.pl *.are > tempfile
tempfile
update-ifo *.are

List Area Informations

List of area name, area tag, and filename sort by tag.

list-areas.pl *.are

List Locks by OpenLockDC

Search for locks who have OpenLockDC > xx.

gffmatch.pl -s '^/[a-zA-Z0-9 ]+\[\d+\]/$' -p 'Tag|CloseLockDC|Locked|Lockable|OpenLockDC|KeyName' --proc full  -f "/OpenLockDC$:=:^([6789][0-9]|...)$" -f "/KeyRequired$:=:^0$" -f "/Locked$:=:^1$" -o  -f "/OpenLockDC$:=:^([6789][0-9]|...)$" -f "/KeyRequired$:=:^0$" -f "/Locked$:=:^0$" -f "/Lockable$:=:^1$" *.git

Search Non Lockable Door and Add Require Key

Search non lockable, non locked door and add Requires key with “dm_quest_key”.

gffmodify.pl -v -s '^/Door List\[\d+\]/$' -f '/Locked$:=:^0$' -f '/Lockable$:=:^0$' -f '/KeyRequired$:=:^0$' -f '/KeyName$:=:^$' -m '/KeyRequired=1' -m 'KeyName=dm_quest_key' *.git

List Used Scripts

List all scripts used by any file.

The list of all fields which can have script names:

    Area: OnEnter, OnExit, OnHeartbeat, OnUserDefined
    Conversations: EndConverAbort, EndConversation, Script, Active
    Creatures: ScriptAttacked, ScriptDamaged, ScriptDeath, ScriptDialogue,
	       ScriptDisturbed, ScriptEndRound, ScriptHeartbeat,
	       ScriptOnBlocked, ScriptOnNotice, ScriptRested,
	       ScriptSpawn, ScriptSpellAt, ScriptuserDefine
    Door/Placeable: OnClosed, OnDamaged, OnDeath, OnDisarm,
		    OnHeartbeat, OnLock, OnMeleeAttacked, OnOpen,
		    OnSpellCastAt, OnTrapTriggered, OnUnlock,
		    OnUserDefined, OnClick, OnFailToOpen,
		    OnInvDisturbed, OnUsed
    Encounter: OnEntered, OnExhausted, OnExit, OnHeartbeat,
	       OnUserDefined
    IFO: Mod_OnAcquirItem, Mod_OnActvtItem, Mod_OnClientEntr,
	 Mod_OnClientLeav, Mod_OnCutsnAbort, Mod_OnHeartbeat,
	 Mod_OnModLoad, Mod_OnModStart, Mod_OnPlrDeath,
	 Mod_OnPlrDying, Mod_OnPlrEqItm, Mod_OnPlrLvlUp,
	 Mod_OnPlrRest, Mod_OnPlrUnEqItm, Mod_OnSpawnBtnDn,
	 Mod_OnUnAcreItem, Mod_OnUsrDefined
    Store: OnOpenStore, OnStoreClosed
    Trigger: OnClick, OnDisarm, OnTrapTriggered, ScriptHeartbeat,
	     ScriptOnEnter, ScriptOnExit, ScriptUserDefine
list-scripts.pl *

Add X2_L_WILD_MAGIC Variable To Areas

Add X2_L_WILD_MAGIC variable to all areas.

gffmodify.pl -p '@areaname@|@areatag@|/Var' --variable 'X2_L_WILD_MAGIC=1' -v *.git

Find Bioware Updated Scripts

Find changes in scripts (for the version change)

This can be dune using keyunpack.pl to extract new scripts from module, and then diffing them against the erfunpacked version of the module.

Change Factions

Find all creatures in Merchant or Defender factions and change to commoneer.

gffmodify.pl -v -s '^/Creature List\[\d+\]/$' -f '/FactionID$:=:^3$' -o -f '/FactionID$:=:^4$' -m '/FactionID=2' *.git

Add Variable To Areas

Add variable to all areas:

* X2_L_WILD_MAGIC

(Partly duplicate to 23)

gffmodify.pl -p '@areaname@|@areatag@|/Var' --variable 'var=value' -v *.git

Minimap Exporter Enchantments

Make a tool that takes the output of Minimap Exporter (the .png files) and renames them to the real area name instead of resref based name. (or make it generic too that is passed a lost of files with resref as part of filename, will look up the correct name in the orginal file and rename.)

The orginal author will do this in version 0.6 for the minimap exporter.

Character Editor

Make online tool to allow charcter files to be edited. To allow setting wings,tails and editing character descriptions atleast.

Steps would go something like:

- set a password ingame→write to log and set on character, (maybe as tag of an item) - log out - Go to a webpage - log in using your NWN username, character name and the password given above. (the script checks for corresponding info) - Go to a form that allows changes to above. - Approve changes and they are written to char file - Log in to game, find your changes made

Change NPC Conversations to Private

Change all NPC convos (and object conversations) to private ones

Modify the ActionStartConversation(GetLastUsedBy()) to something like
ActionStartConversation(GetLastUsedBy(), "", TRUE)

Find Where Creature is Used

Make a script to find if given creature is used in any encounter(placed in module or blueprint)

# Do once
gffprint.pl -b --include-field '^ResRef$' *.ute > list-of-resrefs-in-encouters
gffprint.pl -b --include 'Encounter List' --include-field '^ResRef$' *.git >> list-of-resrefs-in-encouters

# To find out if resref is used in encouter:
fgrep drowmage016 list-of-resrefs-in-encouters

List Creatures with Nonstandard Spawn Script

List all creatures with nonstandard spawn script, both placed and blueprints. List the script, creaturename, creaturesresref sorted by script.

gffmatch.pl --proc csv -b -s '^/Creature List\[\d+\]/$' -p 'ScriptSpawn,Tag,TemplateResRef,FirstName,LastName' -f '/ScriptSpawn$:=:.' *.git > list.csv
gffmatch.pl --proc csv -b -s '^/$' -p 'ScriptSpawn,Tag,TemplateResRef,FirstName,LastName' -f '/ScriptSpawn$:=:.' *.utc >> list.csv

Then simply take the list.csv to gnumeric or similar and sort with those fields you like etc.

Generic Change Scripts in Creatures or Placeable

Search a creature or placeble in blueprint or area, if they have script AA in slot BB change that script to CC and set the variable DD to value EE

gffmodify.pl -p "Name|Tag|Script|@areaname@|/On" -i -v -s '(^/(Creature|Placeable) List\[\d+\]/)|(^/$)' -f '.*/TemplateResRef$:=:.$' -f '/ScriptDeath:=:nw_ch_ac7' -m 'ScriptDeath=ztk_gen_death' --variable "death=summon" a*.utc a*.git

The commmand line above will first search for any Creature or Placeable list in areas and also the top level struct (utc and utp files) for the field TemplateResRef (this limits it to the right substructure, as areas do not have TemplateResRef in / but *.ut* files have and all Creature and Placeable items in areas also have that field). The next -f option searches for the script AA (nw_ch_ac7) in slot BB (ScriptDeath), and changes that script to CC (ztk_gen_death) and adds also a variable DD (death) to have value EE (summon).

Change Scripts in Dialog Conditionals and Add Variables

If a dialog has script AA in conditional, change that to BB and set variable int CC to value DD in every placed instance and blueprint of every creature using that dialog

gffmodify.pl -p '.' -v -i -v -s '^/(StartingList|(Entry|Reply)List\[\d+\]/(Replies|Entries)List)\[\d+\]/' -f '.*/Active$:=:^brother_qualify$' -m 'Active=_gen_qualify' *.dlg
gffmodify.pl -p "Name|Tag|Conversation|@areaname@" -i -v -s '(^/(Creature|Placeable) List\[\d+\]/)|(^/$)' -f '.*/TemplateResRef$:=:.$' -f '/Conversation:=:^brotherhoodbuttl$' --variable "qualify=brotherhood" *.utc *.git

This is two phased process. The first script will search for the dialog files for the right active script AA (brother_qualify), and change it to BB (_gen_qualify). Then the second script will search for the Creature, Placeable or blueprint with the Conversation which was modified (you need to run this for each conversation you modified separately) and add variable CC (qualify) to value DD (brotherhood).

Change Scripts in Dialog Actions and Add Variables

if a dialog has script AA in action taken, change that to BB and set variable int CC to value DD in every placed instance and blueprint of every creature usinging that dialog

gffmodify.pl -p '.' -v -i -v -s '^/(Entry|Reply)List\[\d+\]/' -f '.*/Script$:=:^brotherhood_init' -m 'Active=_gen_givetake1' *.dlg
gffmodify.pl -p "Name|Tag|Conversation|@areaname@" -i -v -s '(^/(Creature|Placeable) List\[\d+\]/)|(^/$)' -f '.*/TemplateResRef$:=:.$' -f '/Conversation:=:^brotherhoodbuttl$' --variable "takeitem1=duralplans,brotherhoodaspirant" --variable "giveitem1=gi_0014_10_1,cereabrotherhood" *.utc *.git

Same as 51, but simply change Active to Script and it must be on the EntryList or ReplyList directly.

Modify Height of the Area

Make tool to make a whole area (rural/ city) one step higher or lower

modify-height.pl -H 2 vesperlake.git

Crossreference Scripts

Make a check what all use a given script (other scripts, placed creatures, creature blueprints, placed placeables, placeable blueprints, areas, Merchants).

list-scripts.pl * > list-of-scripts

List scripts is now enchanted so it can also understand ExecuteScripts and setting dmfi_execute variable.

Crossreference Dialogs

Make check what all use a given dialog (scripts, placed creatures, creature blueprints, placed placeables, placeable blueprints)

list-conversations.pl * > list-of-conversations

The list-conversations script understands the Conversation nodes on the objects, and also BeginConversation and ActionStartConversation commands in the scripts.

Add OnUnLock Script to Locked Placeables and Doors

Go through all placeables and doors that are locked, if no script add a script to on_unlock

gffmodify.pl -p "Name|Tag|@areaname@" -i -v -s '(^/(Door|Placeable) List\[\d+\]/)|(^/$)' -f '.*/TemplateResRef$:=:.$' -f '/Locked$:=:^1$' -f '/OnOpen$:=:^$' -m 'OnOpen=_gen_onopen' *.utp *.utd *.git

Add OnDisarm Script to Trapped Placeables and Doors

Go through all placeables and doors that are trapped and all traps, if nor script add a script to on_disarm

gffmodify.pl -p "Trap|Disarm|Name|Tag|@areaname@" -i -v -s '(^/(Door |Placeable |Trigger)List\[\d+\]/)|(^/$)' -f '/TrapType$:=:^[^0]' -f '/OnDisarm$:=:^$' -m 'OnDisarm=_gen_disarmed' *.utp *.utd *.utt *.git

Crossreference Scripts

Go through all scripts an for each check where they are used (see 55) and for each script report use count (and one instance of use maybe).

sort < list-of-scripts| sed 's/:.*//g' | uniq -c | sort -n | less

Builder Package Tool

Make the update builder basic package tool.

Input:

a) List of resources to include
b) Short description filename (optional, if not specified only output file names in o)
c) Readme file (optional, if not specified skip output file n)
d) Package comment file (optional, if not specified leave package comment empty)
e) Directory where the unpacked module exists (optional, if not given use current directory)
f) resulting filename (optional, if not specified use “package.zip”
g) filename of the erf (optional, if not specified use “package.erf”)
h) filename of the short desccription output file (optional, if not specified use “filelisting.txt”)
i) filename of the long desccription output file (optional, if not specified use “FileDescriptions.txt”)

Output:

zip file containing:
m) erf with the given resources included and the package comment given
n) the readme file
o) file of short descriptions
p) file of long descriptions

Assume atleast following tools available in path if needed: zip, perl, grep, mv, cp, cat, ls and so on

Descriptions:
General: assume that any of the files can be atleast unix/dos types

a) text file with one resourcename/line (full name with extension)
b) a file with lines each starting with resource names in full form followed by other info on same line. if no line exists for the given line, just output the full filename.
c) a text file in free form
d) a text file in free form
e) a path in absolute or relative form ()
f) the file name of the resulting zip file (with or without .zip spelled out)
g) the file name of the erf file inside the zip file (with ot without .erf spelled out) (default package.erf)
h) filename
i) filename

m) Erf file containing the resources specifies in “a” copied from directory “e” . With the package comment from “d”
n) the file from “c”
o) a file containing the lines from “b” that start with a filename given in “a” with the filename from “h”
p) a file containing long descriptions taken from all the files in “a” with filename from “i”
For Scripts: the comments in begining of file and all function the prototypes. (Basically begining of file until the first real function)
For gff files: the builder comment
Each resource info separated and tagged in a way to allow visual and computerised find (maybe a bix box of stars before everything with a line “File: filename” or something to consistently search for)

In general it would be good extra funtionality if it parsed placeables, creatures and scripts for other scripts to include and gave out a list of missinge resources in a format that has one entry/line to make it easy to paste into the source file.

builder-package.pl -v -m cerea104j.mod -r resource-list.txt -R README -c comment -s short-descriptions.txt

or

builder-package.pl -v -r resource-list.txt -R README -c comment -s short-descriptions.txt

(module unpacked in current directory)

Generates package.zip file. Requires Archive::Zip perl module.

Change to Add OnOpen

Change add-onopen.pl so that the check for lock and onopen scripts are dependant on each other and so that it will also remove the lock script is the preconditions are not mached

Obsoleted now

Change Creatures On Area to Immortal

Make all Creatures in given area immortal.

gffmodify.pl -p "Plot|IsImmortal|NoPermdeath|Name|Tag|@areaname@" -i -v -s '(^/Creature List\[\d+\]/)|(^/$)' -f '/IsImmortal$:=:^0$' -m 'IsImmortal=1' *.git

Add OnEnter Script on Area

Modified the add-onexit to be add-onenter

Done

Replace Book In Module with Info From File

Make a tool to make and replace inmodule book with info from the forum posts.

gffmodify.pl -p "DescIdentified|Name|Tag|@areaname@" -i -v -s '/ItemList\[\d+\]/' -f '/Tag$:=:^BookofVarin$' -m 'DescIdentified/0=New replacement text for the book of varin' cereacentral.git

Better handling of books required: They best way to update books and similar would be to first make a script that reads all in module books, be they blueprints or placed.

That would output a tagged file with something like the gffprint one.

Then make a second script that takes input in the same format, again looking for any ingame instances in shops,placeables,creatures etc. and then replace it with the new version. if it is a book that is not found anywhere, just create the item and place it in palette for placing it manually to shops.

For extra credit if the resref on the book begins with:

“adventurer” place it in the adventurer guild book shop with unlimited buy

“basicbook” place it in the cerea basic book shop with unlimited buy

“rarebook” place it in the noma rare book shop with unlimited buy

“nomeikos” take the next 4 numbers/letters to be taken as name of a placeable with tag “Nomeikos”+thos 4 digits/letters in the Nomeikos library area and place those in the inventory of that bookshelf.

or..

alternatively actally that placing could be done with a more generic:
/PlaceBookIn:”arearesref1/merchanttag,arearesref2/placeabletag1,arearesref1/placeabletag2,arearesref3/creaturetag1”

thing... the second could be also actually usefull in the actual placing those objects back if the orginal reading script output allready that info.

Check StayPlot

Modify the plot to immortal script to check for a variable “StayPlot” on the creature if so, keep the thing plot.

Done

Change Doors To Non Plot

Make a script to modify all doors to have 10000 hp not plot and to have a script in ondamaged slot and a script in on lock picked thing.

gffmodify.pl -p "LocName|Tag|@areaname@" -i -v -s "(^/Door List\[\d+\]/)" -f ".*/TemplateResRef$:=:.$" -f "/OnDamaged$:=:^$" -m "OnDamaged=_gen_doordamage" *.git

gffmodify.pl -p "LocName|Tag|@areaname@" -i -v -s "(^/Door List\[\d+\]/)" -f "/CurrentHP$:=:.$" -m "CurrentHP=10000" *.git

gffmodify.pl -p "LocName|Tag|@areaname@" -i -v -s "(^/Door List\[\d+\]/)" -f "/HP$:=:.$" -m "HP=10000" *.git

gffmodify.pl -p "LocName|Tag|@areaname@" -i -v -s "(^/Door List\[\d+\]/)" -f "/Plot:=:1" -m "Plot=0" *.git

Change Door PickLock Difficulties

Make script to list all Door Picklock difficulties and prompt for change for given area/areas

gffmodify.pl -v -s '^/Door List\[\d+\]/$' -p 'LocName|Tag|@arename@|OpenLockDC|CloseLoclDC|Locked' -v -f 'OpenLockDC:=:[1-9]' -m 'OpenLockDC=@ask(@opendc@)@' -P 'opendc=OpenLockDC' cereacentral.git

Change Chest PickLock Difficulties

As previous, but chests

gffmodify.pl -v -s '^/Placeable List\[\d+\]/$' -p 'LocName|Tag|@arename@|OpenLockDC|CloseLoclDC|Locked' -v -f 'HasInventory:=:1' -m 'OpenLockDC=@ask(@opendc@)@' -P 'opendc=OpenLockDC' cereacentral.git

Change Door Tags

Find all doors that have a tag as one of below and change it to unique tag

* RuneDoor * closingdoor * closingmetaldoor * vindClosingDoor * ...

gffmodify.pl -v -s '^/Door List\[\d+\]/$' -p 'LocName|Tag|@arename@' -v -f 'Tag:=:^(closingdoor|NormalDoor|TempleDoor|vindClosingDoor|pwd_falsedoor3|
pwd_door3|FancyDoor|closingmetaldoor|Portcullis|CorridorExit|x2_doorhard2|
RustedDoor|Barn1Door|RuneDoor|vindBardClosingDoor|CryptExit|FenceDoor|
BridgeDoor|Wall1Gate|JeweledDoor|StrongDoor|Barn2Door|DoubleDoors|
CorriDoor|WallDoor|CaveExit|EvilStoneDoor|relockingdoor|ElturelDoor|
Rlyehadmindoor|pwd_door8|CaveDoor|ztk_metal_door|Tay_MonestaryBedroomDoor|
pwd_door4|x2_dooreasy3|BeholderDoor|StorageExit|StoneDoor|Wall2Gate|
lostfortressdoor3|nonopenabledoor|pwd_door|pwd_door10|DoorTemplate|
MineExit|BridgeWooden|ElturelFancyDoor|MetalDoor|lostfortressdoor1|
RuralExit|WeakDoor|d_SelfClosingDoor|pwd_falsedoor7|x2_doormed2|
DungeonExit|MineDoor|Portcullis2|pwd_door11|westroadcultkey|CastleDoor|
CastleExit|JailExit|vindFightClosingDoor)$' -P 'tag=Tag' -m 'Tag=@ask(@substr(@areatag@,0,20)@@substr(@tag@,0,10)@@counter(1000)@x@random(100)@)@' *.git

or without verify:

gffmodify.pl -v -s '^/Door List\[\d+\]/$' -p 'LocName|Tag|@arename@' -v -f 'Tag:=:^(closingdoor|NormalDoor|TempleDoor|vindClosingDoor|pwd_falsedoor3|
pwd_door3|FancyDoor|closingmetaldoor|Portcullis|CorridorExit|x2_doorhard2|
RustedDoor|Barn1Door|RuneDoor|vindBardClosingDoor|CryptExit|FenceDoor|
BridgeDoor|Wall1Gate|JeweledDoor|StrongDoor|Barn2Door|DoubleDoors|
CorriDoor|WallDoor|CaveExit|EvilStoneDoor|relockingdoor|ElturelDoor|
Rlyehadmindoor|pwd_door8|CaveDoor|ztk_metal_door|Tay_MonestaryBedroomDoor|p
wd_door4|x2_dooreasy3|BeholderDoor|StorageExit|StoneDoor|Wall2Gate|
lostfortressdoor3|nonopenabledoor|pwd_door|pwd_door10|DoorTemplate|
MineExit|BridgeWooden|ElturelFancyDoor|MetalDoor|lostfortressdoor1|
RuralExit|WeakDoor|d_SelfClosingDoor|pwd_falsedoor7|x2_doormed2|
DungeonExit|MineDoor|Portcullis2|pwd_door11|westroadcultkey|CastleDoor|
CastleExit|JailExit|vindFightClosingDoor)$' -P 'tag=Tag' -m 'Tag=@substr(@areatag@,0,20)@@substr(@tag@,0,10)@@counter(1000)@x@random(100)@' *.git

List of different door tags:

gffprint.pl -l --include '^/Door List' --include-field 'Tag' *.git | sort | uniq -c | sort -rn | egrep -v '^   1 ' | less

To fix the tags after using too old version of gffmodify:

gffmodify.pl -v -s '^/Door List\[\d+\]/$' -p 'LocName|Tag|@arename@' -v -f 'Tag:=:@' -P 'tag=Tag' -m 'Tag=@tag@' *.git

Find Doors with Same Tag

Find and list any doors that have same tags: list area,tag,name

gffprint.pl -l --include '^/Door List' --include-field 'Tag' *.git | sort | uniq -c | sort -rn | egrep -v '^   1 ' | less

will list the duplicate tags or

gffmatch.pl -b -s '^/Door List\[\d+\]/$'  -f 'Tag:=:^('`gffprint.pl -l --include '^/Door List' --include-field 'Tag' *.git | sort | uniq -c | sort -rn | egrep -v '^   1 ' | sed 's/.* //g' | tr '\012' '|' | sed 's/|$//g'`')$' -p 'Tag|LocName' *.git

will list the actual information

Find and Change Transit Targets Pointing North

Make the “check for transit targets pointing north” detect and change tool.

gffmodify.pl -v -s '^/WaypointList\[\d+\]/$' -p 'Tag|XPosition|YPosition|XOrientation|YOrientation|@areawidth@|@areaheight@|@areaname@|@areatag@|MapNote' -a 'areawidth=/Width' -a 'areaheight=/Height' -f 'YOrientation:=:^1$' -m 'XOrientation=@ask@' -m 'YOrientation=@ask@' *.git

Change Faction of Creatures on Area

Tool to change the faction of all placed creatures in an area to one faction. Preferably by faction names.

To convert faction name “goblin” to id:

gffmatch.pl -s '^/FactionList\[\d+\]/$' -f 'FactionName:=:^goblin$' Repute.fac --proc path -p 'FactionName' | sed 's/.*\[//g; s/\].*//g'

To change faction id to 8:

gffmodify.pl -v -s '^/Creature List\[\d+\]/$' -f 'FactionID:=:.' -p '/(Tag|FirstName|LastName|FactionID)$' -m 'FactionID=@ask(8)@' goblinkingcav001.git

Change Door Scripts to Generic

Thing to add:

* _gen_door_are.nss OnClick or OnUsed * _gen_door_clo.nss OnClosed * _gen_door_dam.nss OnDamaged * _gen_door_fai.nss OnFailToOpen * _gen_door_ope.nss OnOpen * _gen_door_unl.nss OnUnlock

OnClick: _gen_door_are
	=> _gen_door_are
Other scripts:  tg_chk_initiate (3 instances),
	        tg_chk_apprentic (1 instance),
	        tg_chk_journeym (2 instances),
	        dragoncityentry (2 instances)

OnClosed: _gen_door_clo, _gen_lockdoornow, _gen_lockdoor, lockdoornow
	=> _gen_door_clo
Other scripts:  sc_springloadcls (5 instances),
	        ps_custom_drlock (4 instances),
		ds_lock_inn_door (1 instance)

OnDamaged: _gen_door_dam, _gen_doordamage
	=> _gen_door_dam

OnFailToOpen:_gen_door_fai, _gen_brokendoor
	=> _gen_door_fai
Other scripts:  sc_c2mmondooryel (1 instance),
		sc_commondooryel (1 instance)

OnOpen: _gen_door_ope, _gen_closedoor, _gen_onopen, doorautolock001,
	sc_vindbardguild (still used), sc_vindfghtskool (still used),
	_gen_lockdoor, doorcloser, door_close
	doorlongclose (longer delays)
	=> _gen_door_ope
Other scripts:  ps_custom_autocl,
		sc_springloadopn,
		bb_closedoor,
		menonly,
		womenonly,
		sc_vindpirateisl,
		sc_c2mmondoordef,
	        sc_commondoordef

OnUnlock: _gen_door_unl, _gen_lockdoor
	=> _gen_door_unl

OnDeath: x2_door_death
	=> <empty>

OnDisarm: _gen_disarmed
	=> <not changed>

OnHeartbeat:
	=> <not changed, staying empty>
Other scripts:  sc_doorspringlod,
		sc_obj_destroy_3,
		sc_doorspringlok

OnMeleeAttacked:
	=> <not changed, staying empty>
Other scripts:  sc_c2mmondoordfc,
		sc_commondoordfc

OnSpellCastAt: _gen_closedoor
	=> <empty>
Other scripts:  sc_c2mmondoordfd,
		sc_commondoordfd

OnTrapTriggered:
	=> <not modified, staying empty>

OnUserDefined:
	=> <not modifie, staying empty>
<code>

Fix doors:

<code>
gffmodify.pl -v -s '^/Door List\[\d+\]/$' -f 'OnClick:=:^(_gen_door_are|)$' -f 'OnClosed:=:^(_gen_door_clo|_gen_lockdoornow|_gen_lockdoor|lockdoornow|)$' -f 'OnDamaged:=:^(_gen_door_dam|_gen_doordamage|)$' -f 'OnFailToOpen:=:^(_gen_door_fai|_gen_brokendoor|)$' -f 'OnOpen:=:^(_gen_door_ope|_gen_closedoor|_gen_onopen|doorautolock001|sc_vindbardguild|sc_vindfghtsckool|_gen_lockdoor|doorcloser|door_close|)$' -f 'OnUnlock:=:^(_gen_door_unl|_gen_lockdoor|)$' -f 'OnDeath:=:^(x2_door_death|)$' -f 'OnDisarm:=:^(_gen_disarmed|)$' -f 'OnHeartbeat:=:^$' -f 'OnMeleeAttacked:=:^$' -f 'OnSpellCastAt:=:^(_gen_closedoor|)$' -f 'OnTrapTriggered:=:^$' -f 'OnUserDefined:=:^$' -p '/(Tag|OnClick|OnClosed|OnDamaged|OnFailToOpen|OnOpen|OnUnlock|OnDeath|OnDisarm|OnHeartbeat|OnMeleeAttacked|OnSpellCastAt|OnTrapTriggered|OnUserDefined)$' -m 'OnClick=_gen_door_are' -m 'OnClosed=_gen_door_clo' -m 'OnDamaged=_gen_door_dam' -m 'OnFailToOpen=_gen_door_fai' -m 'OnOpen=_gen_door_ope' -m 'OnUnlock=_gen_door_unl' -m 'OnDeath=' --variable 'app=@appereance@@substr(000@generictype@,-3,3)@' -P 'appereance=/Appearance' -P 'generictype=/GenericType' *.git

gffmodify.pl -v -s '^/Door List\[\d+\]/$' -f 'OnClick:=:^(_gen_door_are|)$' -f 'OnClosed:=:^(_gen_door_clo|_gen_lockdoornow|_gen_lockdoor|lockdoornow|)$' -f 'OnDamaged:=:^(_gen_door_dam|_gen_doordamage|)$' -f 'OnFailToOpen:=:^(_gen_door_fai|_gen_brokendoor|)$' -f 'OnOpen:=:^doorlongclose$' -f 'OnUnlock:=:^(_gen_door_unl|_gen_lockdoor|)$' -f 'OnDeath:=:^(x2_door_death|)$' -f 'OnDisarm:=:^(_gen_disarmed|)$' -f 'OnHeartbeat:=:^$' -f 'OnMeleeAttacked:=:^$' -f 'OnSpellCastAt:=:^(_gen_closedoor|)$' -f 'OnTrapTriggered:=:^$' -f 'OnUserDefined:=:^$' -p '/(Tag|OnClick|OnClosed|OnDamaged|OnFailToOpen|OnOpen|OnUnlock|OnDeath|OnDisarm|OnHeartbeat|OnMeleeAttacked|OnSpellCastAt|OnTrapTriggered|OnUserDefined)$' -m 'OnClick=_gen_door_are' -m 'OnClosed=_gen_door_clo' -m 'OnDamaged=_gen_door_dam' -m 'OnFailToOpen=_gen_door_fai' -m 'OnOpen=_gen_door_ope' -m 'OnUnlock=_gen_door_unl' -m 'OnDeath=' --variable 'door_delay#float=1800' --variable 'door_lock_delay#float=1800' --variable 'app=@appereance@@substr(000@generictype@,-3,3)@' -P 'appereance=/Appearance' -P 'generictype=/GenericType' *.git

List non standard doors:

gffmatch.pl -b -s '^/Door List\[\d+\]/$' -f '/OnClick$:!:^_gen_door_are$' -o -f '/OnClosed$:!:^_gen_door_clo$' -o -f '/OnDamaged$:!:^_gen_door_dam$' -o -f '/OnFailToOpen$:!:^_gen_door_fai$' -o -f '/OnOpen$:!:^_gen_door_ope$' -o -f '/OnUnlock$:!:^_gen_door_unl$' -o -f '/OnDeath$:=:.' -o -f '/OnHeartbeat$:=:.' -o -f '/OnMeleeAttacked$:=:.' -o -f '/OnSpellCastAt$:=:.' -o -f '/OnTrapTriggered$:=:.' -o -f '/OnUserDefined$:=:.' -p '/(Tag|OnClick|OnClosed|OnDamaged|OnFailToOpen|OnOpen|OnUnlock|OnDeath|OnDisarm|OnHeartbeat|OnMeleeAttacked|OnSpellCastAt|OnTrapTriggered|OnUserDefined)$' *.git

Add OnEnter Script to Encounters

Add a script to onenter of all encounters that do not have one

gffmodify.pl -v -s '^/Encounter List\[\d+\]/$' -f '/OnEntered$:=:^$' -m 'OnEntered=_gen_enc_enter' *.git

Multiple Area Variables by 100

Go through all the areas and look for Cold, Acid, Heat, Unlife, Life, Earth, Air area variables, and multiplies the values found by 100.

for i in Cold Acid Heat Unlife Life Earth Air
do
gffmodify.pl -v -s '^/$' -f '@'"$i"'@:=:^\d+$' --variable-parameter 'x'"$i"'=/'"$i" --variable "$i"'=@x'"$i"'@000' *.git
done

Check Winter/Desert Tilesets and Add Cold/Heat Variable

Go through all areas and if tileset is winter or frozen wastes, check and report if no cold variable. If desert tileset check and report if no Heat variable.

[QUOTE] Cold tilesets: tts01 tti01 Heat tileset: ttd01 [/QUOTE]

gffmodify.pl -v -s '^/$' -f '@tileset@:=:^tt[si]01$' -f '@coldvar@:!:[123456789]' --variable-parameter 'coldvar=Cold' --area-parameter 'tileset=/Tileset' --variable 'Cold=@ask(2000)@' -p '@areaname@|@areatag@|@coldvar@|@tileset@' *.git

gffmodify.pl -v -s '^/$' -f '@tileset@:=:^ttd01$' -f '@heatvar@:!:[123456789]' --variable-parameter 'heatvar=Heat' --area-parameter 'tileset=/Tileset' --variable 'Heat=@ask(2000)@' -p '@areaname@|@areatag@|@coldvar@|@tileset@' *.git

Put OnUse Script to non static Usable Placeables

Go through all placeables that are usable and not static and do not have an inventory. If they have no onuse script place one (it will do an autoexamine).

gffmodify.pl -v -s '^/Placeable List\[\d+\]/$' -f 'HasInventory$:=:^0$' -f 'OnUsed$:=:^$' -f 'Static$:=:^0$' -p '@areaname@|@aretag@|Tag|LocName|Description' -m 'OnUsed=@ask(_gen_autoexamine)@' *.git

Export Shop Items

Tool to take all items from all stores in an area and create an erf with them.

export-shops.pl -o market.erf cereacentral.git

List Waypoints

Script to get all waypoints in all areas by navigator code listing the area tag, area name, and each waypoint in area.

For example given 0017 as targetarea, would generate
area1tag, area1name, waypoint1tag, waypoint2tag, waypoint3tag,waypoint4tag,waypoint5tag
area2tag,area3name,waypoint1tag,waypoint2tag
...

Not exactly in that format, but with one line per each waypoint, and having arearesref, areatag, areaname, and waypoint name.

gffmatch.pl -b -s '^/WaypointList\[\d+\]/$' -f 'Tag$:=:.' --proc csv -p '@areatag@,@areaname@,Tag' *.git

Change Placed Creature Race

Change race (to 20 outsider) from all placed creatures on area who have some other race (24 unlife).

gffmodify.pl -v -s '^/Creature List\[\d+\]/$' -p 'Name' -f '/Race$:=:24' -m 'Race=@ask(20)@' goldencity01.git

Change Placed Creature Class

Change classes (all levels) (to 24 outsider) from all placed creatures on area who have some other classes (19 unlife).

gffmodify.pl -v -s '^/Creature List\[\d+\]/ClassList\[\d+\]/$' -f '/Class$:=:19' -m 'Class=@ask(24)@' goldencity01.git          

Add Tile Variables for Each Tile

Add Tile Variables for Each Tile. Seems it is possible to detect the following:

* roads * water * grass * cliff * woods * chasm

So parse all tiles and place a string in the are describing those bitwise.

In addition place a variable indicating the tileset and the X and Y dimensions in the area.

tile-extractor vesperlake.are

Set Appearance Variable on Doors

Set the app variable on the doors to match the appearance of the door, so that app % 1000 gives the generic type, and app / 1000 gives the appearance.

gffmodify.pl -v -s '^/Door List\[\d+\]/$' --variable 'app=@appearance@@substr(000@generictype@,-3,3)@' -P 'appearance=/Appearance' -P 'generictype=/GenericType' *.git
 
auto_done.txt · Last modified: 2005/12/29 11:28 by weby
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki