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 - WorldOfIllusion

#1
General Discussion / May 1'st changelog
May 01, 2014, 08:24:57 PM
QuoteMay 1
Mechanoid raids.Created charge blaster and inferno cannon weapons for mechanoids.

Having a look at the changelog and I saw this.

Don't know about you, but inferno cannon sounds terrifying to me.
#2
Outdated / [MOD] (Alpha 3f) Rotating Hoppers
April 30, 2014, 12:50:13 AM
Makes vanilla hoppers automatically rotate to face their connected nutrient paste dispenser.
Download is the attached file on this post (or here).

Source code is included, if you use it send me a PM and let me know (and a mention would be appreciated :) ).

[attachment deleted by admin: too old]
#3
Ideas / Automatically rotate hoppers (code included)
April 28, 2014, 09:13:49 PM
While working on a mod I created a small bit of code that rotates a thing so that it faces the correct way when connecting to another specific structure. This could very easily be added to the vanilla hoppers, so that they rotate to face an adjacent Nutrientpaste dispenser when placed. Just add a call to the following method to the post make method of the hopper:
        public void rotateToInterface()
        {
            foreach (IntVec3 adj in GenAdj.AdjacentSquaresCardinalInBounds(Position))
            {
                foreach (Thing thing in Find.Grids.ThingsAt(adj))
                {
                    Building temp = thing as Building;
                    if (temp != null)
                    {
                        if (temp.canConnect) // change this to be the correct 'rotation' restriction (eg, is nutrient past dispenser)
                        {
                            this.rotation = getConnectingSide(this.Position, temp.Position);
                        }
                    }
                }
            }
        }

        public IntRot getConnectingSide(IntVec3 child, IntVec3 parent)
        {
            // x = left/right map
            // y = up/down layer
            // z = up/down map
            if (parent.x > child.x) return IntRot.east;
            if (parent.x < child.x) return IntRot.west;
            if (parent.z > child.z) return IntRot.north;
            return IntRot.south;
        }

Also, if any modders want to use this, feel free (just send me a PM when you release the mod so I can have a look).

*edit* can probably even remove the foreach thing bit and change it to just check the building grid for the building at each position.
#4
Bugs / GenHaulAI and custom storage buildings
April 27, 2014, 01:10:03 AM
The method HaulMaxNumToSquareJob in GenHaulAI is hardcoded so that it will only work properly with buildings that use/extend the class Building_Storage.
As such, any modded buildings that do not extend this (but properly implement SlotGroupParent) will sometimes get delivered more resources than they can hold, which creates two stacks of the resource that was being delivered (and puts them both on the one tile).

This is causing some pretty bad problems for the mod i'm making (and converting my current storers to extend the Building_Storage as a workaround will mean I need to implement a whole heap of nasty code).

I'd suggest changing the restriction from Building_Storage to checking if there is a SlotGroup/SlotGroupParent.
#5
Help / On Storage (SlotGroupParent) and ITab_Storage
April 26, 2014, 11:17:20 AM
I have been working on making something with functionality similar to a hopper. In doing so, I have implemented the interface SlotGroupParent that seems to be responsible for storage in rimworld. I have implemented all the methods as they have been implemented in Building_Storage (I think, will add code below).
Here's where the issue is. I want to then implement the ITab_Storage so that users can designate what will be stored in the building.
XML Excerpt:
<fixedStorageSettings>
<priority>Normal</priority>
<allowances>
<categories>
<li>Manufactured</li>
<li>ResourcesRaw</li>
</categories>
</allowances>
</fixedStorageSettings>
<defaultStorageSettings>
<priority>Normal</priority>
<allowances>
<categories>
<li>Manufactured</li>
<li>ResourcesRaw</li>
</categories>
</allowances>
</defaultStorageSettings>
<inspectorTabs>
<li>UI.ITab_Storage</li>
</inspectorTabs>


