Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - projecttemp

#16
Outdated / Re: [A11] Dimensional Nano Shield
July 01, 2015, 07:36:11 AM
Quote from: skyarkhangel on June 29, 2015, 06:17:26 PM
Do you have the opportunity to use at least the standard animation of power shield aura when colonists in shield gen range?
I don't know where to get the texture for the shield, it is not in core folder :(

Quote from: skyarkhangel on June 29, 2015, 06:17:26 PM
And new idea to you.. use minifiedBase for shield gen  :D
That is a great idea, this way i can make it buyable thorough exotic trader :D

Quote from: Materialjam on June 29, 2015, 08:47:31 PM
A good recent mod, especially enjoy the range mechanic!

Just an idea, love the mod! Keep up the good work!
Thank you, always glad to hear someone is enjoying my mod

Quote from: Materialjam on June 29, 2015, 08:47:31 PM
However, I feel as though the current system is slightly backwards. As you have to make a receiver to equip the colonist with, it seems to me as though this would be what would affect the capacity of the shield rather than this being reliant on the transmitter. Perhaps you could make several types of receivers and/or rely on the stuff system to increase and decrease the capacity?
The intention i had for this mod was to create a "shared health" between multiple colonist(i originally based this on warcraft 3's soul link :P, but actually sharing health is really complicatedand might end up all dyng to one well placed sniper shot). Thats why the energy is at the transmitter and not at the shield, if i changed this, it would be a different mod all together.

Quote from: Materialjam on June 29, 2015, 08:47:31 PM
Moving on now to the transmitter, if the receivers become responsible for the capacity then I feel as though there should be two unique buildings if possible, one serving as a transmitter so that you can have shields in more than one portion of your base, and another building functioning to increase the range of a/the nearest transmitter?
That is a good idea and i have had it dancing around in my head for a while, but i never implemented it because i found the range of the shield to be good enough that it doesn't need booster. I might implemented it as a way of just increasing range, not in a relay way.

I don't have much time this week, so i will probably get started on some of these changes next week.
#17
Outdated / Re: [A11] Dimensional Nano Shield
June 29, 2015, 11:28:53 AM
Quote from: skyarkhangel on June 29, 2015, 11:07:21 AM
Quote from: projecttemp on June 27, 2015, 02:12:38 PM
I also try to look for the optimal variant:

      <Shield_MaxEnergy>300</Shield_MaxEnergy>
      <Shield_TicksPerInterval>15</Shield_TicksPerInterval>
      <Shield_EnergiesPerInterval>1</Shield_EnergiesPerInterval>


      <Shield_ResetCooldown>2000</Shield_ResetCooldown>
what it changes?

Ok. So.. then you can test with it:
      <Shield_MaxEnergy>300</Shield_MaxEnergy>
      <Shield_TicksPerInterval>15</Shield_TicksPerInterval>
      <Shield_EnergiesPerInterval>1</Shield_EnergiesPerInterval>
      <Shield_ResetCooldown>2000</Shield_ResetCooldown>

Not so cheatable.

Right now i have setting at:
250 max energy per shield
600 ticks(10 seconds) reform times

9 ticks per process cycle
3 energy per cycle(1 energy per 3 ticks)

Energy affect power cost
Material affect max energy
Material affect reform time

Shield takes 1.5 times damage
Shield efficiency is affected by material
Shield efficiency is affected by quality
Shield range is affected by material

I think this setting is quite balanced and with hardcore sk vindacium shield generator, it provides 875 energy and have a reform time of 2100 ticks(35 seconds). Also it cost 500 vindacium, so it is quite difficult to make.
#18
Outdated / Re: [A11] Dimensional Nano Shield
June 29, 2015, 09:36:52 AM
Quote from: projecttemp on June 27, 2015, 08:44:23 AM
Quote from: skyarkhangel on June 27, 2015, 12:29:28 AM
Needs active shield animation.

I was gonna make a shield animation, but this shield is form on your skin, there is nothing to show unless someone can teach me how to draw aura(which would be kind of cool). That's why it doesn't hinder your shooting. What i am thinking of trying to do is drawing a line from the shield wearer to the transmitter, this also helps to indicate range as well since this is a factor in shield usage.

I am going to update it with new balance suggestion, i have to go to work in a bit so i will try getting visual reference in on monday.

Edit: Updated with new download and major nerf  :'(, also a slight functionality changes to some of the options

Apparently drawing a line is pretty darn difficult in unity  ::) and i know how to draw an aura, but i just don't have access to the current pawn mesh(is probally set to be private), so i can only draw a circle. This is just like a visual indicator if the shield is on/off. :D

