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

#1591
Help / Re: Make something similar to a steam geyser
August 23, 2014, 05:58:52 AM
dont wonder, just test it self


    <placementRestricters>
      <li>PlacementRestricter_OnSteamGeyser</li>
    </placementRestricters>
#1592
Help / Re: A beginner with modding/code
August 22, 2014, 09:00:13 PM
1) You don't need to know Unity as long as not going to write custom rendering or custom GUI or play with sound.
RimWorld uses unity for rendering and sound only, everything else is pure c#.

2) Since you not coded before it will be impossible for you to learn from decompiled source code directly, you will waste your time.
My suggestion is to download every single mod posted (only few have no source embedded) and research source code of that mods.
After dark matter generator you should code dark matter battery, dark matter food dispencer and so on.
After you mastered basics - go to source code.

3) There is no need in tutorials dedicated directly to RimWorld, open any tutorial about c# on web and read it.

4) SpawnSetup(){} is build in c#.
you can understand how code flow by simply invoking code like "log.error(enviroment.stacktrace)" inside method you do not understand.
Stacktrace will give you source of invocation and allow you to trace how it works without debugger.

but this only after you tapped into basics.
#1593
Quotefinally got
Looks like everyone ignoring my posts on this forum.
#1594
QuoteWho normal person could read all pages for once post?
Being stupid is not normal on forums dedicated to development.

Nice sample of "who normal person could read sticky threads (there are 4 threads total less then single page each)"
https://forums.bukkit.org/threads/running-into-a-ambigous-gethealth-prolblem-is-there-a-fix.299984/
#1595
Help / Re: Are new humanoid textures possible?
August 22, 2014, 11:39:52 AM
custom draw method and you can render whatever you like.
#1596
Ideas / Re: I want to make Robocop
August 22, 2014, 11:19:06 AM
Everything sci-fi go warhammer over time, this unavoidable.
#1597
Ideas / Re: I want to make Robocop
August 22, 2014, 07:49:10 AM
A7 likely to feature "i never asked for this" by default ever without any suggestions.

and change log looks like:
"it will be possible to set bonuses-penalties for all equipment"

so expect "robotic finger +10 to melee damage"
#1598
Ideas / Re: Take the war to your enemies door step.
August 22, 2014, 07:43:44 AM
And what after you wiped all tribes\ pirates\ mechanoids?
#1599
you must place your xml into subfolder ThigDefs

also you can read my article about database assembler generic rules here:
http://ludeon.com/forums/index.php?topic=5641.0
#1600
If you watch closely on "building" process you will notify clear difference in object just placed (blueprint), object in building process and finished object.

they all are different things of different type.
also they are different objects at all.

you dont need to check is "building" under construction, becouse building exists only after construction is finished.
Before construction is finished, this is "Blueprint", not Building.
#1601
@Neurotoxin
Such systems do require support from "base" types, application must be initially designed to support proxies.
They not allow to write magic method that will hook arbitrary method of arbitrary type.
This possible with native level code only - read as dirty hacks.

But...
when base type is replaced with native code - its end and nothing else is required for work.
#1602
Help / Re: Make something similar to a steam geyser
August 21, 2014, 05:59:54 PM
yes it possible

placement rules handled solely by building (like default geotermal generator) and can be coded to be placed over anything.

for placement on stuff over map, you can hook to GameStartEvent or implement gensteps.
#1603
Ideas / Re: Mercy Kill/Execute
August 21, 2014, 09:11:43 AM
They already do it.
Order colonist to melee incaped enemy and it will one hit it.

Automatic process of this will cause you colonists to rush to their death in order to melee rider (that you actually panned to capture) or rush to deer and get crossfired by other hunters...
#1604
Help / Re: Arbitrary XML\DLL definitions
August 21, 2014, 09:06:15 AM
Its possible to protect mods from harmful code:
1) Byte code parsed before loading by "border guard".
2) If references to forbidden types or forbidden methods are found - loading is rejected.
3) Trusted mods marked with digital signature.
4) Keys embedded into game and checked online for revocation (if network connection is present). (if network connection not present - all embedded keys are "valid")
(player can inject his own key to his own game and sign his own mods if needed, this will allow anyone to test any code, but not to distribute it to public)

5) This will allow trusted persons to sign mods after check and if such persons "gone rogue" key simply revoked.
Such system have very low cost and will provide solid protection as long as nobody gone rogue.

As for API and how it works:
http://ludeon.com/forums/index.php?topic=5549.0

        [EventHandler(EventPriorityEnum.LOW)]
        public void disableFrendlyFire(UnitDamagedEvent e)
        {
            //Log.Warning(e.damageMeta.Instigator.ToString());
            //Log.Warning(e.damageMeta.Source.ToString());

            if (e.damageMeta.Instigator == null)
                return;

            Pawn source = e.damageMeta.Instigator as Pawn;

            if (source == null)
                return;

            if (source.MindState.Sanity != Verse.AI.SanityState.Normal)
                return;

            if (e.pawn.Faction == source.Faction)
            {
                //Log.Warning("Disabled frendly fire event");
                e.suppressed = true;
            }
        }


Lets imagine that our "damage event" is list of paper.
Mods that do not know about each other may write to same line of that list.

If line 1 filled by mod A, then mod B may fill same line with other data.
This will erase any changes done by mod A without any trace and any warning.

If later mod A will attempt to read line 1 and perform actions based on that line - it will fail.

In case of API it will tell mod B "don't write to line 1 it already used, use line 87 instead"
When mod B try to read line 1 API will tell "line is belong to mod A, real line 87 instead"

Both mods will do what they planned without conflict, this is why API is essential.
In other case nobody will resolve conflicts.

Language barrier is issue, but instead of "get angry on entire world" i simply explained my post, i hope this thread will help community.
#1605
Help / VS 2013 git hub integration in 11 steps
August 21, 2014, 04:51:52 AM
I see no reason to reinvent bicycle, everything already invented:
http://stackoverflow.com/a/20004092/2978478

QuoteOK this worked for me.
Open the solution in Visual Studio 2013
Select File | Add to Source Control

That creates a local GIT repository
Surf to GitHub
Create a new repository DO NOT SELECT Initialize this repository with a README

That creates an empty repository with no Master branch
Once created open the repository and copy the URL (it's on the right of the screen in the current version)
Go back to Visual Studio
Open Team Explorer
Select Home | Unsynced Commits
Enter the GitHub URL into the yellow box
Click Publish
Select Home | Changes
Add a Commit comment
Select Commit and Push from the drop down

Your solution is now in GitHub

After simple and easy procedure, you can work with git without any additional applications right from "Team Explorer view".