From: <roa...@us...> - 2011-08-11 12:56:04
|
Revision: 7593 http://planeshift.svn.sourceforge.net/planeshift/?rev=7593&view=rev Author: roanduku Date: 2011-08-11 12:55:57 +0000 (Thu, 11 Aug 2011) Log Message: ----------- *Added new type of requirement: 'memory'. *Managed to get the tribe working on the recipe system with basic activities. *Fixed 'Breed' behavior in npcbehave.xml. *Fixed various small bugs. Modified Paths: -------------- soc/2011/tribe/data/emotes.xml soc/2011/tribe/data/npcbehave.xml soc/2011/tribe/src/common/net/npcmessages.h soc/2011/tribe/src/npcclient/npc.cpp soc/2011/tribe/src/npcclient/npcclient.cpp soc/2011/tribe/src/npcclient/npcclient.h soc/2011/tribe/src/npcclient/npcoperations.cpp soc/2011/tribe/src/npcclient/recipe.cpp soc/2011/tribe/src/npcclient/recipe.h soc/2011/tribe/src/npcclient/tribe.cpp soc/2011/tribe/src/npcclient/tribe.h soc/2011/tribe/src/server/database/mysql/tribe_recipes.sql Modified: soc/2011/tribe/data/emotes.xml =================================================================== --- soc/2011/tribe/data/emotes.xml 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/data/emotes.xml 2011-08-11 12:55:57 UTC (rev 7593) @@ -1,5 +1,7 @@ <emotes> <emote command="/greet" general="%s greets everyone." specific="%s greets %s" anim="greet" enabled="0" /> +<emote command="/flee" general="%s flees in panic." specific="%s flees from %s" anim="run" enabled="0" /> +<emote command="/divide" general="%s starts his cell division." specific="%s can't cell-divide together with anyone." anim="idle" enabled="0" /> </emotes> Modified: soc/2011/tribe/data/npcbehave.xml =================================================================== --- soc/2011/tribe/data/npcbehave.xml 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/data/npcbehave.xml 2011-08-11 12:55:57 UTC (rev 7593) @@ -392,20 +392,26 @@ <behavior name="do nothing" initial="80" resume="yes"> <wait anim="stand" duration="100" /> </behavior> - <behavior name="peace_meet" completion_decay="100"> - <locate obj="target" /> - <emote cmd="/bow" /> + <behavior name="peace_meet" completion_decay="500"> + <locate obj="perception" /> + <rotate type="locatedest" anim="walk" ang_vel="120" /> + <emote cmd="/greet" /> </behavior> - <behavior name="aggressive_meet" completion_decay="150"> - <locate obj="target" /> + <behavior name="aggressive_meet" decay="10" completion_decay="150"> + <locate obj="perception" /> + <rotate type="locatedest" anim="walk" ang_vel="120" /> <melee seek_range="20" melee_range="3" /> </behavior> <behavior name="coward_attacked" decay="10"> - <emote cmd="/me flees in panic." /> + <emote cmd="/flee" /> + <locate obj="waypoint" static="no" /> + <navigate anim="walk" /> + <locate obj="waypoint" static="no" random="yes" range="100" /> <wander anim="walk" /> </behavior> <behavior name="normal_attacked" decay="10"> - <locate obj="target" /> + <locate obj="target" range="20" /> + <rotate type="locatedest" anim="walk" ang_vel="120" /> <melee seek_range="20" melee_range="3" /> </behavior> <behavior name="united_attacked" decay="10"> @@ -418,7 +424,7 @@ </behavior> <behavior name="GoToWork" loop="yes" resume="yes" resume="yes"> <locate obj="tribe:memory:activeLocation" /> - <moveto coords="tribe:memory:activeLocation" anim="walk" /> + <navigate anim="walk" /> <wander anim="walk" /> </behavior> <behavior name="Explore" completion_decay="100" resume="yes"> @@ -443,15 +449,22 @@ <share_memories /> </behavior> <behavior name="GoToSleep" resume="yes"> + <locate obj="waypoint" static="no" /> + <navigate anim="walk" /> <locate obj="tribe:home" /> <navigate anim="walk" /> <wait anim="sit" duration="180" /> </behavior> - <behavior name="Breed" completion_decay="100"> + <behavior name="Breed" resume="yes" completion_decay="100"> + <locate obj="waypoint" static="no" /> + <navigate anim="walk" /> <locate obj="tribe:home" static="no" /> <wander anim="walk" /> <navigate anim="walk" /> - <wait duration="180" /> + <emote cmd="/divide" /> + <wait duration="30" anim="stand" /> + <locate obj="self" static="no" /> + <reproduce /> </behavior> <behavior name="Resurrect" when_dead="yes" completion_decay="200"> <resurrect /> @@ -461,7 +474,18 @@ <navigate anim="walk" /> <circle anim="walk" radius="2" /> </behavior> + <behavior name="GoHome" resume="yes" completion_decay="100"> + <locate obj="waypoint" static="no" /> + <navigate anim="walk" /> + <locate obj="tribe:home" /> + <navigate anim="walk" /> + </behavior> + <behavior name="Memorize" completion_decay="200"> + <memorize obj="perception" /> + </behavior> + <react event="location sensed" behavior="Memorize" delta="200" type="mine" only_interrupt="Explre" /> + <react event="inventory:added" behavior="Memorize" delta="200" /> <react event="tribe:resurrect" behavior="Resurrect" delta="200" when_dead="yes" /> <react event="tribe:gotowork" behavior="GoToWork" delta="100" /> <react event="tribe:gather" behavior="GatherResource" delta="100" /> Modified: soc/2011/tribe/src/common/net/npcmessages.h =================================================================== --- soc/2011/tribe/src/common/net/npcmessages.h 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/common/net/npcmessages.h 2011-08-11 12:55:57 UTC (rev 7593) @@ -200,7 +200,7 @@ CMD_TERMINATOR, // cmds go from superclient to server CMD_DRDATA, CMD_ATTACK, - CMD_SIT, + CMD_SIT, CMD_SPAWN, CMD_TALK, CMD_VISIBILITY, Modified: soc/2011/tribe/src/npcclient/npc.cpp =================================================================== --- soc/2011/tribe/src/npcclient/npc.cpp 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/npcclient/npc.cpp 2011-08-11 12:55:57 UTC (rev 7593) @@ -883,7 +883,6 @@ void NPC::Printf(const char *msg,...) { va_list args; - if(!IsDebugging()) return; Modified: soc/2011/tribe/src/npcclient/npcclient.cpp =================================================================== --- soc/2011/tribe/src/npcclient/npcclient.cpp 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/npcclient/npcclient.cpp 2011-08-11 12:55:57 UTC (rev 7593) @@ -1602,7 +1602,7 @@ (memory->sector?memory->sector->QueryObject()->GetName():""), name.GetDataSafe()); } - } // End print Memeories scope + } // End print Memories scope CPrintf(CON_CMDOUTPUT,"Needs:\n"); tribes[i]->DumpNeeds(); Modified: soc/2011/tribe/src/npcclient/npcclient.h =================================================================== --- soc/2011/tribe/src/npcclient/npcclient.h 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/npcclient/npcclient.h 2011-08-11 12:55:57 UTC (rev 7593) @@ -63,7 +63,6 @@ class psPath; class psPathNetwork; struct iCelHNavStruct; -struct RMAnswer; struct RaceInfo_t { @@ -518,30 +517,26 @@ /** Fire perception * - * Method used by the console command 'fireperc' - * It fires a perception on the given npc + * Method used by the console command 'fireperc'. + * It fires a perception on the given npc. * * @param NPCId NPC on which to fire perc * @param perception The perception to fire * @return True if npc is found and perception is sent. False otherwise (doh!) */ bool FirePerception(int NPCId, const char* perception); + + // made public for the networkmanager to call it + bool LoadPathNetwork(); protected: bool ReadNPCsFromDatabase(); - -public: - // has to be public as the networkmanager has to call it - bool LoadPathNetwork(); - -protected: bool LoadLocations(); - + /** Load Tribes from db */ bool LoadTribes(); -protected: /** * Find all items that are close to NPC's and percept the * NPC. Modified: soc/2011/tribe/src/npcclient/npcoperations.cpp =================================================================== --- soc/2011/tribe/src/npcclient/npcoperations.cpp 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/npcclient/npcoperations.cpp 2011-08-11 12:55:57 UTC (rev 7593) @@ -2745,23 +2745,40 @@ // It means coordinates are passed through tribe memory not through x,y,z csArray<csString> split = psSplit(value, ':'); - // Check just to be sure - if(split[0] != "tribe" || split[1] != "memory") + // Check Arguments + + if(split[0] != "tribe") { Error2("Invalid argument passed to operation in xml file: %s", value); return false; } - if(split.GetSize() < 2 || split[2].IsEmpty()) + else { - Error2("Invalid argument passed to operation in xml file: %s", value); - return false; + if(split[1] == "home") + { + memoryCheck = "home"; + return true; + } + else if(split[1] == "memory") + { + if(split.GetSize() < 2 || split[2].IsEmpty()) + { + Error2("Invalid argument passed to operation in xml file: %s", value); + return false; + } + memoryCheck == split[2]; + return true; + } + else + { + Error2("Invalid argument passed to operation in xml file: %s", value); + return false; + } } - memoryCheck = split[2]; - - return true; } else { + memoryCheck = ""; destPos.x = node->GetAttributeValueAsFloat("x"); destPos.y = node->GetAttributeValueAsFloat("y"); destPos.z = node->GetAttributeValueAsFloat("z"); @@ -2793,13 +2810,22 @@ bool MoveToOperation::GetEndPosition(NPC* npc, const csVector3 &myPos, const iSector* mySector, csVector3 &endPos, iSector* &endSector) { - if(memoryCheck) + if(memoryCheck != "") { - Tribe::Memory* memory = npc->GetTribe()->FindMemory(memoryCheck); - endPos[0] = memory->pos[0]; - endPos[1] = memory->pos[1]; - endPos[2] = memory->pos[2]; - endSector = memory->sector; + if(memoryCheck == "home") + { + // Get Home Coords + float radius; + npc->GetTribe()->GetHome(endPos, radius, endSector); + } + else { + // Get Coords of Memory + Tribe::Memory* memory = npc->GetTribe()->FindMemory(memoryCheck); + endPos[0] = memory->pos[0]; + endPos[1] = memory->pos[1]; + endPos[2] = memory->pos[2]; + endSector = memory->sector; + } } else { @@ -3103,7 +3129,9 @@ ScriptOperation::OperationResult ReproduceOperation::Run(NPC *npc, EventManager *eventmgr, bool interrupted) { if(!npc->GetTarget()) + { return OPERATION_COMPLETED; // Nothing more to do for this op. + } NPC * friendNPC = npc->GetTarget()->GetNPC(); if(friendNPC) Modified: soc/2011/tribe/src/npcclient/recipe.cpp =================================================================== --- soc/2011/tribe/src/npcclient/recipe.cpp 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/npcclient/recipe.cpp 2011-08-11 12:55:57 UTC (rev 7593) @@ -37,6 +37,7 @@ // Local Includes //============================================================================= #include "recipe.h" +#include "npc.h" //TODO // Add needed headers, remove useless ones @@ -108,6 +109,10 @@ { newReq.type = REQ_TYPE_TRADER; } + else if(reqText == "memory") + { + newReq.type = REQ_TYPE_MEMORY; + } else { Error2("Unknown recipe requirement: %s. Bail.", explodedReq.Get(0)); @@ -258,11 +263,16 @@ CreateGlobalNPCType(tribe); } -bool RecipeManager::ParseFunction(csString function, Tribe* tribe, csArray<NPC*> npcs, Recipe* recipe) +bool RecipeManager::ParseFunction(csString function, Tribe* tribe, csArray<NPC*>& npcs, Recipe* recipe) { function = Preparse(function, tribe); - printf("ZeeDebug: Parsing Function %s.\n", function.GetData()); + /* TODO Remove */ + printf("ZeeDebug: Parsing Function %s on members:\n", function.GetData()); + for(int i=0;i<npcs.GetSize();i++) + { + printf("PID: %d\n", npcs[i]->GetPID().Unbox()); + } csStringArray functionParts; csString functionBody; @@ -282,11 +292,25 @@ tribe->SendPerception("tribe:gotowork", npcs); return true; } - else if(functionBody == "locateMemory" || functionBody == "locateResource") + else if(functionBody == "bogus") { - tribe->LoadActiveLocation(functionArguments.Get(0)); + // The 'Slack' Function return true; } + else if(functionBody == "locateMemory" || functionBody == "locateResource") + { + // If the location is unknown explore for it until it gets known + if(tribe->LoadActiveLocation(functionArguments.Get(0))) + { + return true; + } + else + { + tribe->SetBuffer("Buffer",functionArguments.Get(0)); + tribe->AddRecipe(GetRecipe("Explore"), recipe); + return false; + } + } else if(functionBody == "addKnowledge") { tribe->AddKnowledge(functionArguments.Get(0)); @@ -318,6 +342,11 @@ npcs = tribe->SelectNPCs(functionArguments.Get(0), functionArguments.Get(1)); return true; } + else if(functionBody == "explore") + { + tribe->SendPerception("tribe:explore", npcs); + return true; + } else if(functionBody == "setBuffer") { tribe->SetBuffer("Buffer", functionArguments.Get(0)); @@ -331,7 +360,7 @@ else if(functionBody == "wait") { tribe->ModifyWait(recipe, atoi(functionArguments.Get(0))); - // We return false because we want to wait a bit + // We return false to stop the execution return false; } else if(functionBody == "loadRecipe") @@ -381,9 +410,24 @@ if(tribe->CanGrow() && tribe->ShouldGrow()) { + // Start ... erm... cell-dividing :) tribe->SetBuffer("Buffer", name); tribe->AddRecipe(GetRecipe("mate"), recipe); } + else if(tribe->ShouldGrow()) + { + // Gather more resources + tribe->SetBuffer("Buffer", tribe->GetNeededResource()); + bool digable = true; // Provisional TODO + if(digable) + { + tribe->AddRecipe(GetRecipe("Dig Resource"), recipe); + } + else + { + tribe->AddRecipe(GetRecipe("Gather Resource"), recipe); + } + } return false; } else if(requirement.type == REQ_TYPE_RESOURCE) @@ -395,7 +439,7 @@ // TODO -- Check to see if resource is diggable or gatherable tribe->SetBuffer("Buffer", name); - bool digable = true; // Provisional + bool digable = true; // Provisional TODO if(digable) { tribe->AddRecipe(GetRecipe("Dig Resource"), recipe); @@ -433,6 +477,15 @@ tribe->AddRecipe(required, recipe); return true; } + else if(requirement.type == REQ_TYPE_MEMORY) + { + if(tribe->FindMemory(name)) + return true; + + // Explore for not found memory + tribe->AddRecipe(GetRecipe("Explore"), recipe); + return false; + } else { Error2("How did type %d did even become possible? Bail.", requirement.type); @@ -454,19 +507,19 @@ // Aggressivity Trait if(currentTribe->aggressivity == "warlike") { - reaction = "<react event=\"player anyrange\" behavior=\"aggressive_meet\" delta=\"150\" />"; + reaction = "<react event=\"player nearby\" behavior=\"aggressive_meet\" delta=\"150\" />"; reaction = "<react event=\"attack\" behavior=\"aggressive_meet\" delta=\"150\" />"; assembledType += reaction; } else if(currentTribe->aggressivity == "pacifist") { - reaction = "<react event=\"player anyrange\" behavior=\"peace_meet\" delta=\"100\" />\n"; + reaction = "<react event=\"player nearby\" behavior=\"peace_meet\" delta=\"100\" />\n"; reaction += "<react event=\"attack\" behavior=\"normal_attacked\" delta=\"150\" />"; assembledType += reaction; } else if(currentTribe->aggressivity == "coward") { - reaction = "<react event=\"player anyrange\" behavior=\"peace_meet\" delta=\"100\" />\n"; + reaction = "<react event=\"player nearby\" behavior=\"peace_meet\" delta=\"100\" />\n"; reaction += "<react event=\"attack\" behavior=\"coward_attacked\" delta=\"100\" />\n"; assembledType += reaction; } @@ -551,13 +604,21 @@ for(int i=0;i<recipes.GetSize();i++) if(recipes[i]->GetID() == recipeID) return recipes[i]; + + // Could not find it + CPrintf(CON_ERROR, "Could not find recipe with id %d.\n", recipeID); + return NULL; } Recipe* RecipeManager::GetRecipe(csString recipeName) { for(int i=0;i<recipes.GetSize();i++) - if(recipes[i]->GetName() == recipeName) - return recipes[i]; + if(recipes[i]->GetName() == recipeName) + return recipes[i]; + + // Could not find it + CPrintf(CON_ERROR, "Could not find recipe %s.\n", recipeName.GetData()); + return NULL; } RecipeManager::TribeData* RecipeManager::GetTribeData(Tribe *tribe) Modified: soc/2011/tribe/src/npcclient/recipe.h =================================================================== --- soc/2011/tribe/src/npcclient/recipe.h 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/npcclient/recipe.h 2011-08-11 12:55:57 UTC (rev 7593) @@ -42,14 +42,19 @@ class psNPCClient; class EventManager; -// TODO -- move these elsewhere -#define REQ_TYPE_TRIBESMAN 0 -#define REQ_TYPE_RESOURCE 1 -#define REQ_TYPE_ITEM 2 -#define REQ_TYPE_KNOWLEDGE 3 -#define REQ_TYPE_RECIPE 4 -#define REQ_TYPE_TRADER 5 +/** Types of requirements */ +enum { + REQ_TYPE_TRIBESMAN, + REQ_TYPE_RESOURCE, + REQ_TYPE_ITEM, + REQ_TYPE_KNOWLEDGE, + REQ_TYPE_RECIPE, + REQ_TYPE_TRADER, + REQ_TYPE_MEMORY +}; + + /** * This object represents recipes for the tribe AI. */ @@ -196,7 +201,7 @@ * @param recipe The recipe this function belongs to * @return True if function is done, false if it needs wait time. */ - bool ParseFunction(csString function, Tribe* tribe, csArray<NPC*> npcs, Recipe* recipe); + bool ParseFunction(csString function, Tribe* tribe, csArray<NPC*>& npcs, Recipe* recipe); /** Check Requirement * Modified: soc/2011/tribe/src/npcclient/tribe.cpp =================================================================== --- soc/2011/tribe/src/npcclient/tribe.cpp 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/npcclient/tribe.cpp 2011-08-11 12:55:57 UTC (rev 7593) @@ -53,8 +53,8 @@ Tribe::Tribe(EventManager *eventmngr) :homeSector(0),accWealthGrowth(0.0),deathRate(0.0),resourceRate(0.0) { - lastGrowth = csGetTicks(); - lastDeath = csGetTicks(); + lastGrowth = csGetTicks(); + lastDeath = csGetTicks(); lastResource = csGetTicks(); eventManager = eventmngr; @@ -351,7 +351,7 @@ Error4("Trying to attach a NPC %s(%u) to tribe without matching idle behavior of %s", npc->GetName(),npc->GetPID().Unbox(), npcIdleBehavior.GetDataSafe()); // Dump the behavior list so that we see what behaviors we have for this npc. - npc->DumpBehaviorList(); + npc->DumpBehaviorList(); return false; } @@ -550,8 +550,8 @@ { bestRecipe->nextStep = 0; } + //DumpRecipesToConsole(); // TODO Remove after tests } - //DumpRecipesToConsole(); -- TODO Remove after tests } } @@ -1061,7 +1061,7 @@ Perception perception(pcpt); for(int i=0;i<npcs.GetSize();i++) { - members[i]->TriggerEvent(&perception, -1, NULL, NULL, false); + npcs[i]->TriggerEvent(&perception, -1, NULL, NULL, false); } } @@ -1127,6 +1127,18 @@ void Tribe::AddRecipe(Recipe* recipe, Recipe* parentRecipe) { + if(!recipe) + { + // Avoid a segFault and signal the issue + CPrintf(CON_ERROR, "Could not add recipe. Received null pointer for recipe.\n"); + return; + } + if(!parentRecipe) + { + CPrintf(CON_ERROR, "Could not add recipe. Received null pointer for parent recipe.\n"); + return; + } + RecipeData newRecipe; newRecipe.recipe = recipe; newRecipe.parentRecipe = parentRecipe; @@ -1238,11 +1250,18 @@ CPrintf(CON_CMDOUTPUT, "+-------------------------------------------------+\n"); } -void Tribe::LoadActiveLocation(const char* name) +bool Tribe::LoadActiveLocation(const char* name) { Memory* activeLocation = FindMemory("activeLocation"); - delete activeLocation; - activeLocation = FindMemory(csString(name)); + Memory* newLocation = FindMemory(csString(name)); + // Check for the memory's existance + if(newLocation) + { + delete activeLocation; + activeLocation = FindMemory(csString(name)); + return true; + } + return false; } bool Tribe::CheckMembers(csString name, int number) @@ -1250,6 +1269,12 @@ // TODO Filter the search only for a kind of npcs (explorers, warriors, etc) for(int i=0;i<members.GetSize();i++) { + if(!members[i]->GetCurrentBehavior()) + { + // Discard Members with no Behavior + // This shouldn't happen but... ermm just in case + continue; + } if(strcasecmp(members[i]->GetCurrentBehavior()->GetName(), npcIdleBehavior.GetDataSafe()) == 0) { number--; @@ -1293,10 +1318,12 @@ { int count = atoi(number); csArray<NPC*> npcs; + csString currentBehavior; for(int i=0;i<members.GetSize();i++) { + currentBehavior = members[i]->GetCurrentBehavior()->GetName(); // if( ~checkType~ ) //TODO - if(members[i]->GetCurrentBehavior()->GetName() == "do nothing") + if(currentBehavior == "do nothing") { count--; npcs.Push(members[i]); Modified: soc/2011/tribe/src/npcclient/tribe.h =================================================================== --- soc/2011/tribe/src/npcclient/tribe.h 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/npcclient/tribe.h 2011-08-11 12:55:57 UTC (rev 7593) @@ -40,6 +40,7 @@ #include "tribeneed.h" #include "recipe.h" #include "npcbehave.h" +#include "npcclient.h" class iResultRow; class EventManager; @@ -453,11 +454,12 @@ /** Loads a location * - * Loads a location in the activeLocation memory buffer. + * Loads a location memory in the activeLocation memory buffer. * * @param name Name of the memory/resource to load. + * @return True if the desired memory location exists. */ - void LoadActiveLocation(const char* name); + bool LoadActiveLocation(const char* name); /** Check to see if enough members are idle */ bool CheckMembers(csString name, int number); Modified: soc/2011/tribe/src/server/database/mysql/tribe_recipes.sql =================================================================== --- soc/2011/tribe/src/server/database/mysql/tribe_recipes.sql 2011-08-10 17:17:33 UTC (rev 7592) +++ soc/2011/tribe/src/server/database/mysql/tribe_recipes.sql 2011-08-11 12:55:57 UTC (rev 7593) @@ -18,13 +18,14 @@ # Dumping test data for recipe table # -INSERT INTO `tribe_recipes` VALUES (1, 'tribe_mining', ' ', 'brain(civilised);aggressivity(pacifist);growth(conservatory);unity(organised);loadRecipe(expand peacefully);loadRecipe(Build Wonder);', 1, 1); -INSERT INTO `tribe_recipes` VALUES (2, 'mate', 'resource(REPRODUCTION_RESOURCE,REPRODUCTION_COST);tribesman(any,1);', 'select(any,1);mate();wait(100);addMember(BUFFER);', 0, 0); +INSERT INTO `tribe_recipes` VALUES (1, 'tribe_mining', ' ', 'brain(civilised);aggressivity(pacifist);growth(conservatory);unity(organised);loadRecipe(achieve population);', 1, 1); +INSERT INTO `tribe_recipes` VALUES (2, 'mate', 'resource(REPRODUCTION_RESOURCE,REPRODUCTION_COST);tribesman(any,1);', 'select(any,1);mate();addMember(BUFFER);', 0, 0); INSERT INTO `tribe_recipes` VALUES (3, 'Dig Resource', 'tribesman(miner,1)', 'locateResource(BUFFER);go();mine();', 0, 0); INSERT INTO `tribe_recipes` VALUES (4, 'Gather Resource', 'tribesman(gatherer,1)', 'locateResource(BUFFER);go();gather();', 0, 0); INSERT INTO `tribe_recipes` VALUES (5, 'Build Hut', 'tribesman(builder,1);resource(REPRODUCTION_RESOURCE, 30)', 'select(builder,1);addBuilding(hut);alterResource(REPRODUCTION_RESOURCE, 30);locateMemory(ACTIVE_BUILDING);go();wait(50);', 0, 0); -INSERT INTO `tribe_recipes` VALUES (6, 'expand peacefully', ' ', 'setBuffer(REPRODUCTION_RESOURCE);loadRecipe(Gather Resource);wait(1);loadRecipe(mate);', 1, 0); +INSERT INTO `tribe_recipes` VALUES (6, 'achieve population', 'tribesman(any,25); ', '', 1, 0); INSERT INTO `tribe_recipes` VALUES (7, 'Build Wonder', 'knowledge(ironworks);knowledge(pottery);knowledge(architecture);tribesman(any, 100);tribesman(builder,15);tribesman(warrior,5);resource(REPRODUCTION_RESOURCE, 100);resource(iron,100);item(goods,50);', 'alterResource(REPRODUCTION_RESOURCE, -100);select(warrior,5);addBuilding(wonder);locateMemory(BUFFER);go();guard();select(builder,15);go();wait(1000);addKnowledge(wonder);', 1, 0); INSERT INTO `tribe_recipes` VALUES (8, 'pottery', 'knowledge(clay);tribesman(builder,1);resource(REPRODUCTION_RESOURCE, 25);', 'alterResource(REPRODUCTION_RESOURCE, 25);addBuilding(potters hut);locateMemory(BUFFER);select(builder,1);go();wait(200);addKnowledge(pottery);', 0, 0); INSERT INTO `tribe_recipes` VALUES (9, 'clay', 'trader(clay);', 'loadRecipe(trade);addKnowledge(clay);', 0, 0); INSERT INTO `tribe_recipes` VALUES (10, 'trade', 'tribesman(any,1);resource(tria,ACTIVE_AMOUNT);', 'locateMemory(trader);select(any,1);go();trade(ACTIVE_AMOUNT,BUFFER);', 0, 0); +INSERT INTO `tribe_recipes` VALUES (11, 'Explore', 'tribesman(any,1);', 'select(any,1);explore();', 0, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |