Jump to content

Photo

Pondering if this is even possible (Creation Kit)

energy lasers shader kill condition enchantment spell perk plasma

  • Please log in to reply
16 replies to this topic

#11
robotized

robotized

    Old hand

  • Premium Member
  • 946 posts

In the current state(while this perk is for the player only), you can add additional magic effect with condition to work on super mutants only. I don't know if there are vanilla effects to make this combination happen - set them on fire first and turn them to acid goo pile. To make any npc, capable of holding laser gun, do this to super mutants, you'd have to add the perk to these npcs. A lot of npc factions or types to cover, perhaps could be narrowed down to race. I haven't done anything like that though.

 

Applying the perk or spell rather on the target, I can't say. I'm guessing it's possible, I'm not sure how. Also I don't know if there is a way to tell/detect who's the one shooting. I think there are condition checks for the damage type, I've never used them, so another thing I don't know about. Sorry, I don't have a lot of answers, I'm not that advanced at modding.

 

I've been thinking about any problems with the mod. Two things bother me. First is if you kill a target with bashing, the effect will probably trigger. Because I think the "Apply Combat Hit Spell" goes for all attacks. Maybe there is condition to check if the player is shooting or something similar. The second problem is about the weapons, which do have Critical Effect enabled in the weapon's form in the plugin. If both effects are triggered at the same time(from the weapon and from the perk), could lead to awkwardness. Maybe that's why I noticed that the effects sometimes don't work or the bodies just disappear.



#12
robotized

robotized

    Old hand

  • Premium Member
  • 946 posts

Another post, I can't help it, it's a lot of info. With the plugin at hand, I'll try to explain using it as example.

The quest adds perk to the player via the script. Source of the script is included, so you can take a look at what contains. It's quite small, but enough to get the job done. Important options for the quest - "Start Game Enabled" and "Run Once".

For the perk, I remove the "Playable" flag and set it to "Hidden". Not playable doesn't mean you can't use it. Playable flag is mostly for perks in the level up menu. Hidden flag is for whether the perk is visible in the pip-boy. I add new perk entry, then choose Entry Point and from the list - Apply Combat Hit Spell. Then I choose the spell. You gotta have the spell already created, but I'm trying to explain how things are connected. I go to the Weapon tab of the conditions and add what's necessary.

The spell I choose for "Apply combat hit spell" for example CWMG_CritPlasmaSpell [SPEL:01000F9A]. It is added to the player's attacks. Magnitude and duration of the magic effect I got from the vanilla game. If you want to open the magic effect(or any kind of form, if referenced in another form), hold Ctrl and click on it(uuh I meant that when using FO4Edit). The magic effect runs a script called FXCastSpellOnDeath. Since it's added to player's attack, the casting type is "Fire and forget" and the Delivery type is "Contact(Touch)". In the properties of the script choose the spell for the effect on death. When the target is hit, the spell is added to it.

The spell for the critical effect(CWMG_CritPlasmaHitSpell [SPEL:01000F9C]) is added to the target upon death. The casting type is "Fire and Forget" and the delivery type is "Self". I could've probably used vanilla critical effect spell, but I created new ones. The magic effect in the spell is actually from the vanilla game, and so are the settings for magnitude and duration. The magic effect runs scripts for adding various effects and replacing the body with goo/ash piles.

If you want a custom effect with goo/ash pile, then you have to duplicate on of the vanilla crit magic effects and fill in the properties of the script with your own.

Basically:

  • quest adds perk to the player with a script
  • perk applies combat hit spell to player attacks
  • the combat hit spell adds(through script) critical effect spell to the target triggered on death

This method is based of the enchantment of the Mirelurk Queen's weapon: MirelurkQueenSpitAttackSpell "Acid" [ENCH:001B9A3A]. You can check it out and see that things are very similar. Instead of enchantment, we have a spell chosen as Combat Hit Spell in a perk. This is because enchantments aka object effects are only for armor and weapons. For npcs are used spells. The enchantment has two magic effects - one is for the acid damage and the other is for the critical effect.

 

Btw, effect spell, effect hit spell, not the best naming. I tried to follow some Bethesda naming when creating from existing forms. So let's say in the example:

CWMG_CritPlasmaSpell [SPEL:01000F9A] -> combat hit spell

CWMG_CritPlasmaHitSpell [SPEL:01000F9C] -> critical effect spell

 

 

About my ideas for keywords and conditions.

For red laser:

Subject.HasKeyword(ma_InstituteLaserGun [KYWD:001289BB]) = 0  AND

Subject.HasKeyword(WeaponTypeLaser [KYWD:00092A84]) = 1  OR

Subject.HasKeyword(WeaponTypeGatlingLaser [KYWD:0022575E]) = 1  OR

This will cover Laser Gun, Musket and Gatling laser, but will exclude the institute laser. hopefully this combination of AND and OR works. Could be compatible with mod added weapons even.

 

For blue laser:

Subject.HasKeyword(ma_InstituteLaserGun [KYWD:001289BB]) = 1  OR

Subject.HasKeyword(WeaponTypeAlienBlaster [KYWD:0016968B]) = 1 OR

Subject.HasKeyword(DLC01ma_LightningGun [KYWD:01002471]) = 1 OR

 

For Institute Laser, Alien Blaster and Tesla Rifle. Since using mod association keywords, it depends what keywords modded weapons use, but probably they are not compatible.

 

For plasma:

Subject.HasKeyword(WeaponTypePlasma [KYWD:00092A85]) = 1.000000 OR

Subject.HasKeyword(HasLegendary_Weapon_PlasmaBullets [KYWD:001F9B4C]) = 1.000000 OR

This will cover plasma gun and weapons with Plasma Infuse legendary effect.

 

For Cryo:

Subject.HasKeyword(WeaponTypeCryolater [KYWD:0022575F]) = 1.000000 OR

Subject.HasKeyword(HasLegendary_Weapon_Cryo [KYWD:001F547A]) = 1.000000 OR

Covers the Cryolator and weapons with Freezing legendary effect.

 

For Fire:

Subject.HasKeyword(HasLegendary_Weapon_IncendiaryBullets [KYWD:001E7175]) = 1.000000 OR

Weapons with Incendiary legendary effect.

 

I haven't checked if bash really triggers the effect, because I don't use it as much. I still don't have ideas about conditions to filter out the player's actions(bashing/shooting).

 

 

Edit: Yep, if you happen to finish a target with bash, the effect still applies. Needs a solution if possible.

Note: When I talk about Casting/Delivery Type, I mean for the magic effect. The spell inherits those settings from the magic effect used in it. In FO4Edit these settings for the spell can be manually edited, but only to match same settings for the magic effect within it, if necessary.

 

 

 

 



#13
CatsWithMachineGuns

CatsWithMachineGuns

    Regular

  • Members
  • PipPip
  • 66 posts

Sorry for not responding earlier, but I've just been tinkering around with this a bit and reading up a ton on it from the Creation Kit wiki and whatnot. Of course it also helps that you've spelled out exactly what's unfolding behind the scenes, always useful to know!

 

For learning purposes with Creation Kit, I've tried seeing if I can omit certain npc types from applying the effect on death, but to no avail.

 

For example, I created the target condition on the perk Subject.GetInFaction (Faction:'GunnerFaction') != 1.0 to ideally make it read "If the subject is not in the gunner faction, then do the effect", so everyone except Gunners should do the effect on death, but it doesn't seem to be working

 

I tried with every combination of AND/OR, Target/Subject, Swap Target and Subject, nothing seems to work.

 

Is something wrong with my setup?

 

wFQGkBq.png

 

 

And as far as stock bashing goes, I was actually wondering if there's anything that detects damage types. dtPhysical, dtEnergy, dtFire, etc. Since I'd imagine that a stock bash wouldn't (or at least shouldn't) be considered energy.

Perhaps it would be possible to apply the effects based off the received damage type instead of the weapon itself?

(and if so, then applying proper keywords such as ma_institutelasergun and whatnot)

 

That way it could be set up so if the "perk" owner (we'll just say Super Mutants have their own perk for always melting from lasers, end of story) dies via specific damage type, then they themselves apply the effect to themselves.

Of course the only point in making something like that would really be for science if one felt like more directly applying specific circumstances to more actors in the big picture, because otherwise I definitely got what I initially asked for, which was the ability to always do the critical hit effect. I appreciate all you've done and the insight you've given!


Edited by CatsWithMachineGuns, 13 April 2022 - 08:04 PM.


#14
robotized

robotized

    Old hand

  • Premium Member
  • 946 posts

There are Entry Points which change things for the perk owner's target, like their damage resistance. Maybe the "Target" tab doesn't work for Entry Points, unless they are related to the target.

 

I tried a couple of candidate conditions for damage type, but they don't work. I keep thinking there is a condition that checks player's action, and the action was represented by numbers, but I can't remember. I could be wrong. I haven't really googled this. And I also can't find anything for the type of incoming damage.

 

Getting back to applying the effect on certain npcs. I already mentioned in one of my previous posts:

In the current state(while this perk is for the player only), you can add additional magic effect with condition to work on super mutants only.

What I meant was to create new magic effect from the vanilla one(CritLaserEffect "Critical Laser Hit" [MGEF:000731B3]) and add it to the critical effect spell with condition(like the one from your example). Since the magic effect is a new form, you can edit this however you like - add/remove scripts and choose different forms for the script properties.

 

Something else popped up in my head, regarding the bashing problem. I don't know if it will work. Things in the mod will be changed a bit. In the perk it won't be used Entry point, but rather Ability. Ability also adds spell to the perk owner, but the spell specifically has flag for ability and is constantly applied(Constant Effect to Self). The magic effect inside the spell will apply enchantment to the weapon. The Archetype of the effect is called Enhance Weapon. This enchantment will take the role of the combat hit spell. The conditions will also be changed, I think it can be checked if the equipped item has certain keywords. But this whole thing remains to be tested. I'm thinking of giving it a go since I'm curious about it, will keep you updated and if all is well, I'll even send you another plugin to check out.



#15
robotized

robotized

    Old hand

  • Premium Member
  • 946 posts

Enhance Weapon is a dead end. I think this had purpose in Skyrim, but here I couldn't get it to work. So it's back to the "Apply Combat Hit Spell". I tried looking in the conditions  for something connected to bashing instead of shooting, but no luck there either. I noticed a mistake I did before and that's not giving names to the forms(not EditorIDs, but names). In CK you can't add magic effect to a spell or enchantment, if it doesn't have a name filled. I was getting a bit confused by bethesda naming, since I used their forms from FO4.esm to copy from and I removed the names in FO4Edit, silly me. So I added proper naming this time. I created combat hit spell for the incendiary critical effect to test, that works as expected. Added keyword condition for plasma infused legendary effect. And I created two magic effects for the red laser crit effects, with added conditions - one for super mutant race and one for non super mutant race. Basically it's working, but is a little buggy, as in there are times that both effects are added to the super mutant and you end up with ash pile and goo pile. You can check it out, here's the archive:

https://drive.google...iew?usp=sharing

What's left to do, if you want to cover most weapons and effects - add spells and magic effects for blue laser effect, cryo effect(am I missing something else?). While testing the red laser on super mutants, I stumbled upon a potential issue. If you have a laser weapon with cryo legendary effect. It's possible as I have such weapon in my game. I haven't tested this particular situation, because I haven't added cryo. I think one of two things may happen - 1)since OR conditions is used, none of the effects will apply; 2)both effects will apply, which will get buggy visually. Oh, almost forgot, the AND and OR combination of conditions for the red laser effect seem to work - institute laser gun is not affected, standard laser gun and laser musket have the crit effect. I leave the rest to you for now.



#16
CatsWithMachineGuns

CatsWithMachineGuns

    Regular

  • Members
  • PipPip
  • 66 posts

Alrighty, I'll have to putz around with this a bit to see which ways I can bend it, but until then I appreciate the work you've put into making this and teaching me, I'm quite appreciative!

And if nothing else I can go be Laser Man Extraordinaire in the meantime. Thanks! 



#17
robotized

robotized

    Old hand

  • Premium Member
  • 946 posts

You are welcome.







Also tagged with one or more of these keywords: energy, lasers, shader, kill, condition, enchantment, spell, perk, plasma

IPB skins by Skinbox
Page loaded in: 0.991 seconds