Noticias

¡RECUERDA QUE SI ERES UN NUEVO USUARIO, DEBES PRESENTARTE PARA PODER PUBLICAR MENSAJES! | TENEMOS CANAL OFICIAL DE TELEGRAM: t.me/unity3dspain

Temas recientes

[DUDA] Modding de un juego.

Iniciado por YoSuboDeToh, Enero 16, 2019, 11:17:59 PM

Tema anterior - Siguiente tema
Enero 16, 2019, 11:17:59 PM Ultima modificación: Enero 16, 2019, 11:23:17 PM por YoSuboDeToh
Buenas a todos/as. mi principal duda por la cuál busqué este foro es porque quiero adentrarme en el mundo del modding de un videojuego hecho con Unity. La mayoria de código que entiendo son .xml 
 
A continuación os pondré unos ejemplos de como el juego tiene organizado varias cosas:
 
Item:
 

<item name="meleeToolChainsaw">
    <property name="Tags" value="melee,heavy,tool,perkMotherLode,perkDeepCuts,chainsaw"/>
    <property name="DisplayType" value="motorTool"/>
    <property name="HoldType" value="19"/>
    <property name="Meshfile" value="Items/Weapons/Melee/Chainsaw/chainsaw"/>
    <property name="Material" value="MmechanicalParts"/> <property name="Weight" value="50"/>
    <property name="RepairTools" value="resourceRepairKit"/>
    <property name="SoundIdle" value="chainsaw_idle"/>
    <property name="Group" value="Tools/Traps"/>
    <property name="ActionSkillGroup" value="Mining Tools"/>
    <property name="CraftingSkillGroup" value="craftSkillScience"/>
    <property name="RepairExpMultiplier" value="10.8"/>
    <property name="EconomicValue" value="3000"/>

 
BLOQUE:
 

<block name="toolCookingPot">
<property name="Material" value="MmetalNoGlue"/>
<property name="MaxDamage" value="1"/>
<property name="StabilitySupport" value="false"/> <!-- build restriction -->
<property name="Shape" value="Ext3dModel"/> <property name="Texture" value="293"/>
<property name="Mesh" value="models"/>
<property name="Model" value="CampingGear/cooking_pot" param1="main_mesh"/>
<property name="OnlySimpleRotations" value="true"/>
<property name="ImposterDontBlock" value="true"/>
<property name="IsTerrainDecoration" value="true"/>
<property name="CanPickup" value="true"/>
<drop event="Destroy" name="resourceScrapIron" count="1,15"/>
<property name="Collide" value="melee,bullet,arrow,rocket"/>
<property name="Group" value="Food/Cooking"/>
<property name="EconomicValue" value="12"/>
<property name="FilterTags" value="fdecor,fother,ffurniture"/>

 
ENTIDAD:
 

<entity_class name="zombieBoe" extends="zombieTemplateMale">
<property name="Tags" value="zombie,walker"/>
<property name="SoundRandom" value="Enemies/Base_Zombie_Male2/zombiemale2roam"/>
<property name="SoundAlert" value="Enemies/Base_Zombie_Male2/zombiemale2alert"/>
<property name="SoundAttack" value="Enemies/Base_Zombie_Male2/zombiemale2attack"/>
<property name="SoundHurt" value="Enemies/Base_Zombie_Male2/zombiemale2pain"/>
<property name="SoundDeath" value="Enemies/Base_Zombie_Male2/zombiemale2death"/>
<property name="SoundSense" value="Enemies/Base_Zombie_Male2/zombiemale2sense"/>
<property name="Mesh" value="Zombies/zombieStandardBoeRagdoll"/>
<property name="AvatarController" value="AvatarZombie01Controller"/>
<property name="ModelType" value="Standard"/>
<property name="WalkType" value="2"/>
<property name="RootMotion" value="true"/>
<property name="HasDeathAnim" value="true"/>
<property name="ReplaceMaterial1" value="entities/zombies/materials/Z_eye1"/>
<!-- Gameplay -->
<property name="MoveSpeed" value="0.06"/>
<property name="MoveSpeedAggro" value="0.2, 1.1"/>
<effect_group name="Base Effects">
   <passive_effect name="HealthMax" operation="base_set" value="150"/>
   <passive_effect name="HealthMax" operation="perc_set" value="1"/> <!-- Zombie HP scale -->
