diff --git a/scripts/SimulationParameters/MicrobeStage/BioProcesses.json b/scripts/SimulationParameters/MicrobeStage/BioProcesses.json index f212037ccde..55d6082e212 100644 --- a/scripts/SimulationParameters/MicrobeStage/BioProcesses.json +++ b/scripts/SimulationParameters/MicrobeStage/BioProcesses.json @@ -117,7 +117,7 @@ "inputs": { "carbondioxide": 0.09, - "iron": 0.5 + "iron": 0.175 }, "outputs": { diff --git a/scripts/microbe_stage/configs.as b/scripts/microbe_stage/configs.as index 6035b743d8c..1e2be0268ce 100644 --- a/scripts/microbe_stage/configs.as +++ b/scripts/microbe_stage/configs.as @@ -345,7 +345,7 @@ const dictionary STARTER_MICROBES = { {"phosphates", InitialCompound(0)}, {"hydrogensulfide", InitialCompound(0)}, {"oxytoxy", InitialCompound(0)}, - {"iron", InitialCompound(0)} + {"iron", InitialCompound(3)} }, { OrganelleTemplatePlaced("cytoplasm", 0, 0, 0) diff --git a/scripts/microbe_stage/microbe_operations.as b/scripts/microbe_stage/microbe_operations.as index 12b4c062871..24b3decdc7a 100644 --- a/scripts/microbe_stage/microbe_operations.as +++ b/scripts/microbe_stage/microbe_operations.as @@ -699,7 +699,8 @@ void playSoundWithDistance(CellStageWorld@ world, const string &in soundPath, Ob "sound source"); } } else { - LOG_ERROR("Failed to create sound player"); + //this was happening so often it caused lag + //LOG_ERROR("Failed to create sound player"); } } } diff --git a/scripts/microbe_stage/setup.as b/scripts/microbe_stage/setup.as index 1f0dca2a921..0f2f34e7e17 100644 --- a/scripts/microbe_stage/setup.as +++ b/scripts/microbe_stage/setup.as @@ -632,6 +632,8 @@ ObjectID createIron(CellStageWorld@ world, Float3 pos) renderNode.Node.setPosition(pos); string mesh=""; int ironSize = 1; + // 5 is the default + float ironAmount = 3.0f; // There are four kinds switch (GetEngine().GetRandom().GetNumber(0, 4)) { @@ -650,11 +652,14 @@ ObjectID createIron(CellStageWorld@ world, Float3 pos) case 4: mesh="iron_05.mesh"; ironSize=10; + ironAmount=10.0f; break; } world.Create_CompoundVenterComponent(ironEntity); + // So that larger iron chunks give out more compounds + world.GetComponent_CompoundVenterComponent(ironEntity).setVentAmount(ironAmount); world.Create_CompoundBagComponent(ironEntity); auto model = world.Create_Model(ironEntity, renderNode.Node, mesh); // Need to set the tint diff --git a/scripts/microbe_stage/species_system.as b/scripts/microbe_stage/species_system.as index 05a1a02110c..7ad22f3f436 100644 --- a/scripts/microbe_stage/species_system.as +++ b/scripts/microbe_stage/species_system.as @@ -89,34 +89,40 @@ string mutateWord(string name){ switch (GetEngine().GetRandom().GetNumber(0,5)) { case 0: + //VC newVowel = GetEngine().GetRandom().GetNumber(0,vowels.length()-1); newConsonant = GetEngine().GetRandom().GetNumber(0,consonants.length()-1); newSyllable= ""+vowels.substr(newVowel, 1)+consonants.substr(newConsonant, 1); newName.insert(index, newSyllable); break; case 1: + //CV newVowel = GetEngine().GetRandom().GetNumber(0,vowels.length()-1); newConsonant = GetEngine().GetRandom().GetNumber(0,consonants.length()-1); newSyllable = ""+consonants.substr(newConsonant, 1)+vowels.substr(newVowel, 1); newName.insert(index, newSyllable); break; case 2: + //CC newConsonant = GetEngine().GetRandom().GetNumber(0,consonants.length()-1); newSyllable= ""+original+consonants.substr(newConsonant, 1); newName.insert(index, newSyllable); break; case 3: + //CC newConsonant = GetEngine().GetRandom().GetNumber(0,consonants.length()-1); newSyllable = ""+consonants.substr(newConsonant, 1)+original; newName.insert(index, newSyllable); break; case 4: + //CCV newVowel = GetEngine().GetRandom().GetNumber(0,vowels.length()-1); newConsonant = GetEngine().GetRandom().GetNumber(0,consonants.length()-1); newSyllable = original+consonants.substr(newConsonant, 1)+vowels.substr(newVowel, 1); newName.insert(index, newSyllable); break; case 5: + //VCC newVowel = GetEngine().GetRandom().GetNumber(0,vowels.length()-1); newConsonant = GetEngine().GetRandom().GetNumber(0,consonants.length()-1); newSyllable = vowels.substr(newVowel, 1)+consonants.substr(newConsonant, 1)+original; @@ -124,14 +130,17 @@ string mutateWord(string name){ break; } } + // If is vowel else { if(GetEngine().GetRandom().GetNumber(0,20) <= 10){ + //CVV int newConsonant = GetEngine().GetRandom().GetNumber(0,consonants.length()-1); int newVowel = GetEngine().GetRandom().GetNumber(0,vowels.length()-1); string newSyllable = ""+consonants.substr(newConsonant, 1)+vowels.substr(newVowel, 1)+original; newName.insert(index, newSyllable); } else { + //VVC int newConsonant = GetEngine().GetRandom().GetNumber(0,consonants.length()-1); int newVowel = GetEngine().GetRandom().GetNumber(0,vowels.length()-1); string newSyllable = ""+original+vowels.substr(newVowel, 1)+consonants.substr(newConsonant, 1); diff --git a/src/microbe_stage/compound_venter_system.cpp b/src/microbe_stage/compound_venter_system.cpp index 2c7e4d4baa8..2864bee9495 100644 --- a/src/microbe_stage/compound_venter_system.cpp +++ b/src/microbe_stage/compound_venter_system.cpp @@ -38,8 +38,8 @@ void CompoundVenterComponent& venter = std::get<1>(*value.second); Leviathan::Position& position = std::get<2>(*value.second); venter.ventCompound(position, - SimulationParameters::compoundRegistry.getTypeId("iron"), 5, - world); + SimulationParameters::compoundRegistry.getTypeId("iron"), + venter.ventAmount, world); } } } @@ -51,5 +51,17 @@ void CellStageWorld& world) { world.GetCompoundCloudSystem().addCloud( - compound, amount * 1000, pos.Members._Position); + compound, amount * 1000.0f, pos.Members._Position); +} + +void + CompoundVenterComponent::setVentAmount(float amount) +{ + this->ventAmount = amount; +} + +float + CompoundVenterComponent::getVentAmount() +{ + return this->ventAmount; } \ No newline at end of file diff --git a/src/microbe_stage/compound_venter_system.h b/src/microbe_stage/compound_venter_system.h index 30430a61f61..eecaa20fbea 100644 --- a/src/microbe_stage/compound_venter_system.h +++ b/src/microbe_stage/compound_venter_system.h @@ -21,7 +21,7 @@ class CompoundVenterComponent : public Leviathan::Component { CompoundVenterComponent(); float x, y; - + float ventAmount = 5.0f; REFERENCE_HANDLE_UNCOUNTED_TYPE(CompoundVenterComponent); static constexpr auto TYPE = @@ -32,6 +32,12 @@ class CompoundVenterComponent : public Leviathan::Component { CompoundId ourCompound, double amount, CellStageWorld& world); + + void + setVentAmount(float amount); + + float + getVentAmount(); }; class CompoundVenterSystem diff --git a/src/scripting/script_initializer.cpp b/src/scripting/script_initializer.cpp index 1d18c0db86b..b250a7a5197 100644 --- a/src/scripting/script_initializer.cpp +++ b/src/scripting/script_initializer.cpp @@ -516,6 +516,19 @@ bool engine, "CompoundVenterComponent", &CompoundVenterTYPEProxy)) return false; + if(engine->RegisterObjectMethod("CompoundVenterComponent", + "float getVentAmount()", + asMETHOD(CompoundVenterComponent, getVentAmount), + asCALL_THISCALL) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } + + if(engine->RegisterObjectMethod("CompoundVenterComponent", + "void setVentAmount(float amount)", + asMETHOD(CompoundVenterComponent, setVentAmount), + asCALL_THISCALL) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } // ------------------------------------ // if(engine->RegisterObjectType( "SpawnedComponent", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {