Modifying existing scripts to add new content... impossible?

Post » Mon Jun 18, 2012 3:47 pm

OK so I'm very fluent with pretty much any programming language... been doing it for 15+ years, but this is my first time messing around with a "CK" type thing.


I'll cut right to the chase with this:

I believe it's impossible to add new things to certain areas of existing script.

For instance. I have a Guardian Stone mod that greatly enhances the effects of the stones throughout the world. However, I've found that since these stones already have existing references the only way to change them is by editing. Sure, you can make new magic effects and reference them to the Guardian Stone's alias... but it's impossible to create a NEW reference that the guardian stone will actually recognize. Why is this?

Scripts. The scripts are made in such a way that 99% of the meat of them is hidden within the game engine itself... making a good portion of the game content "un-touchable", if you will.


Examples:

Load up the script manager. Open powerShrineScript. Look at the following sections:

; //list of the effects
SPELL PROPERTY pDoomApprenticeAbility AUTO
SPELL PROPERTY pdoomApprenticeNegativeAbility AUTO
SPELL PROPERTY pDoomAtronachAbility AUTO
SPELL PROPERTY pDoomLadyAbility AUTO
SPELL PROPERTY pDoomLordAbility AUTO
SPELL PROPERTY pDoomLoverAbility AUTO
SPELL PROPERTY pDoomMageAbility AUTO
SPELL PROPERTY pDoomRitualAbility AUTO
SPELL PROPERTY pDoomSerpentAbility AUTO
SPELL PROPERTY pDoomShadowAbility AUTO
SPELL PROPERTY pDoomSteedAbility AUTO
SPELL PROPERTY pDoomThiefAbility AUTO
SPELL PROPERTY pDoomTowerAbility AUTO
SPELL PROPERTY pDoomWarriorAbility AUTO

; //FUNCTION: addSign
; //
; // adds the sign of the stone to the player
FUNCTION addSign()
game.AddAchievement(29)
IF(bApprentice)
game.getPlayer().addSpell(pDoomApprenticeAbility)
game.getPlayer().addSpell(pdoomApprenticeNegativeAbility)
ELSEIF(bAtronach)
game.getPlayer().addSpell(pDoomAtronachAbility)
ELSEIF(bLady)
game.getPlayer().addSpell(pDoomLadyAbility)
ELSEIF(bLord)
game.getPlayer().addSpell(pDoomLordAbility)
ELSeIF(bLover)
game.getPlayer().removeSpell(pRested)
game.getPlayer().removeSpell(pWellRested)
game.getPlayer().removeSpell(pMarriageRested)
game.getPlayer().addSpell(pDoomLoverAbility)
ELSEIF(bMage)
game.getPlayer().addSpell(pDoomMageAbility)
ELSEIF(bRitual)
game.getPlayer().addSpell(pDoomRitualAbility)
game.getPlayer().addPerk(pdoomRitualPerk)
ELSEIF(bSerpent)
game.getPlayer().addSpell(pDoomSerpentAbility)
ELSEIF(bShadow)
game.getPlayer().addSpell(pDoomShadowAbility)
ELSEIF(bSteed)
game.getPlayer().addSpell(pDoomSteedAbility)
ELSEIF(bThief)
game.getPlayer().addSpell(pDoomThiefAbility)
ELSEIF(bTower)
game.getPlayer().addSpell(pDoomTowerAbility)
ELSEIF(bWarrior)
game.getPlayer().addSpell(pDoomWarriorAbility)
ENDIF

endFUNCTION


Notice:

The variables for "pDoomStoneAbility" are predefined by the game engine. There is absolutely NO reference to these variables ANYWHERE in the creation kit.



My point with all this is that based on my experience with editing the Magic Effects, there is simply no way to add a NEW / UNIQUE ability to the stones. If one stone has a "+50 health", it can have any sort of ability related to enchanting type effects. If another stone gives you a "Power" once a day, it can't have any of those enchanting type effects BECAUSE they are of a different effect type (constant / fire and forget / ect)...

What does this have to do with scripts?

You can't edit the script to add new effects... you can try adding a new reference and add a line of (game.getPlayer().addSpell(yourNewSpell))... but the problem is, the game engine simply doesn't know what your new spell is.


BECAUSE WE DON'T HAVE ACCESS TO IT.




If I'm missing something, PLEASE let me know... because the Wiki is extremely lacking in proper documentation of the scripting language itself and instead just gives a basic programming 101 on irrelevant stuff like how functions work and what a loop is... seriously, I'm frustrated.
User avatar
Enie van Bied
 
Posts: 3350
Joined: Sun Apr 22, 2007 11:47 pm

Post » Mon Jun 18, 2012 9:21 am

The stones probably have an Onactivate event?

You should/may be able to add a new effect to that event?

So, if you have made a new spell (does that work on a character as a test??) then you should/may be able to reference it in the onactivate script and then apply it to the player.

The wiki includes a tutorial on adding an onactivate event to an object ... that should get you started


And yeah, we're supposed to be building the wiki ...
User avatar
gemma
 
Posts: 3441
Joined: Tue Jul 25, 2006 7:10 am

Post » Mon Jun 18, 2012 7:10 am

I'll try that. Thanks for the tip.


I'll report back in a bit with some findings.
User avatar
Gaelle Courant
 
Posts: 3465
Joined: Fri Apr 06, 2007 11:06 pm

Post » Mon Jun 18, 2012 4:11 am

You're missing something, I think.

If you look at the Use Info on the powerShrineScript, you will notice that it is used by the various Stone objects, which you can click on and open, etc. If you right-click on the Papyrus script in each Stone's form, you can look at the properties for that instance of the Script, which tells it exactly which stone uses which enchantment, and which stone this actually is. You can thus easily either modify the existing enchantments the stone uses, or add a new property and modify the script itself, etc.

I admit, it is definitely not the most intuitive system, and it took me a long time to figure it all out as well (and I've been coding roughly as long as you). I probably still don't understand it completely, either. :/
User avatar
Susan Elizabeth
 
Posts: 3420
Joined: Sat Oct 21, 2006 4:35 pm

Post » Mon Jun 18, 2012 3:45 pm

I believe the pay properties of this type work in the creation kit is that while the script CREATES the property (SPELL PROPERTY pDoomApprenticeAbility AUTO),
The VALUE for it is set from within the CK.
Specifically, you need to find a Property button. That's where they are given values.

For a quest script, there is a button in the Scripts tab.

EDIT: as Reneer says - there is a Properties button in the Activator window for each of the Guardian stones.
Thus each Guardian Stone that uses the script can have different values for the properties.
User avatar
Richard
 
Posts: 3371
Joined: Sat Oct 13, 2007 2:50 pm

Post » Mon Jun 18, 2012 2:46 pm

WOW i found it.

incredible, and unrealistic that this type of reference wouldn't be included in the "Find Text" search in the creation kit....



SO apparantly, when you load up the PROPERTIES of the "powerShrineScript" script, there is a list of variables on the left that are "referenced" within that script. apparantly that is where the references that I was looking for are stored. for whatever reason they can't be found anywhere in the CK other then in the PROPERTIES MENU of a SCRIPT.


wow. I mean, I'm happy that I found the problem, but honestly... the CK is so frustratingly complicated in unnecessary ways.



Thanks for the help anyways -___-;;



EDIT:

ninja solve :P thanks guys
User avatar
Anthony Rand
 
Posts: 3439
Joined: Wed May 09, 2007 5:02 am


Return to V - Skyrim