Jump to content

Need scripts for mod..


CurseOfDarkness

Recommended Posts

Okay I started a mod called "Dancing Weapon" and I need some help scripting what I actually want the spell to be doing:

1) Cast it on a weapon, or just near a weapon
2) A predefined race spawns and picks up that weapon
3) Debug text if cast on anything else: "Invalid target" (or if it's easier to just have the race spawn and search for a weapon, ignore this)
4) When the enchanted race is de-spawned, either by death or time limit, it drops the weapon.

Also, a script that adds a perk when the spell tome is read.. I don't know how to do that. Currently, I just have it under the Alteration tree as "Blade Shield" and all it does is give the ability to summon 3 of the invisible race that picks the weapon up. While, I'm completely fine with that.. most people may want a version that doesn't modify the Alteration tree.

All I can do is suggest where to find clues for where to piece code from.. but I'm sure anyone able to program this already knows of that. Even still:
Resurrection spells are cast on a target and have a fairly short bit of script contained in them. (I know, this isn't much help.. -.-)

I'm attaching the mod in case you want to have a look at it. Most of the data can be searched by typing 'DancingWeapon' under *All in the CK. The race that it uses is under the reference "InvisibleRaceNoVoice". It's probably the only data piece that doesn't actually have 'DancingWeapon' in it.. other than the armor/outfit that the summon wears (which has already been stripped of keywords having the pieces spawn anywhere else in the world).

http://www.mediafire.com/download/ev6ttef5fkb1vai/DancingWeapon.rar

Other notes:
Oh, the race will not open doors. I've done this intentionally just because the way I play..

Edited by CurseOfDarkness
Link to comment
Share on other sites

Or. can anyone teach me to script then? Specifically:

Knowing where to attach scripts
How to decipher what a script is doing
Knowing when to use strings or int variables within functions
debugging & understand the output
etc.

If you've become a good/decent scripter by following some tutorials that you could testify to, hook me up with links please.. or show me where to start. And do not give me the hello world thing.... that's really not helping figure out what I need to accomplish in this mod.. I need something more intermediate.

God I feel like foreveraloneguy over here ~_~

Link to comment
Share on other sites

Okay, I managed to get the addperk on spell tome read script working.. that was simple enough.

Now, the spell shoots a projectile that only creates a summon when it hits a weapon, too. (Simple enough, spell looks for Target 'HasKeyword' *all weapon types listed*)

So what I need to do now is attach a script somewhere..... that does the following:

Recognizes which weapon in the world was hit with the spell.
Adds/equips that very same weapon to the newly summoned character's inventory.
When the creature dies, quickly disarm the weapon so it falls on the ground. (It's still using the effect archetype of "Summon Creature")

Not sure where to start here.... I guess it can be broken into 3 parts:
Added to spell:
Recognizes which weapon in the world was hit with the spell.

Extended from spell's script:
Adds/equips that very same weapon to the newly summoned character's inventory.

Added to summon(s) by default:
When the creature dies, quickly disarm the weapon so it falls on the ground. (It's still using the effect archetype of "Summon Creature")


I'm just writing this so I have some goals for myself, as I'm actually going to attempt scripting with very little scripting experience/knowledge (thanks to Sjogga's tutorials I can at least create some newbie scripts).
I suppose I will attempt "When the creature dies, quickly disarm the weapon so it falls on the ground." first, as this seems to be the easiest one to complete. Then I'll jump into trying to get the rest done. If you think you could provide any information to help, feel free. I could use some advice on the first and second event.. like whether I should be attaching the 2nd script to the spell or to the summoned creature, that is, to equip it with the weapon.

Link to comment
Share on other sites

Okay, the script now disarms the summon when he dies/unsummons.

I have run into a problem though.. The conditions can never be met for the projectile hitting a weapon because (I think) the Magic Effect's 'Effect Archetype' is "Summon Creature" and expects to have the 'Target Location' delivery, so I'd have to write an entirely new script for the spell to use as a new Effect Archetype. That means I have left to do:

> Have the projectile get the weapon it hit's information
> Get it working nicely with Target Condintions
> Hand that weapon to a new spawn that is in the player's faction like a summon would be (would be easier if I could read the summon creature archetype to figure this out)

and then it would be pretty much complete..

btw, I think my disarm on death script came out great :smile:

Scriptname DisarmActorOnDeath extends ObjectReference
{Disarms the actor when it dies or desummons}

Spell Property StrongAmountOfDisarm Auto

Event OnDeath()
 StrongAmountOfDisarm.Cast(Self, Self)
EndEvent

Hmm.. nevermind, it seems to only work if the summon desummons by time/limiter. If I slash one to death it does not disarm.

Well this is officially beyond what I can actually do with scripting as of yet. I believe I would have to switch over to using my own effect archetype but I don't know where to even begin with that....

> Effect Archetype: Script
> Somehow? script finds projectile location + object hit (weapon)
> Script spawns actor equipped with weapon hit by spell
> Scripts disarm actor on death/despawn

What's causing the actor to not leave an ash pile? Just the effect archetype? Is there any way I can read how the archetypes are actually scripted?

This script, on the other hand, DID work, when attached to a spell tome, in case anyone else is looking for this.

Scriptname AddPerkOnRead extends ObjectReference  
{Adds a perk to the player character when a spell tome is read}

Perk Property AddThisPerk auto

Event OnEquipped(Actor akActor)
		Game.GetPlayer().AddPerk(AddThisPerk)
EndEvent

.

Edited by CurseOfDarkness
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...