Anyhow, we now have visual reference for when the shield is available/unavilable. This will only show when the pawn is drafted/berserk and is not dead. Pawns that is incapacitate or in shock will still show up. It also shows on enemy pawns ;), but it should never be on an enemy pawn right?
#19
Hi, i got a mod that i want to draw some visual effects for, the effect i am thinking is line a sort of energy line or some sort of aura around the character. However i don't know how to draw lines in Rimworld, the thing i stumble upon is the LineRenderer, but it must be attach to a gameobject which i don't seems to have access to, any other way to do this? Maybe using drawlinker?

For aura, i was thinking of maybe changing the entire pawn's color(including apparel), like a color filter on Pawn and also drawing a label on top of the pawn's head. This only applied when the pawn is selected or is drafted.

#20
Outdated / Re: [A11] Dimensional Nano Shield
June 27, 2015, 02:12:38 PM
Quote from: skyarkhangel on June 27, 2015, 12:29:28 AM

I also try to look for the optimal variant:

      <Shield_MaxEnergy>300</Shield_MaxEnergy>
      <Shield_TicksPerInterval>15</Shield_TicksPerInterval>
      <Shield_EnergiesPerInterval>1</Shield_EnergiesPerInterval>


      <Shield_ResetCooldown>50</Shield_ResetCooldown>
what it changes?

The generator sub function will only run every 15 ticks. Each time the function run it generate 1 shield energy. All shield generator will have base energy of 300 multiply by material multiplier. When the shield is broken, it will take 50 ticks to reform. Each additional generator add 300 energy and 50 ticks to reform time.

The change will take effect once u restart and rebuild all generators.

Quote from: killer117 on June 27, 2015, 09:43:15 AM
Might wanna think about using techs to make the range increses and power increses, rather than just the matirial and quality. Just food for thought
I will write it down as possible todo, but shield energy stack with each generator built and you can create variant of the apparel that have different stats easily. Say a shield that have 150 range but takes 5 times damage for those who like to attack raiders who siege you.
#21
Outdated / Re: [A11] Dimensional Nano Shield
June 27, 2015, 08:44:23 AM
Quote from: skyarkhangel on June 27, 2015, 12:29:28 AM
Needs active shield animation.

I was gonna make a shield animation, but this shield is form on your skin, there is nothing to show unless someone can teach me how to draw aura(which would be kind of cool). That's why it doesn't hinder your shooting. What i am thinking of trying to do is drawing a line from the shield wearer to the transmitter, this also helps to indicate range as well since this is a factor in shield usage.

I am going to update it with new balance suggestion, i have to go to work in a bit so i will try getting visual reference in on monday.

Edit: Updated with new download and major nerf  :'(, also a slight functionality changes to some of the options
#22
Outdated / Re: [A11] Dimensional Nano Shield
June 26, 2015, 11:52:35 PM
Quote from: skyarkhangel on June 26, 2015, 10:33:30 PM
Tested with Hardcore SK:


10 mercenary gunners can't to reduce less than half of generator energy continuous shooting 3 colonists without cover  :o

Lol, it does need quite a bit of tweaking right now(luckily the tweaking are very easy to make). I just finished testing it not too long ago, so i didn't have much time to balance it. I wanted to post it to see if people would find any bug that needs fixing.

Try increase damage efficiency in apparel to like 2(this will double the damage the shield takes).
Then try setting ticks per interval to 6 and energy per interval to 3, this will reduce the shield regeneration to 0.5/tick.
These 2 changes combine cut the shield power down to 25% making it much much weaker.

Just keep in mind any change to the shield generator XML require old generator to be destroy and rebuild to take effect. Apparel shield can take effect after restart.
#23
Outdated / Re: [A11] Dimensional Nano Shield
June 26, 2015, 09:00:23 PM
Great to see you are the first person to post on my mod, i love your modpack. It make Rimworld worth replaying again and again.
#24
Outdated / [A11b] Dimensional Nano Shield
June 26, 2015, 07:17:26 PM
Hello guys, this is my first mod and it involves one of my favorite item in Rimworld, PERSONAL SHIELD!

