Jump to content


Photo

Known Issues v4.0 (post bug reports here)


  • Please log in to reply
287 replies to this topic

#221 -Guest-

-Guest-
  • Guest

Posted 23 January 2010 - 12:19 PM

@devSin: I tracked down code location for RandomWalk which shares root function with RandomTurn and RandomRun (RandomFly uses its own). All four of these "Random" actions are found in the same switch. I wasn't sure how much you've worked with internals of engine but if you'd like code locations I can post em. Just working on doing some analysis to track down odd behavior of RandomWalk. Something easy in comparison to headache that is trying to resolve quick load crash. Anyway, in one of your posts you said something about "Wander distance" value. Where would I find this in NI? I looked at PST/BG2 and couldn't find it under CRE values.

These are in the ARE actor struct (and are also inherited from spawn points and rest spawns). According to Taimon's notes, the Movement distance, which is the following word, can be set but is zeroed before use in BG series (it would control maximum distance for movement in things like MoveTo* or even Attack(), but is just set to 0 right before it would be needed).

RandomWalk() may also be influenced by the upper CRE flags (the "[spec] tracking" labels in NI); in the BG series, this would skew the random location choice to cause more grouping between matching objects (e.g., Race tracking would attempt to cluster near objects the same race as the active object), if you see any reads into the CRE flags in those methods. (No CREs use this in PST, though, so it's not really relevant.)

#222 scient

scient
  • Modder
  • 1010 posts

Posted 23 January 2010 - 12:27 PM

Just tested. 'RunAwayFrom(Whomever, for a *short* amount of time) EscapeArea()' should work fine.


Afraid it doesn't. Trust me, I've tested it MANY times, and just did so again.

If you do them in the order you suggest, she will run away, but then she won't necessarily actually leave the area, and if you click on her for dialogue you'll stop her in her tracks.

If you do them in the opposite order, she'll just walk away, unclickable, and will escape the area.

Qwinn


Would you be interested in something like EscapeArea(I:Toggle) where you could toggle walking/running (and default to walking if not set)? I would think this would be fairly simple to toggle between walking/running but will have to see.

Also, from BG1/BG2/IWD2 I see this action script function RunAwayFromNoInterrupt which looks promising. Does anyone know if "no interrupt" means you can't initiate dialog?

Edited by scient, 23 January 2010 - 12:30 PM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#223 Qwinn

Qwinn
  • Modder
  • 3092 posts

Posted 23 January 2010 - 12:30 PM

I prefer not to do substantive dialogue changes unless it's *really* minimal, like changing "the dead" to "the dead of Sigil" in Dhall's dialogue to justify being able to ask him about Sigil. And I had to talk myself into that one. Typos and grammar mistakes, I fix those freely, but changing the actual content... eh.

Besides, fixing this isn't as easy as you'd think. Take Barkis's speech about his patrons, for example:

"I don't make it a point to interfere with the lives of the people who give me their hard-earned jink unless they ask me to. So. Over there is Candrian. Planewalker. He's a good one to talk to about any planewalking questions you might have - he's been pretty much everywhere. Down there is Ebb Creakknees, an old Harmonium basher - don't hold that against him - and a tout. He's got a good heart in him, and he knows Sigil up and down. Them fiends over there are Aethelgrin and Tegar'in. Word of advice: Don't deal with 'em. They might be low-rankers in the fiend hierarchy, but they're still fiends. Then you got Ilquix over there - NOT trustworthy - and some Mercykillers looking for some poor sod. Dak'kon the githzerai is a mystery to me. Don't know much about him. He don't talk much. Finally - you interested in earning some free bub?"


Every one of those could go "missing", quite easily. If your "Murder" count goes high enough, the Mercykillers will aggro. Plenty of reasons to kill the fiends. It's possible to wind up killing Ebb later on. Etc., etc.

I'm willing to do things like remove the "Who's that burning guy over by the doorway" reply once Ignus is freed, but what you're suggesting could potentially require redoing that dialogue state in about 20+ different combinations to account for who's dead and who's not. Not really willing to go there, if for no other reason than my translators would be justified in wanting to kill me.

Qwinn

#224 Qwinn

Qwinn
  • Modder
  • 3092 posts

Posted 23 January 2010 - 12:34 PM

Scient,

Sure, that'd be good in a few situations, although, could you still call that function with *no* parameter, as in just EscapeArea(), and not have it blow up? I would think it would at least throw errors during installation, which I'd prefer to avoid.

To avoid that, I think we'd be better off creating a new function, like EscapeAreaRunning(). No parameter needed that way. Would that be more difficult? I can handle setting it up in ACTIONS.IDS.

As for PS:T, once a creature has actually been set to escape the area, you can't click on them to initiate dialogue anymore, so I guess it's "no interrupt" by default.

Qwinn

#225 -Guest-

-Guest-
  • Guest

Posted 23 January 2010 - 12:39 PM

Also, from BG1/BG2/IWD2 I see this action script function RunAwayFromNoInterrupt which looks promising. Does anyone know if "no interrupt" means you can't initiate dialog?

This has to deal with script interruptions (RunAwayFrom() is an interruptible action by default, so the engine will happily give the creature something else to do instead).

I believe it does also block dialogue ("too buys to talk"), but so does EscapeArea() and such (and there's no real difference in other IEs of RunAway and Escape as far as travel speed goes; actual "running" is PST-only).

#226 -Prince-

-Prince-
  • Guest

Posted 23 January 2010 - 12:39 PM

Qwinn,

Wow, that is certainly a lot of work for such s seemingly small change. All right, certainly not worth the effort.

#227 scient

scient
  • Modder
  • 1010 posts

Posted 23 January 2010 - 01:23 PM

Scient,

Sure, that'd be good in a few situations, although, could you still call that function with *no* parameter, as in just EscapeArea(), and not have it blow up? I would think it would at least throw errors during installation, which I'd prefer to avoid.

To avoid that, I think we'd be better off creating a new function, like EscapeAreaRunning(). No parameter needed that way. Would that be more difficult? I can handle setting it up in ACTIONS.IDS.

As for PS:T, once a creature has actually been set to escape the area, you can't click on them to initiate dialogue anymore, so I guess it's "no interrupt" by default.

Qwinn


Well, you could do something like this by overloading action id?
181 ReallyForceSpell(O:Target*,I:Spell*Spell)
181 ReallyForceSpellLevel(O:Target*,I:Spell*Spell,I:CastLevel*)

108 EscapeArea()
108 EscapeAreaRunning(I:Toggle)

While it would be nice to be able to make an entirely separate script function, it would be less work I think to add a parameter or overload it. Otherwise, it would mean I'd have to duplicate whole function except for what I'm hoping will be minor toggle in CRE state.

edit: I'll see if I can toggle CRE into running mode and then will worry about hooking it up to scripts. I just know there were a few areas where you said it would be nice to have them exit running rather than walking.

edit edit:
Ignore comment about having to duplicate whole function. If possible I might be able to do something along the lines of how RandomWalk/RandomRun works. So hopefully should be able just to have a separate action like EscapeAreaRunning().

Edited by scient, 23 January 2010 - 01:30 PM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#228 -devSin-

-devSin-
  • Guest

Posted 23 January 2010 - 03:11 PM

Ar0305 - the two Hivers here are using the exterior peasant dialogue, which is entirely inappropriate for them (at the least, it can lead to them having nothing to say for several attempts to talk to them, and worst case, it can lead to one or both simply leaving the map when they finally do speak)

#229 Qwinn

Qwinn
  • Modder
  • 3092 posts

Posted 23 January 2010 - 03:48 PM

Ar0305 - the two Hivers here are using the exterior peasant dialogue, which is entirely inappropriate for them (at the least, it can lead to them having nothing to say for several attempts to talk to them, and worst case, it can lead to one or both simply leaving the map when they finally do speak)


Well, leaving the area is acceptable for anyone with this dialogue... they can leave the main Hive areas too. I do see what you mean about clicking and getting no valid dialog state, as the main areas seem to have fallback states if none of the random rolls take, but what alternative dialogues do you suggest for the two in the Flophouse?

We could add fallback states for AR0305 to that dialog so you don't get no-valid-dialog issues, using some of their standard not-area-specific lines, but not sure what else we could do.

Qwinn

Edited by Qwinn, 23 January 2010 - 03:54 PM.


#230 scient

scient
  • Modder
  • 1010 posts

Posted 23 January 2010 - 03:58 PM

Done, just waiting for Qwinn to confirm it is working as he wants. I'm injecting some code at start of EscapeArea() which mirrors how RunAwayFrom(Ex) and RandomRun() setup running mode. This is only accessed if script action id is 313 (doesn't exist in vanilla) so existing EscapeArea() with id of 108 will default to vanilla behavior of walking.

313 EscapeAreaRunning()

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#231 -Guest-

-Guest-
  • Guest

Posted 23 January 2010 - 04:35 PM

Well, leaving the area is acceptable for anyone with this dialogue... they can leave the main Hive areas too. I do see what you mean about clicking and getting no valid dialog state, as the main areas seem to have fallback states if none of the random rolls take, but what alternative dialogues do you suggest for the two in the Flophouse?

These two guys are in a conversation (they're talking about the sleeping bariaur). If one leaves, the other may still try to talk with the non-existent partner (and will actually start targeting anybody else nearby in vanilla). I don't see any evidence that either was intended to be disposable.

The dialogue only works for the four main Hive areas (the Random()s are structured such that you can "fall through" and get caught with an area-specific True()-like state, but this won't work in AR0305). Also note that there's one AR0300 reply that you can never access.

I have no idea what alternative to suggest, which is why I didn't suggest one. :) These are the only two guys using this dialogue outside the four Hive exteriors.

#232 scient

scient
  • Modder
  • 1010 posts

Posted 23 January 2010 - 05:07 PM

@devSin: I tracked down code location for RandomWalk which shares root function with RandomTurn and RandomRun (RandomFly uses its own). All four of these "Random" actions are found in the same switch. I wasn't sure how much you've worked with internals of engine but if you'd like code locations I can post em. Just working on doing some analysis to track down odd behavior of RandomWalk. Something easy in comparison to headache that is trying to resolve quick load crash. Anyway, in one of your posts you said something about "Wander distance" value. Where would I find this in NI? I looked at PST/BG2 and couldn't find it under CRE values.

These are in the ARE actor struct (and are also inherited from spawn points and rest spawns). According to Taimon's notes, the Movement distance, which is the following word, can be set but is zeroed before use in BG series (it would control maximum distance for movement in things like MoveTo* or even Attack(), but is just set to 0 right before it would be needed).

RandomWalk() may also be influenced by the upper CRE flags (the "[spec] tracking" labels in NI); in the BG series, this would skew the random location choice to cause more grouping between matching objects (e.g., Race tracking would attempt to cluster near objects the same race as the active object), if you see any reads into the CRE flags in those methods. (No CREs use this in PST, though, so it's not really relevant.)


Yep, there are a number of checks regarding offset 16 in CRE (ie. flags field in NI). Still working on mapping out all code branches and what checks what but these are clustered together.

00793D93  |.  81E2 00000001 AND EDX,1000000                          ;  general tracking
...
00793DBF  |.  25 00000002   AND EAX,2000000                          ;  race tracking
...
00793DEA  |.  81E1 00000004 AND ECX,4000000                          ;  class tracking
...
00793E16  |.  81E2 00000008 AND EDX,8000000                          ;  specifics tracking
...
00793E47  |.  81E1 00000010 AND ECX,10000000                         ;  gender tracking
...
00793E73  |.  81E2 00000020 AND EDX,20000000                         ;  alignment tracking
...
00793E9F  |.  25 00000040   AND EAX,40000000                         ;  uninterruptible

Do you know what the last one (uninterruptible) stands for?

Edited by scient, 23 January 2010 - 05:13 PM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#233 -Guest-

-Guest-
  • Guest

Posted 23 January 2010 - 05:51 PM

It influences script execution (whether the action queue can be modified or not); see SetInterrupt() code. It should only exist in memory (it never gets written out).

#234 scient

scient
  • Modder
  • 1010 posts

Posted 23 January 2010 - 08:18 PM

Well, I started to mark up code locations for all action script functions in my IDA db and noticed a few things. There are a number of script functions absent from vanilla PST ACTION.IDS yet in BG1's that are still hooked up code wise. It seems all you'd have to do is add these entries to PST's ACTION.IDS to be able to use them in scripts/etc. These may well be used by engine internally, I'm not sure why they were left out. I haven't finished going through marking up all action code locations but once I do I'll post a finalized list. But for now, here is example of few that are hooked up in engine but missing from PST IDS.

176 EscapeAreaDestroy(I:Delay*)
184 RunAwayFromNoInterrupt(O:Creature*,I:Time*)
180 MoveToObjectFollow(O:Object*)

Granted, I'm not sure how useful any of the missing are but why not include them if they're already hooked up?

On another note, I realize now that for banter tweak the way I'm disabling engine banter might not be best method. I'm basically setting Interact() action, which since it isn't hooked up in ACTION.IDS only used by engine, to NoAction(). Even though it seems to be seems to be working perfectly, I'm not sure if this is such a good idea. Will look into tracking down code location which actually triggers Interact() rather than killing action.

168 Interact(O:Object*)

@devSin or anyone who knows, in BG1 or other IE games what Interact() is used for? Like is it only used for banters and/or inter-party dialog?

Edited by scient, 23 January 2010 - 08:21 PM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#235 scient

scient
  • Modder
  • 1010 posts

Posted 23 January 2010 - 08:55 PM

To follow that up, I probably should of searched IESDP first.

168 Interact(O:Object*)
This action is used to initiate banter between NPCs. The example script is from edwin.bcs.


So I guess my original patch ok after all since it seems this script function is purely for banter.

Edited by scient, 23 January 2010 - 08:56 PM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#236 -Guest-

-Guest-
  • Guest

Posted 23 January 2010 - 09:14 PM

Yeah, Interact() fires off a banter for caller to target (the engine hardcodes this to fire a banter attached to a party member, basically sending Interact([PC]), after an internal timer expires). It's only really used for romances in normal IE because they just rely on the hardcoded banter timer for normal ones.

The banter dialogue/character map is in one of the 2DAs, and the party member headers in GAM files store an array of NumTimesInteracted() for each of the 24 BG/TotSC NPCs (has always been disabled, though; in NI, it's the run of unknowns between Happiness and the GUI slot masks).

Although, rather than breaking the banter handler, you could probably just demolish the banter map so the engine doesn't know of any banter dialogues to trigger and then continue your scripted banters.

#237 -wut-

-wut-
  • Guest

Posted 23 January 2010 - 09:15 PM

I guess my original patch ok after all since it seems this script function is purely for banter.


It should be fine. BG2 is the only one that uses this action in .bcs files; BG calls it in hardcode only, and the Icewind Dale games just have some legacy code (but don't have the 2das nor load them if present). It's never a synonym for StartDialog(ue)?().

#238 -devSin-

-devSin-
  • Guest

Posted 23 January 2010 - 09:25 PM

All the thugs in the Trash Warrens (TWTHUG1+) use the same dialogue as the Porphiron thug leader (looks like they got more than just his script name)? This seems... pretty ridiculous when you go to talk to the ones you can keep hostile (at the entrance, the stairs to the Buried Village, and three in the southwest corner). Locally, I switch them to DTHUGS1 (same as the BVTHUG CREs), in lieu of finding something better for them (I wish they had "This is dialogue for Trash Warrens thugs.DLG" to use)? :)

#239 Qwinn

Qwinn
  • Modder
  • 3092 posts

Posted 23 January 2010 - 10:27 PM

EscapeAreaRunning *rocks*. Seriously! There's sooo many dialogues where that is exactly what should be happening, but they're all full of strange and barely functional workarounds trying to emulate what this function does, or else they just walk slooowly away though the dialogue says they are running as fast as they can. Think the Hive pickpockets, some of the Hive Dweller, dialogues, etc. I'm sure I'll find several dozen by the time I'm done looking. Fun!

All the thugs in the Trash Warrens (TWTHUG1+) use the same dialogue as the Porphiron thug leader (looks like they got more than just his script name)? This seems... pretty ridiculous when you go to talk to the ones you can keep hostile (at the entrance, the stairs to the Buried Village, and three in the southwest corner). Locally, I switch them to DTHUGS1 (same as the BVTHUG CREs), in lieu of finding something better for them (I wish they had "This is dialogue for Trash Warrens thugs.DLG" to use)? :)


Dear Lord, I can't believe I never noticed this. Sigh.

I *believe* the dialogue files DTHUGB2 and DTHUGB3 are unused anywhere else in the game, and their hyper-hostility seems more suited to the area. I think I'll use/restore those instead.

Qwinn

Edited by Qwinn, 23 January 2010 - 11:30 PM.


#240 -Guest-

-Guest-
  • Guest

Posted 23 January 2010 - 10:44 PM

Yeah, the DTHUGS1 cracks me up, so I was a little happier about it ("But your mom doesn't charge. Why do you?" just bust my gut).