</effect_group>
</entity_class>
<entity_class name="zombieBoeFeral" extends="zombieBoe">
<property name="Tags" value="zombie,walker,feral"/>
<property name="ReplaceMaterial1" value="entities/zombies/materials/feral_eye"/>
<!-- Gameplay -->
<property name="MoveSpeedAggro" value=".5, 1.35"/>
<property name="HandItem" value="meleeHandZombieFeral"/>
<property name="ExperienceGain" value="700"/> <!-- XP grunt feral -->
<property name="LootDropProb" value=".03"/> <!-- Feral -->
<effect_group name="Base Effects">
   <passive_effect name="HealthMax" operation="base_set" value="285"/>
   <passive_effect name="HealthMax" operation="perc_set" value="1"/> <!-- Zombie HP scale -->
   <passive_effect name="EntityDamage" operation="perc_add" value="0"/> <!-- Feral damage -->
</effect_group>
</entity_class>

 
VEHICULO:
 

   <vehicle name="vehicleMinibike">
   <property name="cameraDistance" value="3, 4.5"/>
   <property name="cameraTurnRate" value=".2, .35"/>
   <property name="motorTorqueMinQ" value="1000"/>
   <property name="motorTorqueMaxQ" value="2000"/>
   <property name="brakeTorque" value="4000"/>
   <property name="upAngleMax" value="70"/>
   <property name="upForce" value="1"/>
   <property name="steerRate" value="130"/>
   <property name="steerCenteringRate" value="90"/>
   <property name="tiltAngleMax" value="20"/>
   <property name="tiltThreshold" value="3"/>
   <property name="tiltDampening" value=".22"/>
   <property name="tiltDampenThreshold" value="8"/>
   <property name="tiltUpForce" value="5"/>
   <property name="hopForce" value="1"/>
   <property name="unstickForce" value="1"/>
   <property name="velocityMax" value="7, 10"/>
   <property name="waterDrag_y_velScale_velMaxScale" value="1.5, .9, .15"/>
   <property name="wheelPtlScale" value=".6"/>
   <property name="hornSound" value="vehicle/minibike/minibike_horn"/>
   <property class="chassis">
      <property name="class" value="Chassis"/>
      <property name="slot_type" value="chassis"/>
      <property name="mesh" value="chassis"/>
      <property name="transform" value="Origin"/>
   </property>
   <property class="handlebars">
      <property name="class" value="Steering"/>
      <property name="slot_type" value="handlebars"/>
      <property name="mesh" value="handlebar"/>
      <property name="transform" value="Origin/handlebar_joint"/>
      <property name="IKHandLPosition" value="-0.3205, 0.4422, -0.0433"/>
      <property name="IKHandLRotation" value="62.50001, -26.92984, -12.41"/>
      <property name="IKHandRPosition" value="0.3205, 0.4422, -0.0433"/>
      <property name="IKHandRRotation" value="52.90001, 8.37004, 6.400046"/>
      <property name="parent_part" value="chassis"/>
   </property>
   <property class="seat0">
      <property name="position" value="0, 0, -.15"/>
      <property name="rotation" value="0, 0, 0"/>
      <property name="exit" value="-.8,0,0 ~ .8,0,0 ~ 0,0,-1.2 ~ 0,0,1.2 ~ 0,1.3,0"/>
   </property>
   <property class="wheel0">
      <property name="steerTransform" value="Origin/handlebar_joint"/>
      <property name="tireTransform" value="Origin/handlebar_joint/frontWheel_joint"/>
      <property name="torqueScale_motor_brake" value=".15, .5"/>
   </property>
   <property class="wheel1">
      <property name="tireTransform" value="Origin/backWheelJoint"/>
      <property name="torqueScale_motor_brake" value="1, 1"/>
   </property>
   <property class="battery">
      <property name="class" value="Battery"/>
      <property name="slot_type" value="battery"/>
      <property name="mesh" value="battery"/>
      <property name="transform" value="battery"/>
      <property name="parent_part" value="chassis"/>
   </property>
   <property class="engine">
      <property name="class" value="Engine"/>
      <property name="slot_type" value="engine"/>
      <property name="mesh" value="engine_small"/>
      <property name="transform" value="engine_small"/>
      <property name="particle_transform" value="engine_small/MinibikeParticles/p_engine_fire"/>
      <property name="fuelKmPerL" value="4"/>
      <property name="gear1" value="
                     500,2500, -1400,800,0, 1500,9999,9999,
                     Vehicles/Minibike/minibike_accel_OFF,
                     ,
                     0, .5,  .45, .1,  -9, .1, .1, Vehicles/Minibike/minibike_idle_lp_,
                     -.1, .1,  .65, .7,  0, 9, .1, Vehicles/Minibike/minibike_run_lp_
                     "/>
      <property name="sound_start" value="Vehicles/Minibike/minibike_start_"/>
      <property name="sound_shut_off" value="Vehicles/Minibike/minibike_shutoff_"/>
      <property name="sound_no_fuel_shut_off" value="Vehicles/Minibike/minibike_empty_"/>
      <property name="parent_part" value="chassis"/>
   </property>
   <property class="exhaust">
      <property name="class" value="Exhaust"/>
      <property name="parent_part" value="engine"/>
      <property name="particle_transform" value="engine_small/MinibikeParticles/p_engine"/>
   </property>
   <property class="chain">
      <property name="mesh" value="chain"/>
      <property name="parent_part" value="engine"/>
      <property name="transform" value="chain"/>
   </property>
   <property class="storage">
      <property name="class" value="Storage"/>
      <property name="display_name" value="basket"/>
      <property name="slot_type" value="basket"/>
      <property name="mesh" value="basket"/>
      <property name="transform" value="basket"/>
      <property name="parent_part" value="chassis"/>
   </property>
   <property class="headlight">
      <property name="class" value="Headlight"/>
      <property name="parent_part" value="handlebars"/>
      <property name="transform" value="Origin/handlebar_joint/headlight"/>
      <property name="bright" value=".65"/>
   </property>
   <property class="fuelTank">
      <property name="class" value="FuelTank"/>
      <property name="parent_part" value="engine"/>
      <property name="capacity" value="4"/>
   </property>