That why i made an overpowered version of it just for myself and for anyone who share this love. I call this, the dimensional nano shield. So lets start listing all the imbalanced perk it has.

- This shield is form on your skin layer(hence nano shield), so it does not block you from attacking enemies using either ranged or melee attack
- This shield is very strong, it can absorb even melee damage. Thought it can't help you if you get cut open by your bad doctor.
- This shield gets it's shield energy via a powerful receiver. The transmitter is another building you have to build that also serve as shield energy generator.
- The shield efficiency can varies depend on material and quality of the shield. Better quality and better material = less energy lost per damage.
- The shield have limited range of 20 squares from main transmitter, this is increase by using better material to make it. Quality have no effect.
- Any changes to the shield apparel XML require game to be restart only

Now onto the shield generator, which basically creates these artificial hit points out of pure raw power.

- The first generator you build becomes the main transmitter for all the nano shield.
- The shield can only absorb so much damage, if it ran out of energy, it will be in a broken state and will take time to reform.
- When the shield is in broken state, it obviously can't protect those shield user from anything, so be very careful.
- Subsequent shield generator will increase the maximum amount of shield energy that can be stored, so it doesn't break as easily.
- However, subsequent shield generator also increase the amount of time it takes to reform the shield if it is ever broken. Larger shield = takes more time to reform.
- When a shield generator is destroyed or power off, it will not longer provided shield energy bonus, but nor will it increase reform time.
- If the main transmitter is destroyed or powerful, the shield will loses all it's energy and no longer charge. It will be in a disabled state.
- When the shield is in disabled state, any shield generator can become the main transmitter automatically. This will restart the shield with 1% of it's max energy. Colonist needs to be also within the range of this new transmitter for the shield to function.
- The generator also have a shield around itself, using same shield energy to protect itself from damage.
- The amount of shield energy provided by the generator is affected by the material it is made of.
- When the shield is charging or reforming, it requires the amount of power listed in XML. When it reached full energy, it only requires 1/5 of that.
- Any changes to the shield generator XML require the game to restart and the generators to be destroyed and rebuild.

TL;DR Is an amazing shield, but only if you stay within the range of the shield generator.
(Also i am bad with graphic stuff, so just live with the default ship power generator as texture :D )

A shield without any generators, so it just turns red


Darkeye is within range of the generator(14), but Levin is not within range. Carrie just have a better shield than you guys do, suck it up


Version 1.3
>>Download Link<<
Did i mention the shield is imba? And it can't be toggle off... so if one of them goes berserk... well... lets hope that doesn't happen.
Just post in here if you have any suggestions for improvement or any bugs you ran into.

Customization
- The apparel shield's range and efficiency can be changes in XML.
- The apparel shield's bonus from material and quality can also be toggle on or off in XML.

- The default energy granted by each shield building can be changed in XML
- The default reform times(in ticks) increase by each building can be changed in XML
- How often the shield ticks can be changed in XML(higher tick value increase performance, but at cost of responsiveness and damage vulnerabilities) Default is one process cycle per 9 ticks.
- How much energy is granted to the shield per tick interval can be changed in XML. This s flat across the board, building more shield generator will not cause it to regenerate faster. Default is 3 energies restore per interval of 9 ticks(1 energy/ 3 ticks).

- There is a option in XML for adding the maximum shield energy times 2 as power cost to all generators. This also get reduced to 20% during sustain mode.
- There is a option in XML for making reform time scale with the material multiplier to the energy as well.
- By default, better material will create a shield generator that provide more energy. This can be toggle off.

Todo(i kind of lost the motivation to work on this as i feel is quite complete, so these might have to wait):
Add images -.-
Make a button to change main transmitter as will.
Make a minified version of the generator.
Visually show the range of each shield somehow(say with a green line?)
Add some research to increase energy and range.
Add additional building that increase range/energy/regen/reform rate.
Make some proper texture for it(probably never happen).

I also got to thank Haplo for helping me fixing that nasty save/load bug. Thank you.
I was using Hardcore SK in the pic, so u see the nuclear power generator and copper. (You should get it if you don't have it)

Permission and License:
I haven't made up anylicences yet, just ask me if you want to use it in something.
#25
Help / Re: Variable not being loaded properly
June 26, 2015, 06:24:54 PM
Knowing this, it was a very easy fix to it. Now i can release my mod.
#26
Help / Re: Variable not being loaded properly
June 26, 2015, 04:57:56 PM
Quote from: Haplo on June 26, 2015, 04:38:41 PM
The problem is most likely this in your ReadXMLDatas() part:
generatorEnabled = false;

SpawnSetup() is called AFTER ExposeData() when you load a game..

Thank you, this help fixed. I always thought SpawnSetup was only called during first time it was created. I wish they have a wiki for modding this like for skyrim.
#27
Help / Re: Variable not being loaded properly
June 26, 2015, 04:15:42 PM

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using Verse;
using RimWorld;
using UnityEngine;

namespace IntergratedMods_DS
{
    public class Building_DimensionalShield : Building
    {
        #region Variables
        public enum DShieldStates
        {
            Disabled,
            Broken,
            Charging,
            Sustaining
        };

        //Global variables for all the shields combined
        public static int energy = 0;
        public static int maxEnergy = 0;

        private static int energiesPerInterval = 0;
        private static int ticksPerInterval = 0;

        private static int resetCooldown = 0;
        public static int resetCounter = 0;

        public static DShieldStates shieldMode = DShieldStates.Disabled;
        public static Building_DimensionalShield mainShield = null;

        private static bool energyToPowerCost = false;
        private static bool stuffMultiplier = false;
        private static bool cooldownScale = false;

        //Private variables for each individual shield building
        private int maxEnergyContrib = 0;
        private int resetCooldowContrib = 0;

        private int energiesPerIntervalContrib = 0;
        private int intervalCounter = 0;

        private CompPowerTrader powerComp = null;
        private float originalPowerCost = 0;

        private bool generatorEnabled = false;
        private bool thisIsMainShield = false;
        #endregion

        //Do not re-read the data on load, else it will just mess up the calculation
        private void ReadXMLDatas()
        {
            if (def is Thing_DimensionalShield_Gen)
            {
                Thing_DimensionalShield_Gen given = this.def as Thing_DimensionalShield_Gen;

                if (shieldMode == DShieldStates.Disabled)
                {
                    energyToPowerCost = given.Shield_EnergyToPowerCost;
                    stuffMultiplier = given.Shield_StuffMultiplier;
                    cooldownScale = given.Shield_CooldownScale;

                    ticksPerInterval = given.Shield_TicksPerInterval;
                }

                if (stuffMultiplier && this.Stuff != null)
                {
                    maxEnergyContrib = (int)(given.Shield_MaxEnergy + this.Stuff.stuffProps.statOffsets.GetStatOffsetFromList(StatDefOf.MaxHitPoints));
                    maxEnergyContrib = (int)(maxEnergyContrib * this.Stuff.stuffProps.statFactors.GetStatFactorFromList(StatDefOf.MaxHitPoints));
                }
                else
                    maxEnergyContrib = given.Shield_MaxEnergy;

                if (cooldownScale)
                    resetCooldowContrib = maxEnergyContrib / 3;
                else
                    resetCooldowContrib = given.Shield_ResetCooldown;

                energiesPerIntervalContrib = given.Shield_EnergiesPerInterval;

                generatorEnabled = false;
                intervalCounter = 0;
            }
            else
            {
                Log.Error("The building is not of \"Thing_DimensionalShield_Gen\"");
            }
        }

        #region Disable Functions
        //Just in case some stupidity does occur for whatever reasons.
        private void SanityCheck()
        {
            if (energiesPerInterval < 0)
            {
                energiesPerInterval = 0;
            }

            if (maxEnergy < 0)
            {
                maxEnergy = 0;
            }

            if (resetCooldown < 0)
            {
                resetCooldown = 0;
            }
        }

        //Disabling the contribution provided by main generator
        private void MainDisableGen()
        {
            if (generatorEnabled)
            {
                mainShield = null;
                thisIsMainShield = false;
                generatorEnabled = false;

                energiesPerInterval -= energiesPerIntervalContrib;

                maxEnergy -= maxEnergyContrib;
                resetCooldown -= resetCooldowContrib;

                ShutdownShield();

                SanityCheck();
            }
        }

        //Disabling the contribution provided by sub generators
        private void SubDisableGen()
        {
            if (generatorEnabled)
            {
                generatorEnabled = false;

                maxEnergy -= maxEnergyContrib;
                resetCooldown -= resetCooldown;

                energy -= maxEnergyContrib;

                if (energy <= 0)
                {
                    BreakShield();
                }

                SanityCheck();
            }
        }
        #endregion

        #region Enable Functions
        //Turn this building into main shield and enable it's full contribution
        private void EnableMainGen()
        {
            mainShield = this;
            thisIsMainShield = true;

            //If the shield just started, then we add all the stuff to it
            if (!generatorEnabled)
            {
                generatorEnabled = true;

                energiesPerInterval += energiesPerIntervalContrib;

                maxEnergy += maxEnergyContrib;
                resetCooldown += resetCooldowContrib;
            }
            else
                //But if the shield is already sub and takeover, we just add regen
                energiesPerInterval += energiesPerIntervalContrib;

            energy = Math.Max((maxEnergy / 100), 1);
            shieldMode = DShieldStates.Charging;
        }

        //Enable only half the contribution this shield provides
        private void EnableSubGen()
        {
            if (!generatorEnabled)
            {
                thisIsMainShield = false;
                generatorEnabled = true;

                maxEnergy += maxEnergyContrib;
                resetCooldown += resetCooldowContrib;

                if (shieldMode == DShieldStates.Sustaining)
                {
                    shieldMode = DShieldStates.Charging;
                }
            }
        }
        #endregion

        #region Regular Functions
        //Simple function for doing reset counting.
        private void ResetShield()
        {
            resetCounter -= ticksPerInterval;

            if (resetCounter <= 0)
            {
                energy = Math.Max((maxEnergy / 100), 1);
                shieldMode = DShieldStates.Charging;
            }
        }

        //Simple function for doing regular shield charging.
        private void ChargeShield()
        {
            energy += energiesPerInterval;

            if (energy > maxEnergy)
            {
                shieldMode = DShieldStates.Sustaining;
                energy = maxEnergy;
            }
        }
        #endregion

        #region State Functions
        //Support function for stopping the shield.
        public static void ShutdownShield()
        {
            shieldMode = DShieldStates.Disabled;
            energy = 0;
        }

        //Support function for when the shield is broken throught.
        public static void BreakShield()
        {
            shieldMode = DShieldStates.Broken;
            resetCounter = resetCooldown;
            energy = 0;
        }
        #endregion

        #region Damage Function
        //Function for everything to damage the shield
        public static void DamageShield(int amount)
        {
            energy -= amount;

            if (energy < 0)
            {
                BreakShield();
            }
            else
            {
                shieldMode = DShieldStates.Charging;
            }
        }
        #endregion

        //On spawn, get the power component reference
        public override void SpawnSetup()
        {
            base.SpawnSetup();

            powerComp = GetComp<CompPowerTrader>();

            ReadXMLDatas();

            if (energyToPowerCost)
                originalPowerCost = -maxEnergyContrib;
            else
                originalPowerCost = powerComp.PowerOutput;
        }

        public override void Destroy(DestroyMode mode = DestroyMode.Vanish)
        {
            if (thisIsMainShield)
                MainDisableGen();
            else
                SubDisableGen();

            base.Destroy(mode);
        }

        public override void Tick()
        {
            base.Tick();

            intervalCounter++;

            if (intervalCounter >= ticksPerInterval)
            {
                intervalCounter = 0;

                if (shieldMode == DShieldStates.Charging)
                {
                    #region Charging State
                    if (thisIsMainShield)
                    {
                        if (powerComp != null)
                        {
                            if (!powerComp.PowerOn)
                            {
                                MainDisableGen();
                                return;
                            }
                            else
                            {
                                powerComp.powerOutputInt = originalPowerCost;
                            }
                        }

                        ChargeShield();
                    }
                    else
                    {
                        if (powerComp != null)
                        {
                            if (!powerComp.PowerOn)
                            {
                                SubDisableGen();
                                return;
                            }
                            else
                            {
                                powerComp.powerOutputInt = originalPowerCost;
                                EnableSubGen();
                            }
                        }
                    }
                    #endregion
                }
                else if (shieldMode == DShieldStates.Sustaining)
                {
                    #region Sustaining State
                    if (thisIsMainShield)
                    {
                        if (powerComp != null)
                        {
                            if (!powerComp.PowerOn)
                            {
                                MainDisableGen();
                                return;
                            }
                            else
                            {
                                powerComp.powerOutputInt = originalPowerCost / 5.0f;
                            }
                        }
                    }
                    else
                    {
                        if (powerComp != null)
                        {
                            if (!powerComp.PowerOn)
                            {
                                SubDisableGen();
                                return;
                            }
                            else
                            {
                                powerComp.powerOutputInt = originalPowerCost / 5.0f;
                                EnableSubGen();
                            }
                        }
                    }
                    #endregion
                }
                else if (shieldMode == DShieldStates.Broken)
                {
                    #region Broken State
                    if (thisIsMainShield)
                    {
                        if (powerComp != null)
                        {
                            if (!powerComp.PowerOn)
                            {
                                MainDisableGen();
                                return;
                            }
                            else
                            {
                                powerComp.powerOutputInt = originalPowerCost;
                            }
                        }

                        ResetShield();
                    }
                    else
                    {
                        if (powerComp != null)
                        {
                            if (!powerComp.PowerOn)
                            {
                                SubDisableGen();
                                return;
                            }
                            else
                            {
                                powerComp.powerOutputInt = originalPowerCost;
                                EnableSubGen();
                            }
                        }
                    }
                    #endregion
                }
                else if (shieldMode == DShieldStates.Disabled)
                {
                    #region Disabled State
                    if (powerComp != null)
                    {
                        if (powerComp.PowerOn)
                        {
                            EnableMainGen();
                        }
                    }
                    else
                    {
                        EnableMainGen();
                    }

                    return;
                    #endregion
                }
            }
        }

        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine(base.GetInspectString());

            if (thisIsMainShield)
            {
                stringBuilder.AppendLine("Main Shield!");

                if (shieldMode == DShieldStates.Disabled)
                {
                    stringBuilder.AppendLine("Shield State: Disabled");
                }
                else if (shieldMode == DShieldStates.Broken)
                {
                    stringBuilder.AppendLine("Shield State: Broken");
                    stringBuilder.AppendLine("Reform Time: " + resetCounter);
                }
                else if (shieldMode == DShieldStates.Charging)
                {
                    stringBuilder.AppendLine("Shield State: Charging");
                    stringBuilder.AppendLine("Energy: " + energy + "/" + maxEnergy);
                }
                else if (shieldMode == DShieldStates.Sustaining)
                {
                    stringBuilder.AppendLine("Shield State: Sustaining");
                    stringBuilder.AppendLine("Energy: " + energy + "/" + maxEnergy);
                }
            }
            else
            {
                if (generatorEnabled)
                {
                    stringBuilder.AppendLine("Sub Shield: Enabled");

                    if (shieldMode == DShieldStates.Disabled)
                    {
                        stringBuilder.AppendLine("Shield State: Disabled");
                    }
                    else if (shieldMode == DShieldStates.Broken)
                    {
                        stringBuilder.AppendLine("Shield State: Broken");
                        stringBuilder.AppendLine("Reform Time: " + resetCounter);
                    }
                    else if (shieldMode == DShieldStates.Charging)
                    {
                        stringBuilder.AppendLine("Shield State: Charging");
                        stringBuilder.AppendLine("Energy: " + energy + "/" + maxEnergy);
                    }
                    else if (shieldMode == DShieldStates.Sustaining)
                    {
                        stringBuilder.AppendLine("Shield State: Sustaining");
                        stringBuilder.AppendLine("Energy: " + energy + "/" + maxEnergy);
                    }
                }
                else
                    stringBuilder.AppendLine("Sub Shield: Disabled");
            }

            return stringBuilder.ToString();
        }

        public override void ExposeData()
        {
            base.ExposeData();

            Scribe_Values.LookValue<int>(ref maxEnergyContrib, "maxEnergyContrib");
            Scribe_Values.LookValue<int>(ref resetCooldowContrib, "resetCooldowContrib");

            Scribe_Values.LookValue<int>(ref energiesPerIntervalContrib, "energiesPerIntervalContrib");
            Scribe_Values.LookValue<int>(ref intervalCounter, "intervalCounter");

            Scribe_Values.LookValue<float>(ref originalPowerCost, "originalPowerCost");
            Scribe_Values.LookValue<bool>(ref generatorEnabled, "generatorEnabled");
            Scribe_Values.LookValue<bool>(ref thisIsMainShield, "thisIsMainShield");

            Scribe_References.LookReference<Building_DimensionalShield>(ref mainShield, "Main_Shield");

            Scribe_Values.LookValue<DShieldStates>(ref shieldMode, "shieldMode");
            Scribe_Values.LookValue<bool>(ref energyToPowerCost, "energyToPowerCost");
            Scribe_Values.LookValue<bool>(ref stuffMultiplier, "stuffMultiplier");
            Scribe_Values.LookValue<bool>(ref cooldownScale, "cooldownScale");

            Scribe_Values.LookValue<int>(ref energy, "energy");
            Scribe_Values.LookValue<int>(ref maxEnergy, "maxEnergy");

            Scribe_Values.LookValue<int>(ref resetCooldown, "resetCooldown");
            Scribe_Values.LookValue<int>(ref resetCounter, "resetCounter");

            Scribe_Values.LookValue<int>(ref energiesPerInterval, "energiesPerInterval");
            Scribe_Values.LookValue<int>(ref ticksPerInterval, "ticksPerInterval");
        }
    }
}
#28
Help / Re: Variable not being loaded properly
June 26, 2015, 04:02:23 PM
ExposeData is actually the last function on my class
#29
Help / Variable not being loaded properly
June 26, 2015, 02:10:09 PM
For some unknown reason, there is this ONE variable that refuse to load and just give me default value every time.


