//////////////////////////////////////////////////////////////////////////////// // // Olander's AI // oai_readme // by Don Anderson // dandersonru@msn.com // // Fixes and HooRah for reporting and solutions /* Credits: Fallen for the Original AI Bench Test that gave me the ideas for a High Performance AI. There is not much left but kudos anyhow chief! Bioware for the Excellent HoTU Functions....nice indeed!! Cenotaph (Legacy AI) for the Geletanous Cube Engulf Stuff (Sorry about leaving you out before!!) Ulias for the Troll Base Scripts Psycho (my new OAI partner) for some excellent adds and modifications!! */ // //////////////////////////////////////////////////////////////////////////////// /* Fixes and Adds: 28-FEB-2006 1) Added a bunch of Tweaks 2) Psycho rewrote the whole weapons stuff...now works with ALL weapons. 3) Integrated Barmaids, Bartender, Cooks, Guards, and Strippers 4) Moved OAI Info into Readme 5) Removed Bad Death Corpse Code 6) Torch Definitions Removed for MANY different Torches 7) Added Ability Randomizer (Original by Lord Rosenkrantz) 8) Added custom Henchman Headers to process through OAI Custom stuff then on to Bioware Talents. I recommend 69MEH69 Henchman as it is the best and very easy to add the OAI to. 19-DEC-2005 1) Added OAI Critical On/Off line....forgot this in Olander's AI (Thanks to Darwinscusp). 2) OAI_Crits fixed. (Thanks to Psycho for accurate reporting on this). Thanks to Psycho for the Additional Coding for the Calcs!! Better than what I had!! 3) Minor misc. Fixes. 4) Added Default Spawn Overrides (Some thanks to Psycho for this....different method though). 5) Rewrote oai_proc_dead. */ /******************************************************************************/ // :: Allies and Axis (Faction Non-Targetting for Determining Enemies) /* How does this work? Well....there will always be Allies and Axis in a battle. The Factioning system does not work well when it comes to determining enemies during combat. Any spells that blast friendlies will make them hostile with no way to quickly and reliably reset the factions again. So what we needed for ALL factions is to be able to determine TRUE enemies EVEN if they get blasted by an OOPS or purposed Spell. The Classic Good Vs. Evil will be implied here. There is ALSO a setup for a Faction that will be NON Anything.....but will still be Hostile to the Faction Hostile. Basically they HATE everyone....BUT through some event COULD become and Ally or Axis power....these are Called Independent here. Each and every Faction must have a Faction Representative. This could be a Creature or placeable....I prefer placeables as they can't fight but can still be part of a faction. These will have Tags Set as Below....with Names as the Names of their Factions.....for example: We designate the Placeable with the Name => Spider and the Tag as FACTION_015. This would be the 15th Custom Faction you have. The Standard Factions are SET at above 1000 and are checked 1st. 1000 is a special Faction for Pack Animals and other special creatures you SHOULD set to Neutral (for AOE spells and other stuff) but this AI will not target them....Players can though. The Final Piece of Data you must do is set the ALLIANCE string on the Faction Rep. Simply add the ALLIANCE string with the Value of what they are....NEUTRAL, HOSTILE, ALLY, AXIS, INDEPENDENT. NEUTRAL is default if nothing is set. 999 Custom Combat Factions can be used with this AI.....built in and easy to configure. So....Neutral REMAIN neutral during combat....they will not take sides and thus will stand around and watch. Allies will be considered "GOOD" and Axis will be considered "EVIL". Also note the Hostile will be considered "HOSTILE" to both Allies and Axis. These strings are set on each Player, Henchman, and NPC that spawns or logs in. Please make sure that each Faction Rep is sequential in Tag and that each Combat Alliance is sequential (see below). /******************************************************************************/ /******************************************************************************/ //:: FACTION REPS - INFORMATION AND EXAMPLES /* In the __OAI_FactionReps area you will find all the Faction Representatives. These are placeables that have Factions and Names assigned to them so that when the NPC makes checks it will know who is friend from foe. There are 6 Special Factions that are for OAI and Special Systems and then there are 3 Custom Factions for Players and NPCs to Align to. So how do these set up and how do you add more? The Process is very simple...and I mean simple. INFO: If this stuff is not set on each of the Custom Faction Reps then the AI will make some bad choices or just simply stand there. =O PreStep: Edit your Faction List and add all your Factions and set up how you wish the relationships should be. Not hard to figure out...but needs to be played with to get comfortable with it. Step 1 (New Faction Rep): Copy the last in line of the existing Faction Reps....in the case of the OAI Demo it will be Neutral (FACTION_003). Step 2: Edit the Properties of this new Faction Rep and change the Name Field to what you made in the Faction List....ie Militia. Step 3: Now set the Faction drop down box to => Militia (If you do not see Militia then go back to Prestep and edit your Factions again) Step 4: Now edit the Variables of this Faction Rep and set the following => ALLIANCE string NEUTRAL HOSTILE ALLY AXIS INDEPENDENT Done! Now simply set the Faction of each Custom NPC to your chosen faction (most default NPCs are Hostile Faction) and then when they spawn they will be set automatically. NOTES: About INDEPENDENTS: At first glance you will think that these are the same as NEUTRAL. They are not though. NEUTRAL will NEVER be targetted by the AI whereas INDEPENDENT can be once they have initiated combat. Think of Independents as a group who can choose sides in a war. Once they choose sides or NOT choose sides will determine how they will be viewed. Default/Special Factions - Automatically Set to the Following Special = "FACTION_1000"; Set to NEUTRAL in WhoAmI() Commoner = "FACTION_1001"; Set to NEUTRAL in WhoAmI() Merchant = "FACTION_1002"; Set to NEUTRAL in WhoAmI() Defender = "FACTION_1003"; Set to NEUTRAL in WhoAmI() Hostile = "FACTION_1004"; Set to HOSTILE in WhoAmI() */ /* //From The World of Anvarath by Olander Allied Powers - Remember...Name Field of Each Faction Rep ALLY "Alvaern" "Buskerud" "Hedmark" "Khazad" "Nordane" "Opplane" "Shire" "Trond" "Vordane" "Defender" Axis Powers - AXIS "Morcar" "Orc" "Umbar" Independents - INDEPENDANT "Dragon" "Woads" */ /******************************************************************************/ //:: AUTOMATIC TAVERN FOLKS /* Now in the OAI you can have some NPCs do professional things. All automatically. Supported Professions: Bartenders (Actually a Function through the Barmaid) Barmaids Cooks Tavern Chatter Strippers Guards Guards: Want Town Guards to Check for Weapons equipped and tell you to put them away? David Coralles had a very nice script but was not very flexible on how to add to any AI. Now this script has been added to the OAI to be very automatic. To Setup: 1) Decide an NPC you will be assigning Guard Duties. 2) Edit the Varibles of this NPC OAI_GUARD int 1 3) Now save this NPC and when they spawn they will do their Guard Duties while doing their normal activities. TAVERN STUFF: NOTE: The following require the Waypoint NW_TAVERN to be present in the area for these to function. Strippers (Original By Aiden and Spectre) : NOTE: This is an Ambient Effect and not a Direct Strip Show for Gold!! To Setup: 1) Make your Stripper. 2) Edit the variables OAI_STRIPPER int 1 3) Now make 5 Pieces of clothing with Tags and ResRefs as follows. And place them in the Stripper's Inventory. strip05 (Equip this one...the starting Clothing) strip04 (now take pieces off...basically make them change) strip03 strip02 strip01 (This is the Nude or Almost Nude segment.) Done! The Stripper will continually do a strip show. Again, this is an ambient effect. So no gold will be taken from players etc. Barmaids: Want a Barmaid that does his/her job well and make it automatic for builders? You bet you do. This is ridiculously simple to set up. To Setup: 1) Make your Barmaid/Waitress/Waiter 2) Give it the Tag => Barmaid 3) Place a Waypoint near the Bar with this tag => WP_BAR 4) Place a Waypoint where the Barmaid should relax a bit with this tag => WP_REST Done! See I told you it was simple =) Bartenders: Part of the Barmaid Actually but is needed to compliment the Barmaid. To Setup: 1) Make your Bartender 2) Give it this tag => BARTENDER Done! Cooks (Original By Remi Ennd): This Cook will look busy and do many various things for a nice atmosphere. A little more setup though. To Setup: 1) Make your Cook 2) Give the Cook the tag => InnCook Waypoints 1) INN_KitchenItems1 2) INN_KitchenItems2 3) INN_KitchenItems3 4) INN_KitchenOven 5) INN_KitchenPickup 6) INN_KitchenPrepTable Placeable 1) Chair (INN_KitchenChair) NPC 1) Bartender (BARTENDER) Done!! The Cook will wander the kitchen doing various tasks until the INN_Cook_Job varaible is set then she will start that task. In the example you could have the Bartender's conversation script ask what the player wants to eat. For Scripters: object oInnCook = GetNearestObjectByTag("InnCook"); SetLocalInt(oInnCook,"INN_Cook_Job",3); SetLocalString(oInnCook,"INN_Cook_Job_Name","Blue Plate Special"); on the next Heartbeat s/he starts making it. */ void main(){}