</vehicle>

 
 
 
Bueno mas o menos todo esto si lo controlo, porque es ir cambiando valores por los correctos y saber donde va todo...mi duda es cuando los modders empiezan a scriptear en unity para inventar mecánicas inexistentes en el juego con C#. Entonces ellos utilizan las mismos "formas" que los desarrolladores, como esto:
 

string GetBlockNameFromContainerIndex(Vector3i _rigBlockPos, int _index)
    {
        TileEntitySecureLootContainer tileEntitySecureLootContainer = GameManager.Instance.World.GetTileEntity(0, _rigBlockPos) as TileEntitySecureLootContainer;
        if(tileEntitySecureLootContainer != null)
        {
            ItemStack[] itemStackArr = tileEntitySecureLootContainer.items.ToArray();
            int index = itemStackArr.Length+_index;
            if(itemStackArr[index] != null)
            {
                ItemValue itemValue = itemStackArr[index].itemValue;
                if(itemValue != null)
                {
                    BlockValue _blockValue = itemValue.ToBlockValue();
                    Block block = Block.list[_blockValue.type];
                    string blockName = block.GetLocalizedBlockName();
                    return blockName;
                }
            }
        }
        return string.Empty;
    }
   
    bool IndexContainsBlock(Vector3i _rigBlockPos, Vector3i _targetBlockPos, int _index)
    {
        string name = GetBlockNameFromContainerIndex(_rigBlockPos, _index);
        return name != "Air";
    }

 
Este código no tengo ni puñetera idea de lo que quiere decir, aunque supiera de lo que están hablando, logicamente porque no entiendo de programación, pero mi duda es esa, que estos modders utilizan lo que los desorrallores le han permitido extraer de la base del juego y mediante código desde cero, estan haciendo que funcione creando nuevas mecánicas?
 
 
 
Me gustaría empezar a modear ese juego pero con el desconocimiento que tengo me va a ser imposible.

Existen herramientas de modelado que el fabricante entrega con el juego, con estas es facil modelar, pero a pulso y sin conocimientos es muy complicado. Porqué no te animas a crear una escena simulando tu juego, y que sea funcional?? así aprenderías mucho, y si funciona, el siguiente paso es meterle mano al juego y ver que tal se te da lo aprendido. 

Lo primero que te toca hacer es documentarte todo lo que puedas sobre ese juego del que quieres hacer mods.
 
