Problem with scripting - Global script for auto refill weapo

Post » Mon Jun 18, 2012 5:49 am

For the past few hours I tried to write a small script to learn about the editor and its new way of scripting. It is a script which I tried to write for Morrowind too but due to lack of functions I wasn't able ("auto repair script"). Sadly I had some problems get this script to work.

What should the script do?

Simply recharging weapons enchantment points (100%) of every affected actor (NPC's or player in combat or in the current cell or in a radius arround the player). Therefore it doesn't really matter when it's done, for example check things on every hit or every x seconds or gametime.

What have I done so far?

- Reading and searching a lot in the CK wiki
- Make notepad++ syntax highlighting psc files
- Comparing psc source scripts with editor reference

Fortunately the new script language is somehow similar to Java or C++ style so this isn't the main problem here :wink:

Where are my problems / Help me?

1. Ingame and in CK weapon editor, weapons have a specific enchantmen value. I guess weapons are "Weapons", child of "Form" (http://www.creationkit.com/OnHit_-_ObjectReference). It seems that neither there is a get/set-function for the current enchantment value nor I can make use of the "Weapon"-script because it does not contain any functions. My idea was that there is also the possibilty to get a weapon of the actor by using GetEquippedWeapon-function of the actor script, but again, neither form or weapon contains function contains any get/set functions for enchantments or am I looking at the wrong scripts/object types?

2. Beside the first problem how do i attach this script to "all" references, either actors or weapons (depends how problem one is solved) without single manually open every actor/weapon and add the script. This is no solution because it wont include other custom made weapons/actors in the future and also is too much work. I can't figure out how to make a script global running. There are function for periodically use in the form script(s) but that still means I have to add the script to actors/weapons what I want to avoid.
User avatar
Ashley Clifft
 
Posts: 3468
Joined: Thu Jul 26, 2007 5:56 am

Post » Sun Jun 17, 2012 4:37 pm

push.
I heard there is no function for enchantments, that would be really sad. No improvements after all ;(
User avatar
HARDHEAD
 
Posts: 3499
Joined: Sun Aug 19, 2007 5:49 am

Post » Mon Jun 18, 2012 5:38 am

bump.
User avatar
Amy Smith
 
Posts: 3339
Joined: Mon Feb 05, 2007 10:04 pm

Post » Mon Jun 18, 2012 4:16 am

Cant really do this until SKSE hooks up papyrus, unless you wanted to try it in C++
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am


Return to V - Skyrim