public override void ExposeData()
        {
            base.ExposeData();

            Scribe_Values.LookValue<int>(ref maxEnergyContrib, "maxEnergyContrib");
            Scribe_Values.LookValue<int>(ref resetCooldowContrib, "resetCooldowContrib");

            Scribe_Values.LookValue<int>(ref energiesPerIntervalContrib, "energiesPerIntervalContrib");
            Scribe_Values.LookValue<int>(ref intervalCounter, "intervalCounter");

            Scribe_Values.LookValue<float>(ref originalPowerCost, "originalPowerCost");
            Scribe_Values.LookValue<bool>(ref generatorEnabled, "generatorEnabled", false, true);
            Scribe_Values.LookValue<bool>(ref thisIsMainShield, "thisIsMainShield", false, true);

            if (thisIsMainShield)
            {
                Scribe_References.LookReference<Building_DimensionalShield>(ref mainShield, "Main_Shield");

                Scribe_Values.LookValue<DShieldStates>(ref shieldMode, "shieldMode");
                Scribe_Values.LookValue<bool>(ref energyToPowerCost, "energyToPowerCost");
                Scribe_Values.LookValue<bool>(ref stuffMultiplier, "stuffMultiplier");
                Scribe_Values.LookValue<bool>(ref cooldownScale, "cooldownScale");

                Scribe_Values.LookValue<int>(ref energy, "energy");
                Scribe_Values.LookValue<int>(ref maxEnergy, "maxEnergy");

                Scribe_Values.LookValue<int>(ref resetCooldown, "resetCooldown");
                Scribe_Values.LookValue<int>(ref resetCounter, "resetCounter");

                Scribe_Values.LookValue<int>(ref energiesPerInterval, "energiesPerInterval");
                Scribe_Values.LookValue<int>(ref ticksPerInterval, "ticksPerInterval");
            }
        }


The variable in this case is "generatorEnabled", i tried changing the name already and it still wouldn't load properly. This only seems to happen if "thisIsMainShield" is actually set. Sub shield with "thisIsMainShield" not set save and load "generatorEnabled" properly.

Edit: It seems this one variable is not being loaded across the board for all structure of this type, the save file show that it is being saved correctly, but when i load and then immediately save again, the variable is no longer true.

Even when i take out the if (thisIsMainShield), it still fail.
#30
Help / Re: Mod corpses as a thing
June 24, 2015, 07:07:54 PM
Wow, thank you very much. This was a very helpful learning experience.