Code implementing SlotGroupParent:
    public class Accessor : DBuilding, SlotGroupParent
    {
        public Enum.accessorMode mode
        {
            get
            {
                return ((Digitisation.AccessorProperties)def).mode;
            }
        }
        public int speed
        {
            get
            {
                return ((Digitisation.AccessorProperties)def).speed;
            }
        }
        public ThingDef item;
        public StorageSettings settings;
        public SlotGroup slotGroup;
        private List<IntVec3> cachedOccupiedSquares;

        public override void SpawnSetup()
        {
            base.SpawnSetup();
            slotGroup = new SlotGroup(this);
            cachedOccupiedSquares = this.AllSlotSquares().ToList<IntVec3>();
        }

        public override void PostMake()
        {
            base.PostMake();
            settings = new StorageSettings(this);
            if (def.defaultStorageSettings != null)
                settings.CopyFrom(def.defaultStorageSettings);
        }

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

        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Deep.LookDeep<StorageSettings>(ref settings, "settings", this);
        }

        public override void Destroy()
        {
            slotGroup.Notify_ParentDestroying();
            base.Destroy();
        }

        public virtual IEnumerable<IntVec3> AllSlotSquares()
        {
            foreach (IntVec3 sq in GenAdj.SquaresOccupiedBy(this))
            {
                yield return sq;
            }
        }

        public List<IntVec3> AllSlotSquaresListFast()
        {
            return cachedOccupiedSquares;
        }

        public StorageSettings GetParentStoreSettings()
        {
            return def.fixedStorageSettings;
        }

        public StorageSettings GetStoreSettings()
        {
            return settings;
        }

        public void Notify_LostThing(Thing newItem)
        {
           
        }

        public void Notify_ReceivedThing(Thing newItem)
        {
           
        }

        public string SlotYielderLabel()
        {
            return Label;
        }

*note* DBuilding just extends Building

