Jump to content

Recommended Posts

see readme well, until it is compiled and uploaded see this:

or & \DEFINE{ADD!AREA!TYPE} areaTypeName &

Adds a new (guaranteed-unique) area type to areatype.ids, and sets

the areaTypeName variable to the index of the bit the type is associated

with: the type can be set with

\verb+WRITE_SHORT 0x48 THIS | (1 << areaTypeName)+.

 

 

 

If areatype.ids already contains areaTypeName, the variable is set to

the type's current identifier and no other operation is performed.

 

 

 

Also note that only 8 area types can be added to an unmodded installation

of BG2; as such, don't add a new area type type unless you really need it

(most likely, another modder is already using a type with a similar name,

and you can share the type between your mods without issue).

Link to comment
Were those actually unique or did some mod append 200 times the same sec type?

From what I could tell they were all unique, but most of them seemed hard to justify, so I hope there was some sort of mistake involved.

 

 

 

Anyway, if no one objects to me doing the work I figure I'll (eventually) post FL_INN and FL_STRONGHOLD as stand-alone resources, complete with code for tagging areas and all that, so you can just include it in your mod if you want to use it.

 

However, as I said, the current definition of FL_INN is pretty much any area where you can probably rent a bed, except ar2100. But the exact definition doesn't really matter to me (I only need something that can be expressed in a single sentence with a minimum of ambiguity), so if anyone needs something more well-defined (e.g. only proper inns in populated towns) now is the time to speak up.

Edited by Wisp
Link to comment
However, as I said, the current definition of FL_INN is pretty much any area where you can probably rent a bed, except ar2100. But the exact definition doesn't really matter to me (I only need something that can be expressed in a single sentence with a minimum of ambiguity), so if anyone needs something more well-defined (e.g. only proper inns in populated towns) now is the time to speak up.

Since it's a bitfield, you can simply combine simple definitions into more complex ones if you're that much willing to make it hard for people to get the right dialogues for your mod:

 

OR(2)

AreaType(FL_INN)

AreaType(FL_CANRENTBUTISNOTANINN)

AreaType(FL_INSIDE)

!AreaType(FL_TRADEMEET)

Link to comment

I'm looking for specifically identifying inns for dialogs and scripts independently from CITY.

I am not sure the best way to phrase it -

 

Though as can be seen by the rest of A.W.'s threads, if you build it, I will try to find a way to use it...

 

I expect for most scripting, there might be only a few breakdowns that could be combined to make much more specific checks. the ones I thought out were

 

FL_RENTROOM // flags any area where you can rent a room to sleep (this is what I think you need, right, Wisp?)

FL_STORE // flags any area that contains a store

FL_INN // flags any area that is an inn

FL_STRONGHOLD // flags any area that is a player stronghold

FL_INSIDE // flags any area which constitutes an inside room, where area effect spells could destroy innocents

 

But the more we create these divisions, the more we fill up.

 

So

FL_INN !FL_RENTROOM ends up catching the areas that you can visit and have a drink or such, but can't sleep

 

FL_INN !FL_STRONGHOLD catches all (drink, rest or not) inns except the Bard stronghold ones

 

CITY !FL_INN catches all the city outdoor things vanilla was shooting for

 

OR(2) CITY FL_INN catches either inside or outside of an inn in a village or city

 

OUTDOORS FL_INN would catch Miloch's Druid Resting Stop (hopefully with half-dryad half-nymph attendants)

 

Bleh. Just brainstorming. At a minimum, I would love to be able to have something that matches what we were originally discussing, which is best described as CITY_INN - mod-added and vanilla inns where the character can leave and walk about nondescript village or city streets, visit a garden, dance, drink, and/or expect to end the thing with the movie that has the bed in it.

 

