jinger Posted December 15, 2005 Share Posted December 15, 2005 void SetLocalNumber( object oObject, int nIndex, int nValue ); what's nIndex? i mean how do i get to know an object's local variable index? are there shared (between all objects of the same type or created from the same template) and unshared locals?… i don't want to create user defined variables, i want to use existing variables such as "usable", "locked", so is there anywhere i can find the correspondence between locals and indexes? Link to comment Share on other sites More sharing options...
Tupac Amaru Posted December 17, 2005 Share Posted December 17, 2005 Each object has their own set of local numbers and booleans.They don't have names like globals, but are referenced by an index number. For example, SetLocalNumber(GetObjectByTag("Kreia"), 10, 5); would set Kreia's local number '10' to the value 5. Locals aren't shared between different objects. Be careful with local variables. Some may already be used by the game designers. Others are reserved for the AI or special cases. For example boolean #10 is used for the 'talked to' flag. You can find a better explanation of locals and which indexes should be used in this thread: http://www.lucasforums.com/showthread.php?s=&threadid=146888 Link to comment Share on other sites More sharing options...
stoffe Posted December 17, 2005 Share Posted December 17, 2005 The indexes for locals don't have any hardcoded meaning, they are simply identifiers for "slots" where values can be stored and retrieved on a single object instance. Thus there is no simple way to look up what they are used for. However, the game scripting uses a bunch of Locals in generic scripts that are used for most objects of a specific type in the game, thus giving those indexes a general meaning for that type of object. The available indexes are 0-159 for LocalBooleans and 0-31 for LocalNumbers. This list is by no means complete, it's just a few generic Locals that I can think of that are used by the majority of objects of a certain type. Individual objects often use Locals to track things related to their purpose, and I haven't felt compelled to go through the thousands of objects in the game to write down what Locals they use and for what purpose. (If you need to know what values a particular object uses, you'll have to inspect all the scripts in the module that object exists in and see if any variables are set on it.) Creatures: Boolean 1-3 - Creature AI, ambient NPC settings. Boolean 10 - Dialogs, used to set that the creature has been talked to once. Boolean 20-28 - Creature AI, used to activate userdefined script events. Boolean 29 - Creature AI, used to set if NPC should play ambient animations when idle. Boolean 30-64 - Reserved range for scenario/plot specific uses, some NPCs use them, most do not. Boolean 65 - Creature AI, used to set of the NPC should walk around randomly when idle. Boolean 66-86 - Creature AI, various settings set in the NPC spawn scripts. Boolean 87 - Creature AI, blocks out the AI for this creature if set. Boolean 88 - Creature AI defined, but likely unused in K2:TSL. Boolean 89 - Creature AI, sets the creature to use the Boss Combat AI, overriding their normal AI style. Boolean 90 - Creature AI, sets that the creature has activated their energy shield in combat. Boolean 91 - Creature AI, toggles userdefined event for the OnDialogEnd event handler. Boolean 92 - Creature AI, sets that a force using NPC has buffed with Resist/Immunity at start of battle. Boolean 94 - Creature AI, sets that the creature has entered combat. Boolean 95 - Creature AI, sets the creature to use the KotOR1 Malak end fight AI. Boolean 96 - Creature AI, sets creature to use a zone controller to determine their combat zone. Boolean 97 - Creature AI, setting for the OnDialog event. Boolean 98-109 - Creature AI, used by the waypoint walking/ambient animation system. Boolean 110-159 - Generally unused as far as I can tell. Number 0-2 - Creature AI, used by the waypoint walking/ambient animation system. Number 3-6 - Creature AI, internal state info for last attack used, chosen attack pattern etc. Number 7 - Creature AI, Zone Controller this creature is attached to, if any. Number 8-9 - Creature AI, settings for healer AI, how much to heal and how often. Number 10-11 - Creature AI, used for turrets to determine rate of fire. Number 12-31 - Generally unused as far as I can tell. Placeables: Boolean 10-19 - Security terminals, used to set the user's choice of action. Boolean 55 - Containers, container has been bashed and broken item substituted. Boolean 57 - Containers, used to set that random loot has been spawned. Triggers: Boolean 40 - Used to set that the trigger has been tripped for one-shot triggers. Link to comment Share on other sites More sharing options...
jinger Posted December 17, 2005 Author Share Posted December 17, 2005 ^__^ thanks for the useful infos, i hoped the object properties were a little more "public" but i'll be fine with that much, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.