Various modding questions and answers

Started by ItchyFlea, February 19, 2014, 07:40:33 PM

Previous topic - Next topic

keensta

Quote from: Tynan on February 20, 2014, 10:40:49 AM
Quote from: palandus on February 20, 2014, 10:34:59 AM
So you can call a Laser Turret xml file something like x3photoniceyeblaster.xml (or something even more outlandish?) instead of turret.xml as long as its in the same folder?

... How'd you create the laser effect, ItchyFlea? If theres any kind of mod I'd be interested in working on its one related to Turrets, Guns, Armor, Offenses or Defenses (as I'm a hardcore RTS fan)?

@Tynan... Is there a way to create "charge-up" sounds prior to firing a weapon? For most futuristic super weapons in games they tend to have a charge up sound before firing... so, like with the BFG9000 in Doom, it has a brief charge up period before firing (about 1.25 seconds I think) where it plays a "charge-up" sound effect before firing. Anything like that available or planned at being available?

Sorry, no charge up thing. And yes, you can call the xml files anything at all. The game just scans them all, per-folder.

I'm going to have to completely rewrite sections of my SaveEditor to accommodate for new mods being implemented. As currently all the stuff like Weapons are hardcoded which are useless if someone makes a mod to add more. Guess I'll have to start writing a Mod Loader into the program :). The joys of mods :P
Check out my RimWorld SaveEditor
It removes slag and rock debris.

I mostly hang around in the Mod section of the forum. Yet I don't have a Mod :o.

ItchyFlea

