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

Topics - projecttemp

#1
Help / [DLL] Updating mods
February 05, 2017, 08:21:24 AM
Hi guys, i am currently trying to update some of my personal mods and i ran into some problems with function names since i skipped a few version. It would be great if you guys can point me in the right direction.

1. All the function that requires map as parameter i can just used this.map or this.wearer.map right?

2. Faction.ofColony is Faction.ofPlayer now right?

3. What happened to HediffSet.RestorePart? How do i heal missing part now?

4. What happened to listerPawn.PawnsHostileToColony? I know is this.map.mapPawns now, but it lack any function to detect hostile.

5. How do i get the SoundInfo for the function PlayOneShot? Do i just make a new empty SoundInfo?

Thanks for the help in advance.
#2
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.

#3
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.
#4
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.
#5
Help / Mod corpses as a thing
June 23, 2015, 07:14:57 PM
Hi, i recently started modding and there is one things that i don't know how to do.

-How to mod the corpse of all the units? This seems to be auto generated, but i want to give them a deterioration rate like other items, so after 100 days they get destroy instead of hanging around as bones.