Hello I am trying to retrieve and set the information on the Player's health stat.
So far I coulnd't find the methods on PlayerSession object to alter any stat on player.
Thanks in advance
Edit: health stat
Modifying player's health?
Discussion in 'Hurtworld Development' started by John W, Jan 12, 2016.
-
Code:
PlayerSession session = //Get your player however you'd like var stat = session.WorldPlayerEntity.GetComponent<EntityStats>();stat.GetFluidEffect(EEntityFluidEffectType.Health).SetValue(100);
EDIT:
Code:#region Assembly Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // C:\Users\brand\Source\Repos\Oxide\Games\Unity\Oxide.Game.Hurtworld\Dependencies\Assembly-CSharp.dll #endregionpublic enum EEntityFluidEffectType { Health = 0, Hydration = 1, Nutrition = 2, BodyTemperature = 3, ExternalTemperature = 4, ImmunityUNUSED = 5, SleepUNUSED = 6, Radiation = 7, Oxygen = 8, ToxicityUNUSED = 9, Dampness = 10, Speed = 11, Pace = 12, Energy = 13, MetabolismSpeedUNUSED = 14, Damage = 15, RadialDamageProxy = 16, DamageProxyHead = 17, DamageProxyBody = 18, DamageProxyArms = 19, DamageProxyHands = 20, DamageProxyLegs = 21, DamageProxyFeet = 22, DamageHitboxProxySpine = 23, DamageHitboxProxyChest = 24, DamageHitboxProxyLeftArm = 25, DamageHitboxProxyLeftForearm = 26, DamageHitboxProxyLeftHand = 27, DamageHitboxProxyRightArm = 28, DamageHitboxProxyRightForearm = 29, DamageHitboxProxyRightHand = 30, DamageHitboxProxyHead = 31, DamageHitboxProxyStomach = 32, DamageHitboxProxyHips = 33, DamageHitboxProxyLeftLeg = 34, DamageHitboxProxyLeftCalf = 35, DamageHitboxProxyRightLeg = 36, DamageHitboxProxyRightCalf = 37, DamageHitboxProxyRightFoot = 38, DamageHitboxProxyLeftFoot = 39, MineHealth = 40, WoodHealth = 41, DamageProxyHeart = 42, None = 43, EatingFoodProxy = 44, SunProtection = 45, ColdProtection = 46, ColdBar = 47, HeatBar = 48, StorageCapacity = 49, FallDamageProxy = 50, OilStorage = 51, WaterStorage = 52, PowerStorage = 53, Oilyness = 54, Bravery = 55, Intimidation = 56, Prestige = 57, Age = 58, Wind = 59, Toxin = 60, Repair = 61, Hungerbar = 62, ResetTimer = 63, PlayerToCreatureDamage = 64, CreatureDamageArmor = 65, CreatureToPlayerDamage = 66, TimeAlive = 67, AttachmentDamage = 68, EnginePower = 69, Weight = 70, VehicleArmor = 71, TopSpeed = 72, Traction = 73, TurnSpeed = 74, FuelConsumption = 75, ToxinVelocity = 76, Infamy = 77, Windburn = 78, RespawnTime = 79 }
-
Much thanks, I am using .NET reflector for the first time and I am struggling to get most information. Any tips?
Edit: After testing it, it worked.Last edited by a moderator: Jan 12, 2016 -
You aren't going to know everything, additionally you'll run into issues that you can't solve, the community is a great resource.
Glad to know that it worked. -
Could you elucidate me on how and where to develop directly in the project?
I never used VS with external dependencies so it's complete new to me.
Also, do you disassemble with VS? -
.SetValue() is a bit of a breaking way to set EntityStat values, as it disregards all other effects on the stat. If you want to affect a value, while still having the value react logically to all the other systems in the game, add an EntityEffectFluid.