Jump to content


  • Content Count

  • Joined

  • Last visited

About Taimon

Profile Information

  • Gender
    Not Telling
  1. A player from the german community reported a bug related to a dialogue introduced by Alternatives. This is from dialogue.d: APPEND BODHI IF WEIGHT #-1 ~GlobalGT("B!Alternatives","GLOBAL",5)~ THEN BEGIN bodhi1 SAY @158 IF ~~ THEN DO ~EscapeArea()~ EXIT END IF WEIGHT #-1 ~GlobalGT("B!Tourist","GLOBAL",7)~ THEN BEGIN bodhi2 SAY @159 IF ~~ THEN DO ~EscapeArea()~ EXIT END END The problem here is that Bodhi might spawn again and again due to BodhiAppear not being set to 3 after the EscapeArea(). I guess this only happens if the player postpones the visit to the graveyard and accepts the other offers first.
  2. Well, I guess the .bat expects `java' in the PATH or uses JAVA_HOME or something and it's not set, so if you need to use the .bat startup file you should be able to fix it by setting the relevant environment variables.
  3. Is Java installed? Also, to see the error message, you could edit the .bat file and append pause on a new line at the end of it. (Or you could just start it from the Commandline Interpreter, but I guess this is easier for you.)
  4. It's very possible that I screwed this up somewhere; the component was more like a proof of concept for me anyway. Most people should be using ToBEx right now, so I guess there is no need to fix this, right?
  5. I made something for vim, but it's not up-to-date.
  6. Doesn't matter, let's just say when gametime is paused. And the AI update (round) I mentioned above is not to be confused with what most people refer to as script round. It calls the script processing routine, but only if the timers are right. (So it happens more often than the script round, and also when the game is paused.) If someone is really interested in these obscure details, I guess I can paint a bigger picture. They did? Can you give some examples?
  7. Scripts don't run while the game is paused, but one instant action per AI round is processed.
  8. Fuzzie, I'm not sure how GemRB currently handles instant actions, but reading your post again, I think I need to clear something up: Instant actions are, like any other action, added to the list (queue). But when processing the list, the game has different "modes". (Not really, but I hope I can make this clearer in the next paragraph.) If the game is unpaused and the creature is capable of doing actions (i.e. not dead, hold, etc.) it will fetch the next action from the list and do it. Afterwards it checks if the next action is an instant and also do it. (In the same AI round.) This repeats until the next action isn't an instant one or the list is empty. The instants loop is also aborted, when the current action indicates that it wants to stay on the list. (i.e. return value is >= 0) Even if the creature is dead, petrified, hold, etc. it will do that instant loop. There is something special for STATE_DEAD, I think it can discard a non-instant action after the loop is aborted. When the creature is in dialogue, no actions are run except if the stat from opcode 0x0C2 is set. But being in dialogue stops script processing, so I guess this is difficult to test. And remember, all of this only applies if the game is unpaused. Now, when the game is paused, the creature will do one action per AI round, but only if it is instant. Again there is some special code to discard the current action. It's done when bit 31 of the creature flags is not set and there is something else in the list. (Bit 31 is non-interruptable, the engine modifies this internally.) I hope this does not sound too confusing.
  9. Yes, either that or they should use timing 0. Who knows, maybe they consider it lucky to go berserk from time to time. In my opinion it shouldn't be a LuckyRoll at all, but since it's bugged I guess nobody cares.
  10. Small update for the berserk effects: Avenger already mentioned this, 0x003 only works on party members. 0x0F5 enables a 1% chance to go berserk while attacking (checked in attack roll). This sends an 0x0F6 (stage 1) to the creature, which will later turn to 0x0F7 (stage 2). (might overlap) Stage 1 has all the stats changes (hp/ac/thac0), while stage 2 sets the berserk state flag. Both durations are 45 ticks, but I think they messed up the timing (0x1000), so the effects won't be applied at all. On a side note, the berserk action (#124) does not use any berserk effects. It only works if the first integer parameter is > 1 and there is someone to attack nearby. (Will result either in an attack or wait action.)
  11. Yep, they are applied when updating the stats. Only to have [-(k/2), (k/2) -1] range instead of [0, k-1], i. e. to have a chance to increase or decrease initiative.
  12. Well, I'm certainly not good at explaining things, but here goes: The rndbase bitmaps describe the basic attack round. There are 5, each corresponds to the number of attacks (-5 if it's greater 5) the attacker has. They are indexed by attack initiative and a timer/counter (named it attack_rnd_timer) that increments each ai update. Initiative is calculated like this: ((item_ability.speed - cre.stats.phys_speed) [>= 0] + rand_mod(k, -cre.stats.luck) - (k/2)) [0,10] I think I already describe what rand_mod does (biased random number in range [0,k-1]) and k is hardcoded to 6. Rndbase values range from 0 to 15 (4bpp) and here is what I think each value means: 0: play ready sequence, if not already playing ready or attack or shoot, action is interruptable 1-5: noop, not used as far as I can tell, action is not interruptable 6: non-projectile only, play attack sequence, do attack sound, set last attacker, action is interruptable 7: play attack/shoot sequence if attack_enable (see 10-14) is set, action is not interruptable 8: action is not interruptable, (this does reset something that 7 set, but let's ignore it for now) 9: real attack happens here, nearly all of the code is protected by an attack_enable flag, action is not interruptable 10-14: do setup for 9, set/reset attack_enable and whether it's an offhand attack, play attack/shoot sequence, do attack sound if non-projectile, action is not interruptable 15: play ready sequence (if not playing ready or attack or shoot), reset timer, action is interruptable low-level pseudo-code for 10-14: if (num_attacks <= 5): if num_attacks >= (value - 9): attack_enable = 1 if (num_attacks == (value - 9)) and (num_attacks != 1): offhand_attack = 1 else: attack_enable = 0 offhand_attack = 0 else: if (num_attacks - 5) > (value - 9): attack_enable = 1 if (num_attacks - 6) == (value - 9) and (num_attacks - 5) != 2: offhand_attack = 1 else if (num_attacks - 5) == (value - 9): attack_enable = rand(1) offhand_attack = 0 else: attack_enable = 0 offhand_attack = 0 (Disclaimer: I might be wrong. ) pseudo code for the real attack (9): set last attacker, force visible, remove sanctuary if not projectile: play attack sequence, do attack roll if (attack succeeded): send hitby trigger, check protection from melee weapons if (target not immune): do damage roll, add damage effect to item ability, send melee effects (from cre.stats), dispatch item ability effects else: play shoot sequence, do attack roll and check prot. melee weapons if (attack succeeded) and (target not immune): do damage roll, add damage and other effects to projectile (item ability, launcher, ranged effects from cre.stats) else: clear projectile effects do attack sound, start projectile handle item charges/stackamount, do autopause if weapon became unusable send attackedby trigger and interrupt dialogue if attacker.allegiance <= GOODCUTOFF
  13. Yeah, it's mostly useless, but good to know you implemented it immediatly. By the way, I went through the attack action code, lately. If GemRB needs some specific info, let me know. (You guys know about rndbase bitmaps, right?)
  14. I can confirm nearly everything you've worked out. Replies are added via InsertResponse message, so they are wrapped with a SetInterrupt(FALSE/TRUE). Yep, the action list is cleared when the dialog starts. Action list is not cleared. Like you said, only if the speaker changes. Maybe I can add some info on how transitions are processed. This also involves the mysterious 0x20 transition flag. The engine processes the transitions in three steps: First it looks at all transitions that have the 0x20 flag, and shows them if the trigger is true. (I think it'll also play the associated sound if there is one.) Next, it'll iterate again over all transitions, evaluate the trigger and if the transition does not have the HAS_TEXT (0x01) and EXIT_DIALOG (0x08) flags, it'll "show" (no text) the transition and set some info for continuing to the next state. And now it gets weird. After each such transition, it "removes" any previously displayed transition, that does not have the 0x20 flag. If there were any matching transitions in step two stop here. Otherwise, go through the transitions again and do "normal" processing, i.e. check trigger, display text (play sound) and/or set the continuation info. Last transition with trigger evaluating to true wins. If that process did not produce any valid replies, display "no valid replies". I think it's mostly save to ignore the 0x20 flag. It looks a bit like telling the engine to "not touch that transition". It's also checked in a different place: After choosing a reply the engine removes the reply text (red color) and replaces it with the same text in a different color (light blue). If the flag is set the engine won't do the replace.
  • Create New...