[1.0] A RimWorld of Magic

Started by Torann, November 24, 2017, 11:17:05 PM

Previous topic - Next topic

Spetse

I seem to be getting this error whenever I try to use the Orbital bombardment tagger with this mod active, makes using the weapon impossible.

Object reference not set to an instance of an object
at TorannMagic.HarmonyPatches/TryFindShootLineFromTo_Base_Patch.Prefix (Verse.Verb,Verse.IntVec3,Verse.LocalTargetInfo,Verse.ShootLine&,bool&) <0x00196>
at (wrapper dynamic-method) Verse.Verb.TryFindShootLineFromTo_Patch1 (object,Verse.IntVec3,Verse.LocalTargetInfo,Verse.ShootLine&) <0x00179>
at Verse.Verb.CanHitTargetFrom (Verse.IntVec3,Verse.LocalTargetInfo) <0x001fa>
at Verse.Verb.CanHitTarget (Verse.LocalTargetInfo) <0x00091>
at (wrapper dynamic-method) RimWorld.FloatMenuUtility.GetRangedAttackAction_Patch0 (Verse.Pawn,Verse.LocalTargetInfo,string&) <0x001f0>
at RimWorld.FloatMenuMakerMap.AddDraftedOrders (UnityEngine.Vector3,Verse.Pawn,System.Collections.Generic.List`1<Verse.FloatMenuOption>) <0x0026b>
at RimWorld.FloatMenuMakerMap.ChoicesAtFor (UnityEngine.Vector3,Verse.Pawn) <0x00184>
at RimWorld.FloatMenuMakerMap.TryMakeFloatMenu (Verse.Pawn) <0x00125>
at RimWorld.Selector.HandleMapClicks () <0x00179>
at RimWorld.Selector.SelectorOnGUI () <0x00014>
at RimWorld.MapInterface.HandleLowPriorityInput () <0x00033>
at RimWorld.UIRoot_Play.UIRootOnGUI () <0x001ad>
at Verse.Root.OnGUI () <0x000c6>

Torann

I'll check it out, thanks for letting me know.

Torann

Well talk about coincidence, it seems to be keying in on one of the criteria in the harmony patch where it uses a projectile containing "Projectile_Summon"  in the defname and yet I can't for the life of me find where the bombardments use any projectiles so I don't know why it's matching this.  I'll adjust the patch and push out an update tonight.

WereCat88

Quote from: Torann on December 22, 2017, 01:58:40 PM
What version are you using and where are you trying to cast the portal?

If you've got the latest version, it shouldn't let you try to cast in an invalid location.  This log message is seen if you try to cast the portal in an area of the map that doesn't allow buildings (eg along the edges).  If you are placing buildings normally, you'll notice there's a yellow zone along the edge of the map and it won't let you build here.  Earlier versions would allow you to cast in this zone and would throw the error you're seeing, newer versions should just poof the portal and generate a message telling you the location was bad.  Either way, you can't use the portal in this area.
Im using the latest version from moddb (v1.4.7) and i cast it nowhere near the border, in an open field, it casts but no projectile, also another weird thing is that if i try and build near where the portal was cast it will explode so in some way the portal is there? Idk
I am The Primal Mammelon

Jan2607

#94
This mod is awesome! :)
I noticed a bug: You can cast creatures when a wall is between the caster and the creature. It will reduce the mana, but no creature will spawn. It would be good, if there is any message like "You can't do that!" or something like this.
And it seems that I can't take a prisoner with me in a portal? I got the quest to recover a wounded refugee, so I teleported my Warlock to that location, but I can't put the prisoner back to my colony with the teleport pod.

And can I see, how many mana my colonist has?

Toketsu

#95
Quote from: Jan2607 on December 22, 2017, 06:22:21 PM
And it seems that I can't take a prisoner with me in a portal? I got the quest to recover a wounded refugee, so I teleported my Warlock to that location, but I can't put the prisoner back to my colony with the teleport pod.

And can I see, how many mana my colonist has?

Teleport works the same way as transport pods, so no, you cannot transport downed/incapable of walking pawns.

Check the Needs tab.

Jan2607


Torann

Quote from: Jan2607 on December 22, 2017, 06:22:21 PM
I noticed a bug: You can cast creatures when a wall is between the caster and the creature. It will reduce the mana, but no creature will spawn. It would be good, if there is any message like "You can't do that!" or something like this.
I agree, at some point I'll figure out where this block of code is that allows the ability to draw mana and go on cooldown but produce nothing, once I do then I'll add in something to give you a notification (at a minimum).  Best advice I have now is to check the target indicator before using the ability, if it has a line through it, it won't work.

Quote from: Jan2607 on December 22, 2017, 06:22:21 PM
And it seems that I can't take a prisoner with me in a portal? I got the quest to recover a wounded refugee, so I teleported my Warlock to that location, but I can't put the prisoner back to my colony with the teleport pod.
I had this same scenario recently as well.  I believe a pawn has to be able to walk to load onto a transport pod, and teleport is no different.  I  set up a temporary shelter and nursed the refugee back to a stable, walking condition, then I was able to load everyone up and portal back to my town.

Torann

Just updated steam and moddb with v1.5

Adds the druid class - a support class that can regenerate wounds over time, cure (natural) diseases and infections, poison enemies with a toxin that gets worse the more they move, beguile animals and even regrow limbs.
Beguile is quite fun, in my testing I was able to beguile a t-rex next to an oncoming raid and have it become very t-rex-y on said raid.  :o
The Regrow Limb ability was implemented in part as a spell and in part as a surgery.  You'll need the spell to create one of the ingredients, and if you try to perform the surgery and the surgeon does not know the spell, the surgery will fail.  The regrowth can still fail, if the druid is a terrible doc, but the trait should help some with that.  The limb takes several days to regrow, and after about a season it will enter its final form.

The update fixes the bug/conflict with bombardment targeter and mortar systems where they were not able to select a target.

Lastly, I overhauled the use of mana and mana efficiency.  Part of this was by adding a debuff called arcane weakness, part was by balancing spell costs and efficiency ratings.  Some spells were being reduced by over 80% if all skills were learned.

The debuff, arcane weakness only applies when dealing with bigger spells (anything with a net cost < 25% won't contribute to the debuff).  After that, it ramps up in several stages with spells that cost > 80% incurring a sickness that will affect the mage for a day or two.
That being said, use of spells in a normal combat situation isn't going to be significantly different, though you will want to protect the mage a bit more as they'll get a slight sight/movement debuff that will last a minute or two.  If you choose to be more aggressive with spells, like using multiple fireballs and mana potions etc, you'll enter stage 2 of the debuff which will make your mage pretty vulnerable, though certainly still useable. 

Last in line for combat spells, and where your mage can reach sickened state, is when they use very powerful spells.  This is reserved for a select few, like blizzard or lightning storm.  Heavy use of these spells, combined with other strong spells in a short period, can put the mage into a sickened and vulnerable state - still able to move, but not going to win a fight with a rat.
Spells that are incredibly powerful, like regrowing limbs and resurrection, will hit the top debuff multiplier, and will cause a lot of weakness.  Taking limb regrowth as an example, using the spell without training in it costs 90% mana (for the surgery) and will put the mage into a sickened state for about 16 game hours, followed by another day or so weakened.  Training in the spell can reduce the cost enough to bypass the sickened state.
Also note, when in a weakened state at any stage, mana regen is cut to 25%, so the total cost for a spell like regrow limb ends up being about 150% mana.

Lastly, but not least, if you cast "rainmaker" when the outdoor temp is below freezing, it will snow instead of rain.  ;)

Canute

Torann,
since you develop and update your mode quiet alot times now, what do you think to add modsync support ?
So player know if there are a new version out there.

Toketsu

#100
Quote from: Torann on December 23, 2017, 05:33:03 AM
Just updated steam and moddb with v1.5

Sounds like a good update, looking forward to test it later. Also, i thought up some stuff, but my mind went blank and i couldn't think of anything else, so i'll just post what i have right now. Reminder that this includes all buildings/items i've previously suggested, although most of them have some kind of difference.

Items

Magic Stones
These are rare stones, obtainable via trading, magic-related events, quests and can be crafted after some research (requires a good amount of supplies and mana). These stones are widely used in the magic field, most often as a form of amplification, or a catalyst for some more complex spells and magical mechanisms.

Mana Crystals
Empty Mana Crystals are crystals that are as common as steel (each crystal 'ore' wall drops 4 crystals), and can be fueled with mana (costs 1/3 of a pawn's mana capacity) to create a specific mana crystal. The type created will be the same as the pawn's magic school. If dual/triple elementalists get added, you will be able to choose which type will be fueling the crystal. Filled crystals can be used for crafting, building and fueling.

Arcane Stone
Very rare item that can make a pawn gain the Magically gifted trait. Obtained via quest rewards, trading or some events.

Scrolls (one-use spells)
These uncommon scrolls would function in a similar way to how artefacts work. Would be possible to carry on hand as well, like the Orbital beam.
Any pawn, even those which cannot use magic, can use these scrolls. Does not cost mana. Scroll is consumed upon use.

Tome of Knowledge
Rare item that grants one skill point to a pawn. Obtainable via magic events, trading and as a very rare drop from hostile elementals and mages (chances one will spawn with it could be around 1/1k).



Wands and Staves
These can be crafted out of wood or metal. Equipping as a weapon decreases mana usage by 5-20%.
Can be crafted along a rare Magic stone, which also amplifies the effects of spells by 5-20%.
Can have spells registered in them. This requires some scrolls of the same spell, along with some research.
Can also be imbued with mana crystals (requires Imbuing research) to give special effects, and make the weapon more personalized for a special magic school.
For example, a fire-imbued staff could have -20% fire magic cooldown.

Magic accessories
These can be crafted out of Plasteel, Mana crystals and Magic stones, and can be equipped on the accessory slot (same slot as energy shields/smokepop belts).
Different accessories provide different effects. Some effects could possibly be:
Mana usage reduction, Cooldown reduction, Spell effect amplifier, Mana regeneration increase, Global learning factor increase, Global work speed increase, among others.

Clothing
Robes could be imbued for some sort of effect, or worn as is, which would be just a normal piece of clothing.
Includes hats and hoods. Also could include gloves and boots if you're feeling like it.
Clothing-only imbues could be things like Mana Weakness duration reduction, among other effects.

Buildings
Mana Storage + Mana Cables
Large mana crystal that can store large amounts of mana. Mana stored in here can only be used for fueling magical buildings. Mana cables allow you to transfer the stored mana to buildings that use mana as fuel, allowed for a centralized fueling. Does not use mana constantly, only when the machine is being used. Pawns with the Flicker job type can refuel automatically. Should have an option for how much mana the pawn should have when refueling, and how much they will use. Example: Pawn should have 100% mana, and use 25%. Means that whenever they reach max mana, they will go refuel the storage with 25% of their mana. This allows for you to always have mana in case you need to use spells, and not always be depleted.

Stable magic portal
Same as the Teleport spell's portal, but can be used to go anywhere in the world. Has a 30 days cooldown. Can be used without triggering cooldown, as long as you teleport to another colony you own, that has a portal. Fuel use cost: 500% mana. Can be fueled directly with 12 Arcane (warlock) Mana Crystals.

Mana emanator
Much like the Psychic emanator, but increases mana regeneration by 50% to anyone in the area of effect. Crafting one costs a bit of metal and a Magic stone. Fuel use cost: 50% mana every 24h.

Mana drain machine
Assign prisoners (or any other pawn you have some control over) to one of these machines, and it will slowly drain the target's mana and send to the storage.
Draining beyond 10% mana left has a small chance of giving brain injuries. Has a toggle that allows you to set what mana % the machine should stop working at.
Idea came from another mod, that adds a special cryptosleep casket that generates power when pawns are inside.

Lesser Magic Circle (8 intelligence + 4 construction)
Increases cast speed of any pawn standing on it by 33%. 1x1 size.

Magic Circle (12 intelligence + 7 construction)
Increases cast speed of any pawn standing on it by 50%. 2x2 size.

Greater Magic Circle (16 intelligence + 10 construction)
Increases cast speed of any pawn standing on it by 50% and reduces mana costs by 20%. 3x3 size.


Rituals
Rituals are large-scale spells that can not be cast instantly, and require effort and preparation to be used. They are made the same way as buildings are, but tend to require more work than resources. The more complex the spell, the larger the minimum ritual circle size is.
There are 5 sizes of circles (each locked behind research), these are (the time to build ahead are based on a pawn with level 10 construction and in-game hours.):

Basic Ritual Circle
1x1 circle. Materials are composed of: 5 Mana Crystals of the appropriate type. Should take 2h to build.

Normal Ritual Circle
3x3 circle. Materials are composed of: 18 Mana Crystals of the appropriate type, 100 blocks of any stone. Should take 5h to build.

Intermediary Ritual Circle
7x7 circle. Materials are composed of: 40 Mana Crystals of the appropriate type, 300 blocks of any stone, 1 Magic Stone. Should take 10h to build.

Advanced Ritual Circle
11x11 circle. Materials are composed of: 100 Mana Crystals of the appropriate type, 600 blocks of any stone, 4 Magic Stone. Should take 24h to build.

Master Ritual Circle
17x17 circle. Materials are composed of: 200 Mana Crystals of the appropriate type, 1000 blocks of any stone, 10 Magic Stones, 1 Ritual Stone. Should take 48h to build.

Note: Circles should always be an odd number x an odd number. This is because the pawn using the circle is required to stand in the middle of it.

There are two kinds of ritual circles, one-off and 'manned' circles. Both are explained below. Here's one example of each of these two types:

One-off:
(One-off circles need to be fueled with mana after being built, before being able to be used. Fuel amount is dependant on circle size, and circle size is dependant on the ritual's effects. Stronger = bigger circle. The circle will 'break' upon succesful cast, and can be repaired or dismantled for some materials back. Like normal spells, one-off circles have a cast time, which usually is several times higher than normal spells. Cast time is dependant on circle size as well.)

Banishment ritual circle
This circle, when succesfully used, will allow the caster to use a very large area spell that teleports all enemies in the area to a location far away (outside of the map). The first target will be teleported with a 100% success chance. For every target after that, there's a -10% chance, and the effect stops (doesn't target more enemies) once it fails to teleport two targets. Circle size affects teleport success chance reduction rate.


'Manned':
('Manned' circles do not need prior mana fueling to use, and are more like continuous casting, as opposed to one-off rituals. Doesn't break when used. Requires a pawn to constantly concentrate in the middle, or the spell will break. The pawn's mana is used slowly over time, or when a specific thing happens.)

Magical Barrier ritual circle
This circle will activate whenever a pawn starts concentrating on it. It creates a barrier (size dependant on ritual circle size) that blocks enemy entry to it. Enemies will attempt to break the barrier and gain entry. Consumes very little mana over time to keep the barrier up, but consumes an average amount for every point of damage that the barrier receives. Allies and neutral entities can pass the barrier freely, but projectiles cannot. This goes both ways.


Events

Hostile Ritual
A mage is building a ritual circle to attack your colony, and will be finished in 40h from the time of receiving the event. The mage will have a few guards to protect him. Defeating them will allow you to loot the mage (possibly for a book or some other magic item), his guards and the ritual circle, as well as avoiding damage to your colony. Failure in defeating the event in time will result in the colony being struck by a random ritual.

WereCat88

Well its a shame that i cant get the teleport spell to work, anyway its a good mod
I am The Primal Mammelon

Jan2607

#102
I noticed some other issues: If I aim at the exact same locations where the summoner stands, something really weird happened. The summoner seems to have crashed... I can't interact with him anymore and the colonist bar was shaking with some strange noise. Only do this, if you have saved before! :D There should be also a notification, that the caster can't use this spell at this location.

Secondly, if my Minion is incapacitated, my colonists will rescue him to an animal bed. But only one second after he is rescued, the incapacitated symbol pops up again, and the colonist will have to rescue him again. And again. And again...
It seems to be impossible to bandage him. My solution for now is to kill him.

Thirdly, you can buy a defense pylon at the trader. Is this intended? Shouldn't it be only placed by mages?

The last issue is, that reloading a game after a item/creature is summoned, there seems to be a problem with the despawn.
I placed a portal and when I loaded this save, my portal did instantly explode (Im sure, that 60 seconds weren't expired at this time). When I loaded a save where I had summoned Minions, they didn't despawn after the summon duration expired. Much later, they were killed in battle. I don't know if you fixed this issue with the new update, I did not try it again.

Toketsu

#103
Quote from: Jan2607 on December 23, 2017, 08:52:34 PM
The summoner seems to have crashed... I can't interact with him anymore and the colonist bar was shaking with some strange noise.
Sounds like a good idea for a new spell.

Flashback
Targetted spell that causes target to have flashbacks about some trauma they have suffered. Pawn affected by it will be shaking and unable to react for a while.

Quote from: Jan2607 on December 23, 2017, 08:52:34 PM
Thirdly, you can buy a defense pylon at the trader. Is this intended? Shouldn't it be only placed by mages?
You can also use "Elemental Dust" as meat, keep elementals as permanent pets if they get downed and you rescue them, if they get infection, they will slowly die since it cannot be treated, colonists will desperately attempt to repair pylons, despite the fact that it'll disappear soon... There are quite a few problems and bugs. The summoner class is new however, so bugs are bound to happen. I'm sure Torann will take a look at it.

Jan2607

I know, that bugs will happen, this is why I report them ;)

How does the sniper training work? When I use it, nothing happens (shooting experience does not increase). Am I missing something?