Meaning of various object flags

Discussion in 'Mobile and Static Objects' started by Agetian, Feb 25, 2006.

Remove all ads!
  1. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    The following list includes descriptions for all known object flags. Note that a lot of the flags come directly from Arcanum and may be no longer used in the Temple of Elemental Evil. Others may have become obsolete during the earlier state of the game development, and be useless. If you have any updates to the information below, as in whether something works or doesn't work, as well as what certain flags mean, feel free to post in this thread. I'll try to keep this list up to date.

    The list below doesn't account for the fact whether the flag really works or not (at least most of the time), since I haven't tested them too deeply to really be able to tell. A good part of these flags may actually turn out to be Arcanum leftovers. If you have info that a certain flag works or doesn't work for sure, please respond in this thread.

    Object Flags (OF_*)
    FYI - this is stored in the not-so-aptly named obj_f_name -SA

    OF_DESTROYED - This object is completely ignored by the object system, considered to be destroyed.
    OF_OFF - This object still exists and can still be manipulated, but it's simply not displayed.
    OF_FLAT - ?
    OF_TEXT - This object has a text bubble associated with it. Arcanum leftover, most surely doesn't work in ToEE.
    OF_SEE_THROUGH - This object doesn't obstruct visibility.
    OF_SHOOT_THROUGH - It's possible to shoot through this object (doesn't obstruct shooting).
    OF_TRANSLUCENT - ?
    OF_SHRUNK - ?
    OF_DONTDRAW - This object is not drawn. Overlays and other elements for this object may still be shown.
    OF_INVISIBLE - Same as OF_DONTDRAW, but means that this object is simply invisible, so this flag will get overridden if someone detects invisibility.
    OF_NO_BLOCK - Doesn't obstruct movement.
    OF_CLICK_THROUGH - Doesn't respond to mouse clicking? (not sure)
    OF_INVENTORY - This object is an inventory item.
    OF_DYNAMIC - This object is dynamic and needs to be
    OF_PROVIDES_COVER - This object provides cover per D&D rules.
    OF_RANDOM_SIZE - obj_create will make this object of random scale. Possibly doesn't work (untested).
    OF_NOHEIGHT - ?
    OF_WADING - ?
    OF_LOOTED - This object (NPC or container) has been looted already and followers took their share.
    OF_STONED - The stone to flesh spell is on. (this by itself does not apply any status, not even in combat mode)
    OF_DONTLIGHT - This object will always be drawn at full brightness, ignoring all light effects.
    OF_TEXT_FLOATER - ?
    OF_INVULNERABLE - This object cannot take damage or be destroyed.
    OF_EXTINCT - ?
    OF_DISALLOW_WADING - ?
    OF_HEIGHT_SET - Either the game or the proto system has already calculated the height for this object (usually this means that the "height" property is already set and has a value).
    OF_ANIMATED_DEAD - ?
    OF_TELEPORTED - ?
    OF_RADIUS_SET - Either the game or the proto system has already calculated the radius for this object (usually this means that the "radius" property is already set and has a value).

    Item Flags (OIF_*)

    OIF_IDENTIFIED - The player has identified this object already
    OIF_WONT_SELL - The owning NPC won't sell this item
    OIF_IS_MAGICAL - Used internally to mark objects with charges (part of a tracking system that tracks item that run out of charges)
    OIF_NO_PICKPOCKET - This item can't be pickpocketed.
    OIF_NO_DISPLAY - This item is not displayed in the inventory screen.
    OIF_NO_DROP - This item cannot be dropped.
    OIF_NEEDS_SPELL - This item needs you to have its spell on your spell list in order to activate.
    OIF_CAN_USE_BOX - This item can be dropped in the use box in the inventory UI. Internal?..
    OIF_NEEDS_TARGET - This item needs a target when used
    OIF_LIGHT_SMALL - This item gives off a little light when wielded. Arcanum leftover?..
    OIF_LIGHT_MEDIUM - This item gives off medium light when wielded. Arcanum leftover?..
    OIF_LIGHT_LARGE - This item gives off lots of light when wielded. Arcanum leftover?..
    OIF_LIGHT_XLARGE - This item gives off TONS of bright light when wielded. Arcanum leftover?..
    OIF_PERSISTENT - This item is not destroyed during inventory respawning.
    OIF_MT_TRIGGERED - ? Probably somehow magic/tech related, a definite Arcanum leftover.
    OIF_STOLEN - This item is stolen and will not be bought by a shopkeeper unless he is a fence.
    OIF_USE_IS_THROW - This item is thrown when used.
    OIF_NO_DECAY - This item will never decay (disappear) if left somewhere.
    OIF_UBER - This item can damage critters marked as OCF2_NIGH_INVULNERABLE. Was used in Arcanum. Possibly a leftover.
    OIF_NO_NPC_PICKUP - NPCs will not pick up this item off the ground. Was used in Arcanum.
    OIF_NO_RANGED_USE - This item must be used directly on the target, not from a range.
    OIF_VALID_AI_ACTION - ?
    OIF_DRAW_WHEN_PARENTED - ?
    OIF_EXPIRES_AFTER_USE - This item expends charges, and when empty destroys itself.
    OIF_NO_LOOT - This item cannot be looted (different from NO_DROP!)
    OIF_USES_WAND_ANIM - This item, when casting a spell, uses the wand animations.
    OIF_NO_TRANSFER - This item cannot be moved between party members (follower's items)
    OIF_FAMILIAR - This item cannot be moved between party members (familiars)

    Critter Flags (OCF_*)

    OCF_IS_CONCEALED - The critter is initially concealed (e.g. used for spider in the Tower)
    OCF_MOVING_SILENTLY - Is using the move silently skill
    OCF_EXPERIENCE_AWARDED - Experience has already awarded for this monster
    OCF_FLEEING - The critter is fleeing. Arcanum leftover?..
    OCF_STUNNED - The critter is stunned.
    OCF_PARALYZED - Paralyzed.
    OCF_BLINDED - Temporarily blinded.
    OCF_HAS_ARCANE_ABILITY - Used for Feeblemind to check if the critter has arcane like abilities.
    OCF_SLEEPING - Is sleeping in a bed.
    OCF_MUTE - Unable to talk (won't float messages or engage in dialog).
    OCF_SURRENDERED - Critter has surrendered after fleeing (Arcanum leftover?..)
    OCF_MONSTER - Critter is a "monster" (doesn't correspond to a defined race or a non-monster animal)
    OCF_SPELL_FLEE - Critter has used a spell to flee.
    OCF_ENCOUNTER - Critter is an "encounter" critter, which disappear when they stop getting heartbeats
    OCF_COMBAT_MODE_ACTIVE - Critter is in combat mode.
    OCF_LIGHT_SMALL - Critter is wielding a small light. Arcanum leftover?..
    OCF_LIGHT_MEDIUM - Critter is wielding a medium light. Arcanum leftover?..
    OCF_LIGHT_LARGE - Critter is wielding a large light. Arcanum leftover?..
    OCF_LIGHT_XLARGE - Critter is wielding an extra large light. Arcanum leftover?..
    OCF_UNREVIVIFIABLE - This critter cannot be brought back to life or reanimated.
    OCF_UNRESSURRECTABLE - This critter cannot be brought back to life.
    OCF_NO_FLEE - This critter will never flee.
    OCF_NON_LETHAL_COMBAT - This critter will stop fighting a critter when it goes unconscious.
    OCF_MECHANICAL - A critter that is of mechanical (technological) type - was used in Arcanum, most sure not used anymore.
    OCF_HAS_MET - Critter has met the party before.

    Critter Flags 2 (OCF2_*)

    OCF2_ITEM_STOLEN - This critter has been pickpocketed.
    OCF2_AUTO_ANIMATES - This critter always animates when standing.
    OCF2_USING_BOOMERANG - This critter is currently using a boomerang weapon. Arcanum?..
    OCF2_FATIGUE_DRAINING - ?
    OCF2_SLOW_PARTY - ?
    OCF2_NO_DECAY - This critter will never decay to nothing.
    OCF2_NO_PICKPOCKET - This critter cannot be pickpocketed.
    OCF2_NO_BLOOD_SPLOTCHES - This critter doesn't display default blood splotches when hit.
    OCF2_NIGH_INVULNERABLE - The critter can only be hurt by items marked as OIF_UBER.
    OCF2_ELEMENTAL - This critter is a natural elemental.
    OCF2_DARK_SIGHT - This critter has dark vision.
    OCF2_NO_SLIP - This critter doesn't slip on slippery (ice) tiles. Most certainly an Arcanum leftover.
    OCF2_NO_DISINTEGRATE - This critter always saves vs. disintegration
    OCF2_TARGET_LOCK - This critter is locked onto his combat target until instructed otherwise.
    OCF2_ACTION*_PAUSED - ?

    NPC Flags (ONF_*)

    ONF_EX_FOLLOWER - NPC was a follower and has now left the party. Internal?
    ONF_WAYPOINTS_DAY - NPC will walk its waypoints during the day.
    ONF_WAYPOINTS_NIGHT - NPC will walk its waypoints during the night.
    ONF_AI_WAIT_HERE - Internal, don't use directly. NPC is being told to wait at a location.
    ONF_AI_SPREAD_OUT - Internal, don't use directly. NPC is being told to increase his follow radius.
    ONF_JILTED - NPC waited too long and went home or left the party on his own accord based on PC actions. Internal.
    ONF_LOGBOOK_IGNORES - NPC will be ignored by logbook functions when building ego pages.
    ONF_KOS - NPC will kill on sight.
    ONF_USE_ALERTPOINTS - NPC will only go to night standpoint on 'alert' (when global flag 144 is set).
    ONF_FORCED_FOLLOWER - NPC was forced to follow his current leader.
    ONF_KOS_OVERRIDE - NPC will *NOT* kill on sight.
    ONF_WANDERS - NPC wanders. Doesn't work. Arcanum leftover.
    ONF_WANDERS_IN_DARK - NPC wanders in dark. Doesn't work. Arcanum leftover.
    ONF_FENCE - This NPC is a fence shopkeeper and will buy stolen goods marked as OIF_STOLEN.
    ONF_FAMILIAR - This NPC is a familiar.
    ONF_CHECK_LEADER - NPC needs to check his leader for faults, possibly internal.
    ONF_NO_EQUIP - This NPC will not equip items.
    ONF_CAST_HIGHEST - This NPC will only cast highest known spells in each Arcanum spell college. Probably won't work for ToEE.
    ONF_GENERATOR - NPC is a generator of NPCs (usually monsters)
    ONF_GENERATED - NPC was generated from a generator.
    ONF_GENERATOR_RATE1 - Internal rate flag for generator NPCs.
    ONF_GENERATOR_RATE2 - Internal rate flag for generator NPCs.
    ONF_GENERATOR_RATE3 - Internal rate flag for generator NPCs.
    ONF_DEMAINTAIN_SPELLS - NPC will turn off maintained spells when leader dies or exits combat mode.
    ONF_BACKING_OFF - NPC wants to back away from his combat. Internal?
    ONF_NO_ATTACK - NPC is not allowed to fight.
    ONF_BOSS_MONSTER - NPC is a boss monster. Arcanum leftover?
    ONF_EXTRAPLANAR - NPC is extraplanar.
     
    Last edited by a moderator: Feb 21, 2015
  2. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    If I may... (this can be deleted as necessary: I have already deleted a few of these)

    BOSS_MONSTER is used in protos.tab for Hedrack and the Node Guardians (at least). The Boss_Monster reaction voice does not work that I know of. So it IS used but whether it does anything is unknown to me. (Still untested by me).

    Can I suggest that these be marked as 'verified' (or something) as they are proven to work?

    DRAW_WHEN_PARENTED is a curious one: it appears on shields, and if it is not ticked, the shields simply stay where they are when they appear on the map. That is, if a PC appears on a new map with a shield laking this flag equipped, then he runs off, but the shield stays where it is first drawn; it rotates to match the PCs model and still gives the shield bonus, but it doesn't move with the PCs model. Weird to watch.

    Now, combat flags: these are not attached to any specific function and can only really be read from a script off the trap.attack( PyObjHandle target, BAB, critical range, ranged attack) command, but are generated by every attack.

    D20CAF_HIT - the attack hit
    D20CAF_CRITICAL - the attack was a critical
    D20CAF_RANGED - the attack was ranged
    D20CAF_ACTIONFRAME_PROCESSED - already applied the damage etc.
    D20CAF_NEED_PROJECTILE_HIT - waiting for the projectile to hit before the action is done
    D20CAF_NEED_ANIM_COMPLETED - waiting for an animation to be completed.
    D20CAF_ATTACK_OF_OPPORTUNITY - this attack is an AOO
    D20CAF_CONCEALMENT_MISS - this attack missed because of concealment
    D20CAF_TOUCH_ATTACK - touch attack (don't apply target armor)
    D20CAF_FREE_ACTION - don't pay the usual action cost; for example, a touch attack when part of a spell
    D20CAF_CHARGE - part of charge action
    D20CAF_REROLL - second roll due to Good Fortune luck domain ability
    D20CAF_REROLL_CRITICAL - second roll to confirm critical
    D20CAF_TRAP - if attack is from a trap
    D20CAF_INVALID - attack is not valid (bad path?)
    D20CAF_NO_PRECISION_DAMAGE - attack is not eligable for precision based damage (sneak attack)
    D20CAF_FLANKED - target flanked
    D20CAF_DEFLECT_ARROWS - target used deflect arrows
    D20CAF_FULL_ATTACK - attack is part of a full attack
    D20CAF_AOO_MOVEMENT - this is an aoo due to movement
    D20CAF_BONUS_ATTACK - this is a bonus attack
    D20CAF_THROWN - this is a thrown weapon
    D20CAF_SAVE_SUCCESSFUL - damage is being done in spite of a successful save
    D20CAF_SECONDARY_WEAPON - use ITEM_WIELDED_SECONDARY instead of item_wielded_primary
    D20CAF_MANYSHOT - this attack benefits from the MANYSHOT feat
    D20CAF_ALWAYS_HIT - this attack can't miss (Fragarach)
    D20CAF_COVER - this attack is subject to cover
    D20CAF_COUNTERSPELLED - this action has been counterspelled
    D20CAF_THROWN_GRENADE - this is a thrown "grenade" weapon
    D20CAF_FINAL_ATTACK_ROLL - this flag is set on attack_data when the actual attack roll is being made (not any pre-calculations)
    D20CAF_TRUNCATED - this move action was truncated
    D20CAF_UNNECESSARY - this action can fail if a path cannot be generated in a reasonable amount of time
    D20CAF_MAX - last flag

    Now... OCF2 flags (Critter 2 Flags):

    These flags have been described above by Agetian. However a careful check of the .dll and accompanying docs (particularly string dumps and such) indicates there appears to be no actual Python syntax to manipulate them! Moreover, my attempts to set the flags in the protos.tab broke it and stopped the game from starting at the infamous 'clearing protos.tab' point.

    Another Arcanum leftover? Perhaps, but the flag bank is still there on mobs, the flags can still be set using World Builder, and some of them work! Certainly NO_DECAY does.

    So, how do we read and change them in-game? Manually! Here is an example from the new Gentle Repose spell:
    Code:
    x = target.obj.obj_get_int(obj_f_critter_flags2)
    x = x | 64
    target.obj.obj_set_int(obj_f_critter_flags2, x)
    The critter 2 flags bank is read directly off the object, the relevant flag (7th on the list in ToEEWB) is ORed (2^7 = 64) on the bank, and its put back. Existing flags can be read with AND.
     
    Last edited: Sep 17, 2009
  3. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Yup, but a lot of old stuff can be seen in protos.tab - like OCF_WATER, which was a real flag in Arcanum but became outdated and was changed to unused in ToEE. So, we need a definite proof whether it does/doesn't do anything.

    Sure, that was my plan too. And you can modify my post and add the 'verified' qualifier as well (at least I think you can - you're a moderator here, so you're supposed to be able to do that :) )
     
    Last edited: Feb 25, 2006
  4. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Perhaps a few words here or somewhere on how to change flags (set and unset) and how to read their status in a script?
     
  5. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Yup, would do good too. Maybe you can add that info to Whatddya know?

    P.S. All these discussion-like thread elements are to be removed later once the details of this thread are clarified.

    - Agetian
     
  6. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    When the OF_OFF flag is set the object in question will still run scripts, and be manipulated by it's own scripts, but cannot be manipulated by other scripts unless you already have a handle for it. It cannot be "found" by other scripts.
     
  7. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Lemme just verify this is accurate, I stupidly set it on something the other day and wondered why I couldn't click on it. Quick flag change and it was fixed.
     
  8. Jesse Heinig

    Jesse Heinig Established Member

    Joined:
    Jun 26, 2005
    Messages:
    126
    Likes Received:
    0
    Does anyone have a list of the object spell flags (OSF_)?

    EDIT: My bad, they're part of Darmagon's inclusions to the Co8 script import package.
     
    Last edited: Aug 29, 2006
  9. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    Those were created by Darmagon and are stored in the obj_f_secret_door_dc field. They are not part of the original game, and only Darmagon's spells use them.
     
  10. Jesse Heinig

    Jesse Heinig Established Member

    Joined:
    Jun 26, 2005
    Messages:
    126
    Likes Received:
    0
    I'm going to use 'em for part of the Warp Wood improved functionality. I figure I can use OSF_IS_SUMMONED on items (instead of critters) as the flag to tell if an item has been warped by the Warp Wood spell. That way I can switch an item back, because the spell explicitly allows you to unwarp objects. In this fashion, you could warp wood on an enemy's weapon, then unwarp it after you kill him and take it (in case it's, say, a masterwork longspear that you want, or something).

     
  11. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Updated to include combat flags (post 2). Also, I had a bit of a look through the first post - 2 1/2 years later and having used a lot of this info in KotB - and I can't see any glaring errors or bits that need to be verified. Can other modders just have a quick look through? I also think people will get some ideas when they see some of the descriptions :)
     
  12. Stohrm Knightforger

    Stohrm Knightforger Dwarven Cleric

    Joined:
    Dec 8, 2008
    Messages:
    50
    Likes Received:
    0
    Globals

    ST,

    Can you point me in the right direction for finding the breakdown of what all the numbers equate to for each of the game.quests and the game.global_flags. I have yet to run accross such a listing (and trust me I have been looking, just probably not in the right place).

    SK
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Has anyone had any luck with making scenery objects obstruct line of sight/spellcasting by altering object flags? I haven't.

    Closest I've got is using OF_CLICK_THROUGH to make the object obstruct movement (i.e. to take up space). It doesn't prevent players from shooting or seeing through it, however. No luck with OF_PROVIDES_COVER, OF_NO_BLOCK, OF_SEE_THROUGH and OF_SHOOT_THROUGH yet. It should be stated that I'm trying to alter spawned via script objects - haven't tested for MOB files yet. Is that the issue?

    Also, doors seem to block visibility regardless of those flags, too (spawned or not).
     
    Last edited: Aug 28, 2009
  14. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    I had bad experiences putting OF_s on scenery objects (ended up with trees that you clicked on when you tried to run behind them), so I never do.

    EDIT: Won't messy up the other thread, but loved the flags in the console thing :thumbsup:
     
  15. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Ok, so if I'm getting this right, the seemingly LOS-related OF_ flags don't affect LOS at all (OF_NO_BLOCK, OF_SHOOT_THROUGH, OF_SEE_THROUGH...) and are probably Arcanum leftovers.

    Thus, the only way to affect LOS is through sector visibility (SVB), which can't be modified ingame (at least in realtime, i.e. without complicated file manipulation via script).

    The doors (portal objects) do seem to affect visibility - perhaps I'll be able to make use of them. I'm trying to make toggleable barricades, so wish me luck...
     
Our Host!