Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Update 01.127 - Character stats changes

Discussion in 'Modding' started by Drui, Mar 24, 2016.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Drui Keen Update Guy Staff

    Messages:
    1,390
    Character stats definition was changed to stats component definition. These parts in definition files (Stats.sbc) are now obsolete:
    <StatGroupDefinitions>
    <StatGroup>
    <Id>
    <TypeId>MyObjectBuilder_StatsDefinition</TypeId>
    <SubtypeId>SpaceCharacterStats</SubtypeId>​
    </Id>
    <Stats>
    <Stat>
    <TypeId>MyObjectBuilder_EntityStat</TypeId>
    <SubtypeId>SpaceCharacterHealth</SubtypeId>​
    </Stat>​
    </Stats>
    <Scripts>
    <Script>SpaceStatEffect</Script>​
    </Scripts>​
    </StatGroup>​
    </StatGroupDefinitions>


    Stats was referenced in character definition (Characters.sbc, …) and <Stats> SpaceCharacterStats </Stats> is now also obsolete:
    <Character>
    <Id>
    <TypeId>MyObjectBuilder_Character</TypeId>
    <SubtypeId>Default_Astronaut</SubtypeId>​
    </Id>​
    <Stats> SpaceCharacterStats </Stats>



    New stats component definition uses the same format and parameters as previous definition (EntityComponents.sbc):
    <EntityComponents>
    <EntityComponent xsi:type="MyObjectBuilder_EntityStatComponentDefinition">
    <Id>
    <TypeId>CharacterStatComponent</TypeId>
    <SubtypeId>Default_Astronaut</SubtypeId>​
    </Id>
    <Stats>
    <Stat>
    <TypeId>MyObjectBuilder_EntityStat</TypeId>
    <SubtypeId>SpaceCharacterHealth</SubtypeId>​
    </Stat>​
    </Stats>
    <Scripts>
    <Script>SpaceStatEffect</Script>​
    </Scripts>​
    </EntityComponent>​
    </EntityComponents>

    This is definition of entity component <TypeId>CharacterStatComponent</TypeId>. <SubtypeId>Default_Astronaut</SubtypeId> will be referenced in container (can be also written <SubtypeId>SpaceCharacterStats</SubtypeId> or any string, but it is recommended to use the same SubtypeId as for your character.


    Check if the character has component container initialization (EntityContainers.sbc). Create one if there is no character container initialization (note the TypeId and SubtypeId) and add our stats component.
    <EntityContainers>
    <Container>
    <Id>
    <TypeId>MyObjectBuilder_Character</TypeId>
    <SubtypeId>Default_Astronaut</SubtypeId>​
    </Id>
    <DefaultComponents>
    <Component BuilderType="MyObjectBuilder_CharacterStatComponent" SubtypeId="Default_Astronaut" ForceCreate="true"/>​
    </DefaultComponents>​
    </Container>​
    </EntityContainers>

    This part
    <Component BuilderType="MyObjectBuilder_CharacterStatComponent" SubtypeId="Default_Astronaut" ForceCreate="true"/> adds CharacterStatComponent to Default_Astronaut character.
    SubtypeId="Default_Astronaut" -reference to previously defined component stats with SubtypeId Default_Astronaut, but can reference any shared stats. So for example all spiders have the same referenced stats.
    ForceCreate="true" - forces creation of the component (creates component for old character saves).

    Character without stats is logged with message Stat component has not been created for character …
    Such character has not defined stats component or there is problem in component/container definition.


    Example of spider stats component:
    <EntityComponents>
    <EntityComponent xsi:type="MyObjectBuilder_EntityStatComponentDefinition">
    <Id>
    <TypeId>CharacterStatComponent</TypeId>
    <SubtypeId>Space_spider</SubtypeId>​
    </Id>
    <Stats>
    <Stat>
    <TypeId>MyObjectBuilder_EntityStat</TypeId>
    <SubtypeId>SpiderHealth</SubtypeId>​
    </Stat>​
    </Stats>
    <Scripts>
    <Script>SpaceStatEffect</Script>​
    </Scripts>​
    </EntityComponent>​
    </EntityComponents>


    Example of spider entity containers:
    <EntityContainers>
    <Container>
    <Id>
    <TypeId>MyObjectBuilder_Character</TypeId>
    <SubtypeId>Space_spider</SubtypeId>​
    </Id>
    <DefaultComponents>
    <Component BuilderType="MyObjectBuilder_CharacterStatComponent" SubtypeId="Space_spider" ForceCreate="true"/>​
    </DefaultComponents>​
    </Container>

    <Container>
    <Id>
    <TypeId>MyObjectBuilder_Character</TypeId>
    <SubtypeId>Space_spider_black</SubtypeId>​
    </Id>
    <DefaultComponents>
    <Component BuilderType="MyObjectBuilder_CharacterStatComponent" SubtypeId="Space_spider" ForceCreate="true"/>​
    </DefaultComponents>​
    </Container>

    <Container>
    <Id>
    <TypeId>MyObjectBuilder_Character</TypeId>
    <SubtypeId>Space_spider_brown</SubtypeId>​
    </Id>
    <DefaultComponents>
    <Component BuilderType="MyObjectBuilder_CharacterStatComponent" SubtypeId="Space_spider" ForceCreate="true"/>​
    </DefaultComponents>​
    </Container>​
    </EntityContainers>
     
  2. OrfanKrippler Apprentice Engineer

    Messages:
    145
    Did I miss the video?
     
  3. Zanzikahn Trainee Engineer

    Messages:
    46
    Ok, so what exactly is the change? Is it just a swap of information location?
     
  4. Ronin1973 Master Engineer

    Messages:
    4,476
    With the changes, would it be possible to spawn Space Spiders as part of a script to a specific location? Now that spawn points can be specified.

    If a character enters a certain set of coordinates the game responds by spawning in one or more space spiders?
     
  5. MechanizedIT Apprentice Engineer

    Messages:
    354
    Is there a way to change the amount of damage a spider does?
     
  6. Zanzikahn Trainee Engineer

    Messages:
    46
    I could have sworn I had changed the damage on my bot... Unfortunately I cannot remember how I did it.. There is no option readily available in the Data Files. :( At least you can modify everything else. :p One workaround (though a little tedious) is to modify the health stats of the astronaut to reflect the damage percent amount you would like the spiders to do.
     
Thread Status:
This last post in this thread was made more than 31 days old.