proper inns in populated towns makes the most sense for being able to do this. From a scripting perspective, this means that instead of blocks something like

 

   OR(14) << constantly changing and adding with new mods; needs detailed multiple edits to update
	AreaCheck("AR0313") // Sea's Bounty
	AreaCheck("AR0406") // Copper Coronet
	AreaCheck("AR0509") // Five Flagons
	AreaCheck("AR0522") // Five Flagons (Stronghold)
	AreaCheck("AR0704") // Mithrest Inn
	AreaCheck("AR1105") // Umar Inn
	AreaCheck("AR1602") // The Vulgar Monkey
	AreaCheck("AR2010") // Vyatri's Pub, Trademeet
	AreaCheck("AR0709") // Den of the Seven Vales 1st Floor
	AreaCheck("AR0513") // Calbor's Inn at Bridge District 1st Floor
	AreaCheck("AR0021") // Crooked Crane 1st Floor
	AreaCheck("AR1602") // Brynnlaw's Inn
	AreaCheck("C-AR01") // The Broken Sword (Aran Whitehand)
	AreaCheck("MyNewInn") // Mod Added Inn

 

with

 

	  /* one universal check - to update all script in myMod to include a new reference, just add the flag to the new area when your mod is installed or in the "at end of install" mod, either Crossmod or your own standalone patch. */
  AreaType(FL_INN)

 

 

we don't need breakdowns of inns only in ToB, or only in BG/BGT/CA or even in Underdark, because #1 the areatype is added to the area, and #2 we can constrain by other existing variables -

 

AreaType(FL_INN) GlobalGT("Chapter","GLOBAL",7) = ToB Inns

 

AreaType(FL_INN) GlobalLT("ENDOFBG1","GLOBAL",2) = BG Inns in BGT

 

etc.

 

Since this stuff is very standard for romance talks and "drunk talks", it might help out some folks.

Edited by cmorgan
Link to comment
At a minimum, I would love to be able to have something that matches what we were originally discussing, which is best described as CITY_INN - mod-added and vanilla inns where the character can leave and walk about nondescript village or city streets, visit a garden, dance, drink, and/or expect to end the thing with the movie that has the bed in it.

Yeah, I, too, think a label for inns in cities and towns would be the most useful incarnation of an inn area type. If you want every possible place where you can rent a room, I don't think there are many enough to make it difficult to OR an AreaType check with a few AreaChecks (with the whole trigger being generated by TP2).

Or, if there turns out to be a reason for adding an area type for non-inn resting places, that can be dealt with when the need arises.

Link to comment
There's only (at best) 8 free flags on standard BG2, so space *is* at a premium.
Well, all the more reason to agree on standardised numerical values (and labels).
That's true. Okay, so CD_INN (?) and FL_STRONGHOLD it is.
I look at this and think it's messy already. There're only 8 flags available, so what's the point of having an array of different prefixes?
Agreed, but what's the point of having prefixes at all for standard agreed-on IDS entries? Prefixes are for file resources so modders don't overwrite each other. If you're adding an entry to this without bothering to check what others have done first, it doesn't matter whether anyone's using prefixes or not. So why require more typing than necessary (granted, folks can also use numerical values but labels are easier to remember).
OUTDOORS FL_INN would catch Miloch's Druid Resting Stop (hopefully with half-dryad half-nymph attendants)
Heh, something like that (possibly with a strange herb garden). But technically, it's not OUTDOORs but inside a rock (not subject to rain etc.). Maybe we need a WILDERNESS flag if there's really a need for it, being as how CITY apparently can't be used for city subareas (still not quite sure why not but I'll assume such a "fix" wouldn't exist without a need).

 

Also, I wouldn't know what you would use to detect things like inn cellars either, (apparently they wouldn't be flagged as CITY, INN or DUNGEON) though I suppose they don't necessarily need to be detected.

 

Edit: If there's going to be INN and SHOP (places where you can rent a bed and buy items) shouldn't there also be TAVERN and TEMPLE (places you can drink/hear rumours and get curing)? Keeping in mind the limited space, but those latter might actually need to be identified separately, no?

Edited by Miloch
Link to comment

OK, contributor-types - I am ready for a spring cleanup of existing code in AW, and I'd like to incorporate this stuff. If I can summarize correctly, the proposal is

 

Usage of standardized flagging, to be posted somewhere (and since Wisp is doing the heavy stuff, his prefix)

  1. FL_INN = this area is an urban hotel, rumor, drink, etc. place.
    Sample Usage:
    IF ~AreaType(FL_INN)~ THEN RESPOND ~Well, do you want to go get a drink, listen around, dance to the music, take a walk on the streets, or just turn in for the night?~
  2. FL_STRONGHOLD = this area is a player-attained stronghold
    Sample Usage:
    IF ~AreaType(FL_STRONGHOLD)~ THEN RESPOND ~Nice little place you are running here, <CHARNAME>. The upkeep must be expensive.~
  3. FL_TEMPLE = this area is a temple
    Sample Usage:
    IF ~AreaType(FL_TEMPLE)~ THEN RESPOND ~This place should have some cures available. Or we could just talk to the cleric with the funny hat over there.~
  4. FL_SHOP = this area is a store or trading post
    Sample Usage:
    IF ~AreaType(FL_SHOP)~ THEN RESPOND ~Well, we could use some supplies. He won't let us drink or dance, and sleeping is out of question, but that set of bracers over there look pretty nice.~
  5. FL_TAVERN
    Sample Usage:
    IF ~AreaType(FL_TAVERN)~ THEN RESPOND ~Well, do you want to go get a drink, listen around, dance to the music, or take a walk on the streets? We can't rent a bed here, more's the pity.~

 

I am strongly in favor of two of these being accepted as standard right now, and want to code them in:

 

FL_INN would be useful for any place I want to spawn a barfight, walk in city streets via dialog, dance or flirt with alcohol and a place to go to bed and sleep (or most decidedly not sleep); anything that matches something like The Copper Coronet goes into this category for me. Mod-added areas in Fishing For Trouble and several other mods would fit this as well.

 

FL_STRONGHOLD is useful to Wisp right away.

 

The others I am not currently planning to use in dialog, so there is no push from me to lock them down, unless someone is already pushing content that needs it.

 

Wisp, is the current code in this thread the same as what you are planning to use?

Edited by cmorgan
Link to comment
Wisp, is the current code in this thread the same as what you are planning to use?

Sort of. The general idea's the same, but details are different. And when WeiDU 228 is out I'll move over to the TP2 action. But if you are thinking of mirroring the code in Aran, there's no need. I plan on publishing a .tpa file, that'll do all the work of adding the area type and flagging areas, which you'll be able to just include in your mod.

Link to comment

I have a pretty comprehensive list of inns now. But I'm unsure of how urban is urban enough for you. Unfortunately the inns range from being located in Athkatla/Baldur's Gate to being located in the middle of nowhere, with more intermediate cases like Ulgoth's Beard (village), The Friendly Arm and Candlekeep (fortified communities that could qualify as urban-ish all on their own).

 

Since the whole purpose of this is to have something simple and useful, the line will simply have to be drawn somewhere, probably excluding some of the mod-added inns.

 

Aside from degree of urban-ness, there is also Saradush. Should that be included, even though the city is under siege and you have fire and whatnot raining down upon you that very moment?

Link to comment

Since the code is likely easily extendable (I assume by just adding the mod areas wanted to the .tpa, or by doing it inside ACTION_FOR_EACH var IN ~area1 area2 area3 area4~ BEGIN IF FILE_EXISTS_IN_GAME ~var~ THEN BEGIN PATCH_IF sourcesize_check_is_valid LPF ~mymod/lib/wisps_area_flags.tpa~ END END END) I think it would be fine to operate on a relatively conservative basis. If a modder wants to add the flag to their own area, no problem - for currently existing areas, though, especially for ones no longer updated, I say go for as wide open a definition as you can.

 

I'd include Sardush, etc, - in fact, I'd rather make it wider in scope for general usefulness. If (for example) I have stuff written that is for an inn but would not work in certain areas, like Underdark, it would be simple to screen those non-conforming areas out with specific area checks., e.g.

 

~AreaType(FL_INN) !AreaCheck(%the_inn_in_fishing_for_trouble%) !Global("Chapter","GLOBAL",5)~ = works in every inn except one of the FFT areas and anything that calls itself an inn in Underdark, whether vanilla or mod-added.

 

The modder adding their own area, like C-AR01, would enable my conversations in their area without further work on my part - but if it were Miloch's Druidic Retreat, I (or BWP when someone reports an impossible walk out along non-existant urban streets) would be responsible for closing it up the way i describe above.

 

Heck, I could have said this shorter. All I am saying is that on the modder end, in this case, it is easier to exclude one area than juggle a list of 20 areas.

Link to comment

Well, I guess I'll include all the inns then.