Quote from: palandus on February 20, 2014, 10:34:59 AM
How'd you create the laser effect, ItchyFlea? If theres any kind of mod I'd be interested in working on its one related to Turrets, Guns, Armor, Offenses or Defenses (as I'm a hardcore RTS fan)?
I switched the turrets weapon to be the charge rifle, and greatly increased the number of shots it fired between each burst, and how long to wait between each burst. The weapon is contained within Weapons_Guns.xml
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

palandus

Ahhh, so it appeared to create a laser effect because you had like 100+ shots all fired very quickly between eachother and a long cooldown, that would create the appearance of a long beam. Interesting... but how do you make sure it stays like a line? Do you increase the accuracy to some insane number (ie 100)?

Does anyone know if you clone a weapon (ie a Pistol) and change it to be called a G18 with 3 shot burst, with same graphics as the pistol, firing sound, etc... if that pistol will only spawn on Combat Suppliers or will it also spawn on Raiders as well? I ask because I'd like to create some super powerful weapons that can only be purchased by combat suppliers to give colonists with an excess of silver lying around (in some games I have over 7500 silver lying around with nothing to spend it on) an edge against raiders for a steep silver fee BUT... at the same time not spawn on raiders?

Tynan

Quote from: palandus on February 20, 2014, 04:01:50 PM
Ahhh, so it appeared to create a laser effect because you had like 100+ shots all fired very quickly between eachother and a long cooldown, that would create the appearance of a long beam. Interesting... but how do you make sure it stays like a line? Do you increase the accuracy to some insane number (ie 100)?

Does anyone know if you clone a weapon (ie a Pistol) and change it to be called a G18 with 3 shot burst, with same graphics as the pistol, firing sound, etc... if that pistol will only spawn on Combat Suppliers or will it also spawn on Raiders as well? I ask because I'd like to create some super powerful weapons that can only be purchased by combat suppliers to give colonists with an excess of silver lying around (in some games I have over 7500 silver lying around with nothing to spend it on) an edge against raiders for a steep silver fee BUT... at the same time not spawn on raiders?

Weapons for raiders are determined in the PawnKindDefs.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

palandus

Okay, so it won't spawn on Raiders if the weapon isn't listed in the PawnKindDefs... good good... but to get it to spawn on combat traders, would I have to edit some list for them? (Or on that note can I create my own special combat trader that sells ultra advanced futuristic weapons and only futuristic weapons?)

Tynan

The weapons have a purchasable tag that determines if combat traders offer them. Sorry, you can't make a more specific combat trader than that yet.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

ItchyFlea

Ok, I am deeply confused. No matter what I do, adding the new work types, (WorkGiver, WorkSkill, etc) or simply just replace the butcher table with the table saw, I get this error:

The colonists are properly interacting with it, and are turning the raw wood into wood planks, but the screen flashes and two errors pop up in the dev console ("Did not find skill of def" and "NullReferenceException")

Did not find skill of def
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
Log:Error(String) (at C:\Dev\RimWorld\Assets\Scripts\Utility\Debug\Log\Log.cs:35)
Pawn_SkillTracker:GetSkill(SkillDef) (at C:\Dev\RimWorld\Assets\Scripts\Pawn\Trackers\Skill\Pawn_SkillTracker.cs:41)
SkillNeedDef_BaseBonus:FactorFor(Pawn) (at C:\Dev\RimWorld\Assets\Scripts\Defs\DefTypes\SkillNeedDef.cs:32)
AI.<DoRecipeWork>c__AnonStoreyF6:<>m__A6() (at C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\Reaction\Toils_Recipe.cs:23)
AI.JobDriver:BeginNextToil() (at C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\JobDriver.cs:181)
AI.JobDriver:BeginNextToil() (at C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\JobDriver.cs:184)
AI.JobDriver:BeginNextToil() (at C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\JobDriver.cs:184)
AI.JobDriver:Notify_PatherArrived() (at C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\JobDriver.cs:227)
AI.Pawn_PathFollower:PatherArrived() (at C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\Pathing\Pawn_PathFollower.cs:275)
AI.Pawn_PathFollower:TryEnterNextPathSquare() (at C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\Pathing\Pawn_PathFollower.cs:356)
AI.Pawn_PathFollower:PatherTick() (at C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\Pathing\Pawn_PathFollower.cs:194)
Pawn:Tick() (at C:\Dev\RimWorld\Assets\Scripts\Pawn\Pawn.cs:217)
TickList:SingleTick() (at C:\Dev\RimWorld\Assets\Scripts\Root\Ticking\TickList.cs:98)
TickManager:DoSingleTick() (at C:\Dev\RimWorld\Assets\Scripts\Root\Ticking\TickManager.cs:171)
TickManager:TickManagerUpdate() (at C:\Dev\RimWorld\Assets\Scripts\Root\Ticking\TickManager.cs:152)
RootMap:Update() (at C:\Dev\RimWorld\Assets\Scripts\Root\RootRoot\RootMap.cs:67)

(Filename: C Line: 0)

NullReferenceException: Object reference not set to an instance of an object
  at SkillNeedDef_BaseBonus.FactorFor (.Pawn pawn) [0x00000] in C:\Dev\RimWorld\Assets\Scripts\Defs\DefTypes\SkillNeedDef.cs:32
  at AI.Toils_Recipe+<DoRecipeWork>c__AnonStoreyF6.<>m__A6 () [0x00033] in C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\Reaction\Toils_Recipe.cs:23
  at AI.JobDriver.BeginNextToil () [0x00070] in C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\JobDriver.cs:181
  at AI.JobDriver.BeginNextToil () [0x00097] in C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\JobDriver.cs:184
  at AI.JobDriver.BeginNextToil () [0x00097] in C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\JobDriver.cs:184
  at AI.JobDriver.Notify_PatherArrived () [0x0000c] in C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\JobDrivers\JobDriver.cs:227
  at AI.Pawn_PathFollower.PatherArrived () [0x00077] in C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\Pathing\Pawn_PathFollower.cs:275
  at AI.Pawn_PathFollower.TryEnterNextPathSquare () [0x0016a] in C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\Pathing\Pawn_PathFollower.cs:356
  at AI.Pawn_PathFollower.PatherTick () [0x00026] in C:\Dev\RimWorld\Assets\Scripts\Pawn\AI\Pathing\Pawn_PathFollower.cs:194
  at Pawn.Tick () [0x00010] in C:\Dev\RimWorld\Assets\Scripts\Pawn\Pawn.cs:217
  at TickList.SingleTick () [0x0016f] in C:\Dev\RimWorld\Assets\Scripts\Root\Ticking\TickList.cs:98
(Filename: C Line: 0)
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Tynan

One of your SkillNeeds is asking for an invalid def. Check the SkillNeedDefs and make sure they point at valid defNames for SkillDefs.

You can post your mod and I can take a look too, it may be something else. Or a bug.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

ItchyFlea

#23
Turns out if I change this line in the \Defs\Recipes\Meals.xml file from this:
<workTimeSkillNeed>CraftTime</workTimeSkillNeed>
To this:
<workTimeSkillNeed>Crafting</workTimeSkillNeed>
It works fine.

However I do have CraftTime in \Defs\SkillNeedDefs\SkillNeedsGeneral.xml and \Defs\SkillDefs\SkillsBase.xml
Do I need it somewhere else as well?

I've attached the mod to this post.

EDIT: Just noticed the entry I've got in \Defs\SkillDefs\SkillsBase.xml makes colonists have two copies of the Crafting skill.  :o

[attachment deleted by admin: too old]
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

palandus

#24
Okay managed to create two new weapons: Hand Cannon and Assault Shotgun using default textures. However, I notice that my Hand Cannon (a clone of the pistol) is dealing pistol damage of 10, when its set to deal 20 damage. Why is that?

<ThingDef ParentName="BaseBullet">
<defName>Bullet_HandCannon</defName>
<label>Hand Cannon bullet</label>
<texturePath>Things/Projectile/Bullet_Small</texturePath>
<projectile>
<impactWorld>True</impactWorld>
<damageType>Bullet</damageType>
<DamageAmountBase>20</DamageAmountBase>
<Speed>75</Speed>
</projectile>
</ThingDef>


<ThingDef ParentName="BaseGun">
<defName>Gun_HandCannon</defName>
<label>Hand Cannon</label>
<description>A high powered hand cannon.</description>
<texturePath>Things/Item/Equipment/Pistol</texturePath>
<interactSound>InteractPistol</interactSound>
<purchasable>True</purchasable>
<basePrice>90</basePrice>
<verb>
<projectileDef>Bullet_Pistol</projectileDef>
<accuracy>3</accuracy>
<warmupTicks>86</warmupTicks>
<range>28</range>
<fireSound>ShotPistol</fireSound>
</verb>
</ThingDef>


EDIT: NVM figured it out... forgot to change the Bullet_Pistol to Bullet_HandCannon.

EDIT 2: New problem. Guns will spawn ingame via debug console but I'm getting an error and caused my game to freeze entirely. When checking the log I noticed these two errors continually popping up:

Failed to find SkillNeedDef named TradePriceImprovement. There are 12 defs loaded.

AND

NullReferenceException: Object reference not set to an instance of an object

It was listing in the Combat Supplier a Hand Cannon (and strangely enough ONLY a Hand Cannon, but with no price listed... but I did list a price for my Hand Cannon)

Tynan

Can you post the log of this as well as your mod? I can look at it.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

ItchyFlea

Has <prerequisites> in the Research Projects section been implemented? I'm making an improved turret that requires 3 stages of research, which, once they are all done, the turret itself becomes available to build.
Also, is there any way to increase the rate at which the turret targets a new pawn after killing one? At the moment, changing <warmupTicks> does nothing for the turret.

I've attached the mod.

[attachment deleted by admin: too old]
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Tynan

Yes, prerequisites should work. Research project prerequisites point at other research projects. For buildings, <buildingPrerequisites> says what other buildings you must have to place it, and <researchPrerequisite> says which research project you have to have.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

ItchyFlea

I'm getting this upon game start:

Exception parsing <prerequisites>AdvancedTargetting</prerequisites> to type System.Collections.Generic.List`1[ResearchProjectDef]: Exception parsing System.Collections.Generic.List`1[ResearchProjectDef] from "AdvancedTargetting"
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
Log:Error(String) (at C:\Dev\RimWorld\Assets\Scripts\Utility\Debug\Log\Log.cs:35)
XmlToItem:ItemFromXml(XmlNode, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Mods\XmlHandling\XmlToItem.cs:36)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
XmlToItem:ItemFromXml(XmlNode, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Mods\XmlHandling\XmlToItem.cs:234)
<AllGameItemsFromAsset>c__Iterator42`1:MoveNext() (at C:\Dev\RimWorld\Assets\Scripts\Mods\XmlHandling\XmlLoader.cs:117)
ModDefSet`1:ReloadAllFromFiles() (at C:\Dev\RimWorld\Assets\Scripts\Mods\Mod\ModDefinitionSet.cs:65)
Mod:ReloadAllContent() (at C:\Dev\RimWorld\Assets\Scripts\Mods\Mod\Mod.cs:104)
LoadedModManager:LoadAllActiveMods() (at C:\Dev\RimWorld\Assets\Scripts\Mods\LoadedModManager.cs:34)
PlayDataMaster:LoadAllPlayData() (at C:\Dev\RimWorld\Assets\Scripts\Defs\Databases\PlayDataMaster.cs:27)
RootRoot:Start() (at C:\Dev\RimWorld\Assets\Scripts\Root\RootRoot\RootRoot.cs:26)

(Filename: C Line: 0)


Furthermore, the game hangs with a NullRefException if I attempt to view the available research projects.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Tynan

It's a list, so it has to be <prerequisites><li>AdvancedTargetting</li></prerequisites>.
Tynan Sylvester - @TynanSylvester - Tynan's Blog