devSin Posted May 20, 2006 Share Posted May 20, 2006 Actions: 102/103/104/221/222 - Morale actions don't appear to do anything. It's been a long time so I'd double-check, but I'm pretty sure they're broken. 112 UseContainer() - tested, non-functional. I even tried inventory containers (bag of holding); no effect. 130 RandomTurn() - this could be clarified that it cause the NPC to Face() random directions. Can be useful if you don't want RandomWalk(), but the updated ready animations in BG2 make PC avatars using RandomTurn() look a little crazy paranoid. 137 StartDialogue() - should be tested further, but it appears to actually set the dialogue as well (for at least the current session). ActionOverride("Imoen",StartDialogue("whatever",Player1)) will cause interjections to IMOENJ (which should work) to fail. 152 ChangeAIType() - amazing, worthless, dangerous. This appears to cat all the Change*() actions into one action. If you pass a script name (or other quoted string), nothing will happen. If you pass a compound object, it will completely set all object parameters (e.g., ChangeAIType([184.108.40.206.5.6.7]) will set the expected fields to the expected value, permanently). All oIDs are required (if you leave any off, they will be set to 0; on a PC, you can then expect errors in CRuleTables.cpp). If you pass a symbolic object, it will clear all identifiers, and fill out the 5 fields below (labeled "Functional spec. n" in NI). So, ChangeAIType(NearestEnemyOf(LastSeenBy(LastTalkedToBy(LastTrigger())))) would zero allegiance, general, race, class, specific, gender, and alignment, set spec 1 to "Myself" (the Object.ids value, 1), 2 to LastTrigger, 3 to LastTalkedToBy, 4 to LastSeenBy, and 5 to NearestEnemyOf. I have no idea how this could ever be useful? Something I want add: The triggers used in the game do not ever exceed 31. So I believe that is the limit for them. Triggers are the conditons that determine if the script actions occur, like InParty() or HPPercentLT.Say what? Where did this come from? 191 SpellNoDec() - It does not require a spell to be known or memorized, and allows for casting failure. It's basically ForceSpell(), without the cheese. 219 ChangeAnimationNoEffect() - I'm pretty close to positive that the desc is incorrect. The only difference from ChangeAnimation() is that the normal lighting effects used when swapping the CREs aren't played (this still completely replaces the calling CRE). 316 SoundActivate() - I'm not sure why this is marked N/T. It just sets bit 0 for the specified ambient sound struct (by name) to on (1) or off (0). 324 SetBeenInPartyFlags() - Despite the plural, this just sets the Been in party flag for the specified object. I suspect the game uses this to determine whether an NPC should be dynamically chosen (from the NPC level 2DAs) or if the attached CRE should be used. Aerie uses this because her CREs have her look like an ogre with no portrait; without this, the game would probably try to use the 2DA and you'd get no-portrait-Aeogrie. 330 AddAreaType() - It might be worth mentioning that this value is ORd. 9 would set both bit 0 and bit 3. Triggers: AttackedBy() - It should be noted that this trigger doesn't set LastAttackerOf. AttackedBy() returns true for offensive attacks (physical, anything with damage opcode, or spells marked hostile), but only physical attacks set LastAttackerOf. Spell attacks (whether the damage opcode or the flag) will never set LastAttackerOf. Hence, the following isn't always valid. IF AttackedBy(,0) THEN RESPONSE #100 AttackOneRound(LastAttakerOf()) // either last physical attacker or null if hit by spell END This trigger does set LastTrigger, so substituting LastTrigger() for LastAttackerOf() in the above should always do what you expect. BreakingPoint() - This has nothing to do with morale. Like the soundset, this only tracks happiness. Cleverly, this trigger will only return true when the happiness is checked (you know it's true when the PC runs their breaking point sound). It is false at all other times, even if the happiness is UNHAPPY_BREAKING_POINT (it looks like it's checked fairly often, so it'll eventually return true if happiness is that low). There is no easy way to script for morale failure. I used a combination of MoraleLT(Myself,MoraleBreakDefaultValue + 1) and CheckStatGT(Myself,MoraleBreakDefaultValue - 1,MORALEBREAK) to hopefully do something useful once during the game. Unlike magic panic, however, morale failure completely blocks a creature's script. NumCreatureVsParty*() - These triggers don't work. They return true sometimes, but definitely not in any sensible fashion, and it doesn't appear to have anything to do with the number of creatures of type that are around. AreaType() - This trigger is ORd. Assuming knowledge of the logic used, multiple calls can be combined (just like StateCheck()). I was hoping that NotStateCheck() would be a way of combining ANDd values, but it's identical to !StateCheck. I guess Mr. D was too busy with the phoenix warriors. HaveSpellParty() - works fine. HaveSpellPartyRES() does not work. Sucks. Link to comment
This topic is now archived and is closed to further replies.