Most mod-added inns are located in copies of Beregost, copies of IWD's towns (log cabins), or areas of roughly the same type. The exceptions I know of are two inns from TDD, which are located in the wilderness of Amn/Tethyr and one from NTotSC, which is some sort of castle east of Baldur's Gate.

 

But I'd like to keep the Underdark as the exception, since the large majority of the area is not an inn. If someone would like to include it, it's easy enough have an AreaCheck for ar2100.

Link to comment

That sounds very reasonable - anyone looking for things to trigger in UD is going to need to be very specific anyways, as the look and behavior of the PC and NPCs needs to be very different. And thank you for saving other modders lots of time, work, and research. Not to mention frustration!

 

If you are tweaking up the stuff, I would love C-AR01 C-AR02 C-AR03 (and you can drop the others from the list covering Aran Whiehand) - I am not expecting to have more than C-AR01, but it means easy "future proofing" for other projects. I am not expecting to add more than three inns to anything in my entire modding career ???

Link to comment

Hey - CamDawg in BG1NPC has been doing this, just FYI:

  /* Area Type Flagging */
 /* ToSC only: Tutu and BGT */
 ACTION_IF (FILE_EXISTS_IN_GAME ~FW1500.are~) OR (FILE_EXISTS_IN_GAME ~ARW500.are~) THEN BEGIN //  if TotSC is installed
COPY_EXISTING ~%IsleofBalduranN%.are~ ~override~
			  ~%IsleofBalduranS%.are~ ~override~
			  ~%DurlagsTower%.are~ ~override~
			  ~%Farmlands%.are~ ~override~
  READ_BYTE  "0x48" "flags"
  WRITE_BYTE "0x48" ("%flags%" BOR "0b00010001")
BUT_ONLY_IF_IT_CHANGES
 END

 /* FOREST and OUTDOOR: Tutu and BGT */
 COPY_EXISTING ~%FishingVillage%.are~ ~override~
			~%Peldvale%.are~ ~override~
			~%LionsWay%.are~ ~override~
			~%CoastWay%.are~ ~override~
			~%Larswood%.are~ ~override~
			~%ShipwrecksCoast%.are~ ~override~
			~%HighHedge%.are~ ~override~
			~%MutaminsGarden%.are~ ~override~
			~%Lighthouse%.are~ ~override~
			~%RedCanyons%.are~ ~override~
			~%SouthBeregostRoad%.are~ ~override~
			~%Ulcaster%.are~ ~override~
			~%ArchaeologicalSite%.are~ ~override~
			~%FishermansLake%.are~ ~override~
			~%NorthNashkelRoad%.are~ ~override~
			~%LonelyPeaks%.are~ ~override~
			~%FirewineBridge%.are~ ~override~
			~%BearRiver%.are~ ~override~
			~%ValleyoftheTombs%.are~ ~override~
			~%DryadFalls%.are~ ~override~
			~%FireLeafForest%.are~ ~override~
			~%GibberlingMountains%.are~ ~override~
READ_BYTE  "0x48" "flags"
WRITE_BYTE "0x48" ("%flags%" BOR "0b00010001")
 BUT_ONLY_IF_IT_CHANGES

 /* OUTDOOR ONLY: Tutu and BGT */
 COPY_EXISTING ~%GnollStronghold%.are~ ~override~
			~%NashkelMines%.are~ ~override~
			~%FriendlyArmInn%.are~ ~override~
			~%Temple%.are~ ~override~
			~%NashkelCarnival%.are~ ~override~
READ_BYTE  "0x48" "flags"
WRITE_BYTE "0x48" ("%flags%" BOR "0b00000001")
 BUT_ONLY_IF_IT_CHANGES

 /* CITY and OUTDOOR */
 COPY_EXISTING ~%WyrmsCrossing%.are~ ~override~
			~%Candlekeep_Ch6%.are~ ~override~
			~%Gullykin%.are~ ~override~
READ_BYTE  "0x48" "flags"
WRITE_BYTE "0x48" ("%flags%" BOR "0b00001001")
 BUT_ONLY_IF_IT_CHANGES

 

This is just regular flagging of converted resources, but for future folks researching this it shows how to add the standard CITY, FOREST, OUTDOOR, and some combos.

Edited by cmorgan
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...