So, what's the problem with creating an unlock spell?

Post » Mon Jun 18, 2012 5:37 pm

Seeing how the Tower Guardian Stone works totally different from previous open and lock spells, we would probably have to create an entirely new spell - but I can't really figure out what's so difficult about it. The Papyrus script give us the ability to change objects' locklevels and such, so it shouldn't be too hard to write a script to do that (I'm no that familiar with Papyrus yet, though).

The problem I seem to have is that the spell needs to interact with an object, and there doesn't seem to be an option for that. All other spells interact with actors or the player.

Does anyone have an idea how to get around that problem? Maybe we can start from there.
User avatar
Adam Baumgartner
 
Posts: 3344
Joined: Wed May 30, 2007 12:12 pm

Post » Mon Jun 18, 2012 4:15 pm

Hmm... I was trying to solve something like that back in FO3... I wanted to make an Auto-Hacking gun; unfortunately, Script Effects wouldn't run on Terminals. Eventually, I decided I could create an invisible NPC at the point of impact, have his AI acquire the closest Terminal Reference, and have a script on the NPC check for that reference and Unlock it. Unfortunately, that didn't work because I couldn't set AI Packages to activate "closest terminal" or something... can't recall.

In any event, perhaps something similar would work here? I mean, creating an invisible NPC, and having them find locked doors to open with a script?
User avatar
stevie trent
 
Posts: 3460
Joined: Thu Oct 11, 2007 3:33 pm

Post » Mon Jun 18, 2012 4:38 pm

I havent got access to the CK at the moment, but could you not just clone the spell effect for the tower power (lol), and then create a new "spell" (as opposed to power) that calls it and gives it a cost etc?
User avatar
elliot mudd
 
Posts: 3426
Joined: Wed May 09, 2007 8:56 am

Post » Mon Jun 18, 2012 1:27 pm

I havent got access to the CK at the moment, but could you not just clone the spell effect for the tower power (lol), and then create a new "spell" (as opposed to power) that calls it and gives it a cost etc?
Sadly, that's not how the tower power works. The spell effect only gives a constant effect to enable the perk, it doesn't open doors for you itself. :(
The open lock spell in Midas Magic works like this. You cast the spell effect on yourself, and are enabled to use the perk (open all locks <= a certain level) for a set duration. That's totally different from using a spell on an object to change its lock status, though.
User avatar
Stace
 
Posts: 3455
Joined: Sun Jun 18, 2006 2:52 pm

Post » Mon Jun 18, 2012 11:02 am

Use a script. Here's the important function: http://www.creationkit.com/Lock_-_ObjectReference

also you can make the effect hit the ground and script it to search for the nearest locked objectref

Papyrus, baby :D
User avatar
lucile davignon
 
Posts: 3375
Joined: Thu Mar 22, 2007 10:40 pm

Post » Mon Jun 18, 2012 5:52 am

I can't look into specifics right now, but can't you create a projectile and create a spell that fires off the projectile? A script attached to the projectile could then check what it hits, and set the lock level on the thing to 0 if it's appropriate to do so.
User avatar
sara OMAR
 
Posts: 3451
Joined: Wed Jul 05, 2006 11:18 pm

Post » Mon Jun 18, 2012 10:24 am

I can't look into specifics right now, but can't you create a projectile and create a spell that fires off the projectile? A script attached to the projectile could then check what it hits, and set the lock level on the thing to 0 if it's appropriate to do so.

Able to explain that bit? That's where I'm running into trouble, checking what is hit to know what object I'm working with...
User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Mon Jun 18, 2012 12:03 pm

Able to explain that bit? That's where I'm running into trouble, checking what is hit to know what object I'm working with...
I'm not that familiar with Papyrus yet, but in Oblivion you could create a spell so that a script would run when its projectile hit an object, and get a reference to that object. I'd be surprised if you can't do something similar in Skyrim.
User avatar
Marta Wolko
 
Posts: 3383
Joined: Mon Aug 28, 2006 6:51 am

Post » Mon Jun 18, 2012 4:18 pm

is it posuble to import a spell from Oblivion? If so, then maybe that mite wok.
User avatar
Laura Elizabeth
 
Posts: 3454
Joined: Wed Oct 11, 2006 7:34 pm

Post » Mon Jun 18, 2012 4:25 pm

The problem is that there is no way to recieve an on hit(object reference) event in papyrus as part of the spell.
It only works with actors.
So you have no possibility to check if you hit something if it isn't an actor.

There is an Unlock effect in the ck (like Modify Attribute) but it does not seem to do anything.

One workaround that works is to apply a script to every container in game to check if it got hit by an unlock spell

Other ideas we are currently investigating are a bit complex like spawning a marker at the spell destination. Selecting that marker via getClosestRef then search for the closestChestAround that marker and unlock it.
Not really nice either :(

The tower woks by using the perk system to hook into the activate event, but displays something like a decision message box (not what we want)

Whats makes it even worse is, that there is definately detection for object hit. An empty spell with a hit "glow" targeted on a chest/door etc will make it show up as hit
User avatar
Mariaa EM.
 
Posts: 3347
Joined: Fri Aug 10, 2007 3:28 am

Post » Mon Jun 18, 2012 3:40 am

The problem is that there is no way to recieve an on hit(object reference) event in papyrus as part of the spell.
It only works with actors.
So you have no possibility to check if you hit something if it isn't an actor.

There is an Unlock effect in the ck (like Modify Attribute) but it does not seem to do anything.

One workaround that works is to apply a script to every container in game to check if it got hit by an unlock spell

Other ideas we are currently investigating are a bit complex like spawning a marker at the spell destination. Selecting that marker via getClosestRef then search for the closestChestAround that marker and unlock it.
Not really nice either :(

The tower woks by using the perk system to hook into the activate event, but displays something like a decision message box (not what we want)

Whats makes it even worse is, that there is definately detection for object hit. An empty spell with a hit "glow" targeted on a chest/door etc will make it show up as hit

Lol... I could have been reading the forums and i wouldn't have spent the last 3 hours fooling around ...

After testing weird things and having dozens of tabs opened in browser, I've created a formlist with outside doors from Whiterun and used FindClosestReferenceOfAnyTypeInListFromRef. It does work...

This is what I have as a target on self

scriptName ShanaOpenSelfTestScript extends ActiveMagicEffect{Scripted magic effect blablabla.}import utilityimport gameFormList property ShanaThingsOpenable auto;======================================================================================;;  VARIABLES   /;=============/objectReference CastFromHereRef;======================================================================================;;   EVENTS	 /;=============/Event OnEffectStart(Actor Target, Actor Caster)Debug.Trace(" Effect Started")CastFromHereRef = CasterDebug.Trace(" Looking for doors...hopefully")ObjectReference closestDoor  = Game.FindClosestReferenceOfAnyTypeInListFromRef(ShanaThingsOpenable, CastFromHereRef, 100.0)if ( closestDoor == None)  Debug.Trace("There is no door near!")  Debug.Notification("There is no door near!")else  Debug.Trace("The closest door is: " + closestDoor)  if( closestDoor.isLocked() )   Debug.Trace("Opening door!!!")   Debug.Notification("Opening door!!!")   closestDoor.Lock(false)  endifendifEndEvent

The idea was spawning an activator at target location and do the same instead of using, but I've simplified it into this one due to my "error prone programming style" lol

Also, note that when a door unlocks you will get the notification, but if you are heading to it it will still say Locked until you turn around and back ( but you can just press space and go in)

Let's see if we can find some cooler way hehe. I will check again after I get some sleep :biggrin:
User avatar
Angel Torres
 
Posts: 3553
Joined: Thu Oct 25, 2007 7:08 am

Post » Mon Jun 18, 2012 6:09 pm

It looks like it has taken more than one night sleep lol

http://www.gamesas.com/topic/1352976-a-working-open-door-spell/
User avatar
Darren
 
Posts: 3354
Joined: Wed Jun 06, 2007 2:33 pm


Return to V - Skyrim