Busca cómo están dispuestos los archivos del juego, qué hacen, para qué sirve cada variable, etc.. Empieza con pruebas pequeñitas, cambiando algún valor patatero del xml, para subirte más vida, o cambiando de valor un texto que aparezca en algún diálogo, etc. Así es cómo se empieza, de hecho...
 
 
 
Más adelante, ya tendrás una base mínima para saber qué quieres cambiar exactamente, si es algo de código que cambia el comportamiento o condiciones del juego, o es meramente visual o aportas más contenido, etc...

El juego es 7DTD, está hecho en Unity. https://7daystodie.com/?home
 
Si, si yo entiendo como funciona, he metido objetos ya ingame como comida nueva con su icono personalizado, descripcion y valores nutricionales, su meshdrop, meshonhand y meshfile, es decir no me considero novato porque en los .xml está basicamente todo, mi problema está en la hora de scriptear que no tengo ni idea como son todo eso de las variables y el if, y cosas asi.

Enero 21, 2019, 10:49:07 PM #4 Ultima modificación: Enero 21, 2019, 10:50:35 PM por YoSuboDeToh

<?xml version="1.0" encoding="UTF-8"?>
<!--
Materials definitions
Attributes:
* id - mandatory, type: string, semantic: defines name of the material to be referenced within block tags
* lightopacity (int) - sunlight values can be 0-15. A block can reduce this by up to 15.
* hardness (float) - mandatory. Vlues go from 1 to infinite, hardnes="1" means one hit with current digger destroys the block
<property name="Hardness" type="float" value="5"/>
Block damage is reduced to 1/5 of default damage.
* explosionresistance (1.0f): The higher the better.
* collidable (bool):   this is used as default for a block that uses this material - but only if this block does not override it with its own Collide mask.
   So if a material sets collideable and a block uses this material (without overriding it), everything collides with this block
* movement_factor - optional, float: if specified then this factor is applied to the movement. values < 1 slow down player. value = 1 does nothing, > 1 increases speed
* friction (0.454f) - default surface friction
* plant (bool) - optional, currently used only for farmland, if a "no plant" block is placed on top of a farmland block it turns to dirt
* fertile_level (int) - optional, int: some plants need a certain fertile level to grow
* growable - optional, bool: a farm land block turn to dirt of no water and no "growable" block is nearby
* stability_glue (int): in the horizontal plane, each of the 4 sides of this block will hold this mass
* StabilitySupport (bool): if false, this block does not support anything built ON TOP of it
* Mass (2 int) : the counterpart of stability_glue. A stability_glue of 7 will not support a mass of 9.
* MaxDamage (100 int) : hit points of the block
* damage_category = head, glass, stone, cloth, concrete, boulder, metal, wood, earth, snow, plants, leaves
Used to determine the damage category if an item hits this block.
This corresponds to <property name="DamageBonus.earth" value="5"/> in items.xml so this is used for bonus damage.
* surface_category = cloth, earth, glass, metal, organic, plant, stone, water, wood
Used to determine the sound + effect on impact.
Assets\Textures\Blocks\blocktextures.xml CAN override this on a per-texture base by referencing a MATERIAL ID and using it's SURFACE_CATEGORY.
If no VALID material id is referenced in blocktextures.xml, the surface_category of the BLOCK's material is used.
* forge_category : needed to tally up smelt/scrap result
* ground_cover (bool)
* liquid
* particle_category
* particle_destroy_category
* stepsound (str)
* Experience (1.0f) :
Making blocks fertile provides fertile block's material player exp.
Repairing a block now gives xp based on materials used multiplied by their count.
Upgrading a block now gives xp based on materials used multiplied by their count.
Harvesting a block now gives xp based on item materials gained.
Planting gives block material exp
DO NOT use values <1. Actual XP awarded WILL be rounded down to int so it would zero on a harvested count of 1.
Do not rename "basic" materials like cloth, metal, or stone. These auto-generate the particle lookup query.
-->

 
Esto que se ve es como funcionan la propiedad de Materials que tiene cada block en el juego. Lo que no entiendo es lo que significa "bool" "int" "float" "str"

Cita de: YoSuboDeToh date=1548107347Lo que no entiendo es lo que significa "bool" "int" "float" "str"
   


tipo de variable

Otra pregunta:
 
Quiero crear el icono del objeto que estoy moddeando para el juego en unity. ¿Hay algún truquillo de como hacer una buena foto y luego photoshopearla para implementar icono, siendo el mismo objeto?

Etiquetas: