Begginer Scripter Needs Help

Post » Sat Dec 24, 2016 6:29 pm

Hello all, I have been waiting awhile for some of my old favorite mods to update to skyrim SE but it seems a lot of them havent even been touched since 2012 so that seems unlikely. As such I have decided to take it upon myself to create my own weapon similar to one from an old mod I used to use. ( Weapon trying to re-create is called "Ancient Blade" and is on original skyrim nexus. )



So basically I want to make a script that has a Onkill trigger whenever the player kills any NPC, I am not sure if this is even plausible, am seeing the ebony blade work somewhat how I want my blade to work but know that is done via quest stages, if it is not possible to do this the way I am approaching would appreciate tips on how I might use quest stages to do this.



Here is some pseudo code of what I hope I can do:




Event OnKill(Actor akVictim)
if (akVictim == **Npc target**) //not sure if there is just a in general npc target, or if this can even select NPCs

damagetracker += 1

if( damagetracker % 10 == 0)

ref.modav(**weapon with script effect**, .1) //not sure if you can directly modify weapons damage value from .modav, have feeling cant.

Debug.Trace("The weapon grows in power as it consumes more mortal blood.")
endIf

endif
endEvent



I would like to thank anyone willing to read this and provide helpful feedback, and yes this is my first attempt at scripting.


User avatar
Naomi Lastname
 
Posts: 3390
Joined: Mon Sep 25, 2006 9:21 am

Post » Sat Dec 24, 2016 11:37 am

While that would be very nice to have, unfortunately the OnKill event is only in Fallout 4.


And doing what you want requires a bit of extra work I'm not able to explain well, perhaps someone else can try. But OnDeath would be the way to go, however, you would first need to grab the actor you want to run that event on and toss them in an alias(the complicating part).

User avatar
Dale Johnson
 
Posts: 3352
Joined: Fri Aug 10, 2007 5:24 am

Post » Sun Dec 25, 2016 12:08 am

Yea been looking around more and sadly think the only way I can do this is to create a radiant quest that fires every time the player kills a NPC and does the onkill event. Really complicated though and annoying too. Mostly because quest scripting which think is easiest way to do this requires so much extra things just to make the quest work properly then can worry about the incrementing my count.



Ok now I need help with questing scripting,



I am trying to detect if player alias is using certain weapon,



So know code line should be something like



Alias_Player.Registerrighthandweapon



compare righthandweapon to special weapon if same



devourercount +1




Any idea how to check if player weapon used on kill is certain weapon?

User avatar
Killah Bee
 
Posts: 3484
Joined: Sat Oct 06, 2007 12:23 pm

Post » Sun Dec 25, 2016 12:05 am

The easiest way to achieve this is to look at how the Ebony Blade quest works and basically substitute your weapon for it. If you're looking at a way to register a kill event there is the Story Manager's Kill Actor Event which would fit the bill nicely and if it was me I'd probably go down that route.



If you don't know how the basics of how quests work you're going to need to look at some more basic tutorials on quest design and scripting etc.

User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm


Return to V - Skyrim