Now, when I click to open the UI the game's control freezes (colonists move in background but I can't click anything) and the log gets filled with the following over and over:
InvalidCastException: Cannot cast from source type to destination type.
  at UI.ITab_Storage.FillTab () [0x00000] in <filename unknown>:0

  at UI.ITab.DoTabGui () [0x00000] in <filename unknown>:0

  at UI.InspectPane.DoTabs (IEnumerable`1 tabs) [0x00000] in <filename unknown>:0

  at UI.InspectPane.InspectPaneOnGUI () [0x00000] in <filename unknown>:0

  at UI.TabInspect.PanelOnGUI (Rect fillRect) [0x00000] in <filename unknown>:0

  at UI.UIPanel.PanelOnGUI () [0x00000] in <filename unknown>:0

  at UI.MainTabsRoot.GameControlsOnGUI () [0x00000] in <filename unknown>:0

  at UI.UIMapRoot.UIRootOnGUI () [0x00000] in <filename unknown>:0

  at Root.OnGUI () [0x00000] in <filename unknown>:0

(Filename:  Line: -1)


Not sure what I'm doing wrong or what's really going on here. Any help at all would be appreciated.
#6
Help / Saving extra data
April 25, 2014, 02:59:31 AM
I've been working on a mod that requires me to save some extra information in the rimworld save.

I've worked out how to save simple things, like an int or bool or string. What I need is to save something more complex, for example an object that contains:

  • an array of objects that have a thingDef and an int
  • some other basic data types
Wondering if there's an easy way to save this? Or should I just go and save each part of the object as a simple data type and then reassemble them into the original object on load.
#7
Ideas / Modding tool: add Map components
April 23, 2014, 04:26:28 AM
It'd be useful if there were support added so that we could create components that were then called/held by the Map class and updated whenever MapUpdate() was called. Potentially some XML file which we can use to specify a class and method to be created and run by the Map class.

The reason why I ask: I'm currently trying to make a mod which implements a new Manager, and trying to get it to 'tick' properly from one of its components being ticked by the tickManager is hurting my head a little (and will probably lead to a couple of missed ticks in certain strange cases & hopefully no NullRef's). That said, I may just be doing it wrong.

Not even thinking about how to get the game to save the extra data I need yet.
#8
Help / Questions regarding PowerNet's
April 22, 2014, 02:02:25 AM
I've been working on a mod that will use a system like the currently implemented PowerNet. In looking through the decompiled code I have come across a couple of parts I don't quite understand, which hopefully someone here can help me with!

Firstly, where do PowerNet's get created from? There's the method 'UpdatePowerNetsAndConnections_First()' in PowerNetManager, but what calls this? Also, is this the method that is called every time a network needs to be updated/created/destroyed (the '_First' part of the name implies not, but I haven't found anything else that does)?

Secondly, in the above mentioned method, why does it check the AdjacentSquaresCardinal in the PowerNetGrid for existing power nets for the old and new transmitters? From what I have looked at, I thought that the PowerNetGrid covered the buildings that were transmitters only (and doesn't include the (possibly empty) squares around them)?

That's all my questions... for now.
#9
Help / Texture Help!
April 21, 2014, 09:21:06 AM
I have been working on a mod called 'Digitisation'. This mod will add a couple of new resources to rimworld such as oil, plastic and (probably) crystal. More importantly, it will add a way for you to digitally store, access and transport items over digital networks that you will be able to create (and more!).
As it stands, I have very little skill in making textures, so I am asking for any help I can get. If you can help me by make some textures for this, you will get credited in the mod (and join the mod team if you like), and will get a say in how the mod develops. Any help is appreciated :)
Feel free to PM me (or comment here) if you are interested (or know someone who might be).
#10
Help / Issue with decompiled thingClass Plant
April 11, 2014, 09:48:28 PM
With Alpha 3 arriving I decided to have a look through how everything worked, with an intention of making some modifications.

Started by looking on the forums and found that most modders used a program ILSpy to decompile the game DLL's. When I decompiled the Plant class of the Assembly-CSharp DLL, I encountered an issue (that I assume is due to an incorrect decompile).

In the method: PrintOnto
switch (maxMeshCount)
{
case 1:
num3 = 1;
goto IL_F3;
case 2:
case 3:
IL_96:
if (maxMeshCount == 9)
{
num3 = 3;
goto IL_F3;
}
if (maxMeshCount == 16)
{
num3 = 4;
goto IL_F3;
}
if (maxMeshCount != 32)
{
Log.Error(this.def + " must have plant.MaxMeshCount that is a perfect square.");
goto IL_F3;
}
num3 = 5;
goto IL_F3;
case 4:
num3 = 2;
goto IL_F3;
}
goto IL_96;


The error that I get is due to the goto IL_96 call and the corresponding IL_96 tag which it thinks is unreferenced (in the code it is within the scope of the switch case while the goto call is outside of it).

Wondering what the actual code is? Or if this is intended (and thus how it works)?
#11
Help / Custom Porperties for ThingDef's
April 11, 2014, 02:59:37 AM
Been trying out some of the new modding tools from Alpha 3, namely the ability to add custom assemblies.

Was wondering how to go about adding a new property that is loaded in from the XML, to be used by your custom code. It seems that what properties are available are set in the various classes such as PlantProperties, but I'm not sure what controls that being the class/properties that are loaded for Plants. Also, if I then just overwrite the default class that designates available properties, will that cause issues for compatibility with other mods?
#12
Ideas / <plantable> for Plants
March 14, 2014, 01:38:51 AM
Would be nice if there was a plantable element that controlled whether or not a plant could be grown in a growing zone (or other area/object that grows plants).
#13
General Discussion / [MOD] (Alpha 2) Glowroot
March 04, 2014, 06:10:18 AM
Glowroot 0.1.0



Description:

This mod adds a new plant called Glowroot that can then be harvested and used to create structures, that, wait for it... glow!

Features:
  • Glowroot plant, resource, structures
  • New research
  • Truly awful  wonderful textures (the textures used are essentially placeholders, if you have artistic skill and can make some nicer looking textures I would be super happy/thankful)
Mod Team:
Download:


Screens:





How to install:

- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mod in the mod menu in the game.

Notes:

Unfortunately, with the restrictions of Alpha 2 this mod makes some concessions:
  • Glowroot doesn't glow when in plant form, this is due to restrictions to do with thingClass that shouldn't be an issue in Alpha 3
  • Glowroot Wall currently produces a tiny amount of power, once again due to restrictions to do with thingClass (things that glow in Alpha 2 also need to use/create power)
There are more features planned for this mod, however I think that they will have to wait for Alpha 3.

Changelog:
  • 0.1.0: released!



[attachment deleted by admin: too old]
#14
Help / Modifying eType and thingClass
March 02, 2014, 06:39:07 AM
First off, sorry if this has been asked before.
Secondly, my actual question. Is there a way to modify an eType to include aspects from another eType (and similarly for thingClass)? For example, I want to have a Plant eType with some of the aspects of BuildingComplex eType.
Or, rather than this is there a way to give a definition multiple eType's and multiple thingClass's to avoid having to modify the eType's/thingClass's at all?
#15
Outdated / [MOD] (Alpha 2) E-Hydroponics
February 28, 2014, 09:19:03 PM
E-Hydroponics



Description:
This really simple mod adds two extra hydroponics benches that grow agave and berries rather than potatoes (which you can build after researching 'advanced hydroponics').

Features:
  • new research 'advanced hydroponics'
  • hydroponics benches that grow berries and agave

Mod Team:
Download:


Screens:


How to install:
- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mod in the mod menu in the game.

Notes:
  • Ideally this would be done using a system like adding an infinite bill to a hydroponics basin dictating what crop type to grow, but this current solution is much easier to implement.
  • Currently agave isn't automatically harvested, must instead be harvested by user order.

Changelog:


[attachment deleted by admin: too old]