UESP Forums

Discuss the uesp.net site and Elder Scrolls topics.
* FAQ    * Search
* Register    * Login
It is currently Wed Apr 24, 2024 11:57 pm

Loading

All times are UTC

Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: Script's won't work proper
PostPosted: Fri Dec 21, 2012 3:05 pm 
Offline
Master
Master
User avatar

Joined: Mon Dec 13, 2010 12:52 pm
Posts: 1374
Location: Vienna, Austria (and no we have no Kangaroos!)
ES Games: Morrowind, Oblivion, Skyrim
Platform: PC
Status: ...
UESPoints: 0
Today the CK got really on my nerves...
I make scripts sometimes they work sometimes not..
Sometimes the same script will work in 1 Perk but not in another with just 1 changed value...
Can somebody help me?

Here are a few examples:

Scriptname SotTE_ActorValueMod extends activemagiceffect

String Property AV Auto

Float Property Multiply Auto

GlobalVariable Property Safe Auto

Event OnEffectFinish(Actor akTarget, Actor akCaster)
if (Safe.Getvalue() > 0.0)
Debug.MessageBox("Only one target can have its armor reduced!")
else
Safe.SetValue(akTarget.GetActorValue(AV))
akTarget.ForceActorValue(AV, Safe.Getvalue()*Multiply)
endif
endEvent

Event OnEffectStart(Actor akTarget, Actor akCaster)
akTarget.ForceActorValue(AV, Safe.Getvalue())
Safe.Setvalue(0.0)
endEvent

or

those 2 (fragments from perks)

if(!akTargetRef.IsLocked())
akTargetRef.lock(True)
akTargetRef.SetLockLevel(25)
endif


if(akTargetRef.GetLockLevel() <= 75)
akTargetRef.lock(FALSE)
akTargetRef.activate(game.getPlayer())
endif

_________________
Kinsman, House Hlaalu

RFC 5513


Top
 Profile  
 
 Post subject: Re: Script's won't work proper
PostPosted: Fri Dec 21, 2012 3:31 pm 
Offline
Apprentice
Apprentice
User avatar

Joined: Mon Jul 28, 2008 3:06 am
Posts: 156
ES Games: Morrowind, Oblivion, Skyrim
Platform: PC
UESPoints: 0
Can you please describe what you want the scripts to do? Do the scripts compile correctly or do you get an error message when saving?


Top
 Profile  
 
 Post subject: Re: Script's won't work proper
PostPosted: Fri Dec 21, 2012 4:05 pm 
Offline
Mod On Leave
Mod On Leave
User avatar

Joined: Tue Nov 15, 2011 5:06 am
Posts: 2876
Location: Your dreams
ES Games: Morrowind, Oblivion, Skyrim
Platform: Xbox, PC, STD
Status: Smurfin'
Other Profiles: Gamertag: MightyGo0dLeadr
UESPoints: 15
Some perspective would help determine what the problem is. What are you attaching the script to?

_________________


Top
 Profile  
 
 Post subject: Re: Script's won't work proper
PostPosted: Fri Dec 21, 2012 4:09 pm 
Offline
Master
Master
User avatar

Joined: Mon Dec 13, 2010 12:52 pm
Posts: 1374
Location: Vienna, Austria (and no we have no Kangaroos!)
ES Games: Morrowind, Oblivion, Skyrim
Platform: PC
Status: ...
UESPoints: 0
Everything compiles to full correctness.

Edit: found the failure in the first script, got on effect start and finish wrong... now it works! Thank god!

Those scripts are for a mod that I am currently making, which aims to bring back allmost all effects from Morrowind/Oblivion, I have allready about 30 spells created (all with basic effects without scripts) and today I made those scripted things and the unlock/lock perks make me crazy.

The second two (fragment) scripts are based upon the Tower Birthstone Power, one to Lock unlocked Doors/Containers and the other one to Unlock them. I had both of these scripts working and then changed the values, compiled them again and the worked no longer....

Basicly you cast the spell and add yourself a perk for 30 seconds which enables you to unlock/lock the next thing you activate, you get a dialogue box and can choose to use the spell or normal lockpick.

Edit2: Found the failure in the lock script you need to type if(!(akTargetRef.IsLocked())) instead of if(!akTargetRef.IsLocked()) or the script will negate the akTargetRef (what sense make this?^^)

_________________
Kinsman, House Hlaalu

RFC 5513


Top
 Profile  
 
 Post subject: Re: Script's won't work proper
PostPosted: Fri Dec 21, 2012 4:54 pm 
Offline
Apprentice
Apprentice
User avatar

Joined: Mon Jul 28, 2008 3:06 am
Posts: 156
ES Games: Morrowind, Oblivion, Skyrim
Platform: PC
UESPoints: 0
The first script fragment:
The script is basically locking something that's already locked and sets the level of the lock to "easy". :? Try this:
Spoiler:
Code:
if (akTargetRef.IsLocked() == false)
   akTargetRef.Lock(True)
   akTargetRef.SetLockLevel(25)
endif

But then again, it would be better if you remove the "If"-statement and add conditions to the target in the perk itself.

The second fragment:
I'm not really sure why this isn't working for you, since it's basically the same as the Tower-perk. Try doing what I suggested above and add the conditions in the perk, instead if the "If"-statement. Look at the perk called "doomTowerPerk" to see how Beth did it.


Top
 Profile  
 
 Post subject: Re: Script's won't work proper
PostPosted: Fri Dec 21, 2012 6:37 pm 
Offline
Master
Master
User avatar

Joined: Mon Dec 13, 2010 12:52 pm
Posts: 1374
Location: Vienna, Austria (and no we have no Kangaroos!)
ES Games: Morrowind, Oblivion, Skyrim
Platform: PC
Status: ...
UESPoints: 0
Thanks, you indirectly helped me alot.

The problem was, I copied the tower perk and didn't look into the Target Conditions, so my perks had scripted and target conditions and this mixed not very well.
(and I don't like the conditions windows, better to script it all!)

Now I have 6 functional Spells (1 Lock and Open for every Lock Level exept Requires Key).

Maybe if I can add a question:

Does anybody know how to increase the Jump Height? There is an Actor Value for Jump Boost but Beth didn't implement it.

_________________
Kinsman, House Hlaalu

RFC 5513


Top
 Profile  
 
 Post subject: Re: Script's won't work proper
PostPosted: Fri Dec 21, 2012 6:59 pm 
Offline
Apprentice
Apprentice
User avatar

Joined: Mon Jul 28, 2008 3:06 am
Posts: 156
ES Games: Morrowind, Oblivion, Skyrim
Platform: PC
UESPoints: 0
Trelares wrote:
Thanks, you indirectly helped me alot.

The problem was, I copied the tower perk and didn't look into the Target Conditions, so my perks had scripted and target conditions and this mixed not very well.
(and I don't like the conditions windows, better to script it all!)

No problem. I have mixed feelings about the conditions, as well. Sometimes they're reliable and sometimes they don't work at all. My rule of thumb is: if Bethesda uses conditions for something similar, I do as well.

Trelares wrote:
Maybe if I can add a question:

Does anybody know how to increase the Jump Height? There is an Actor Value for Jump Boost but Beth didn't implement it.

I think you need to modify the game setting called fJumpHeightMin. I did that once with my character, trying to jump into the Void. :P


Top
 Profile  
 
 Post subject: Re: Script's won't work proper
PostPosted: Fri Dec 21, 2012 7:24 pm 
Offline
Master
Master
User avatar

Joined: Mon Dec 13, 2010 12:52 pm
Posts: 1374
Location: Vienna, Austria (and no we have no Kangaroos!)
ES Games: Morrowind, Oblivion, Skyrim
Platform: PC
Status: ...
UESPoints: 0
Thanks you are really helpfull, Thumbs UP!

Created 3 new spells (with perks^^) 2 Slowfall and 1 Swift Swim.

The slowfall ones work perfect but the swiftsim not quite as expected.

For Swift Swim I add a perk through a spell which checks for the condition of IsSwimming, when the Player swims I increase the Actor Value SpeedMult by 50 (means 50% faster swimming) through adding an ability. So far so good this works, but if I then leave the water and touch land again, the Ability remains until the spell effect wears off. I thought the Perk would be checked continous and the ability removed if the condition is wrong, but my logic seems flawed.

Is there an easy way to remove the ability when the player stops swimming?

_________________
Kinsman, House Hlaalu

RFC 5513


Top
 Profile  
 
 Post subject: Re: Script's won't work proper
PostPosted: Fri Dec 21, 2012 7:28 pm 
Offline
Mod On Leave
Mod On Leave
User avatar

Joined: Tue Nov 15, 2011 5:06 am
Posts: 2876
Location: Your dreams
ES Games: Morrowind, Oblivion, Skyrim
Platform: Xbox, PC, STD
Status: Smurfin'
Other Profiles: Gamertag: MightyGo0dLeadr
UESPoints: 15
You could add a script directly to the Player that removes the ability (if it is there) when they stop swimming.

_________________


Top
 Profile  
 
 Post subject: Re: Script's won't work proper
PostPosted: Sat Dec 22, 2012 6:23 am 
Offline
Master
Master
User avatar

Joined: Mon Dec 13, 2010 12:52 pm
Posts: 1374
Location: Vienna, Austria (and no we have no Kangaroos!)
ES Games: Morrowind, Oblivion, Skyrim
Platform: PC
Status: ...
UESPoints: 0
Nice Idea, have found another way although. If I add the IsSwimming condition to the Ability itself it adds the Bonus Speed when I swim and removes it when not. But seen a really annyoing problem now, I thought the speed multiplier would work but it only worked because the IsSwimming Check in the Perk didn't work and I got the speed bonus always. Now the speed bonus is just applied in water but will only work if I first moveout off the water and then move in again. The Actor Value is 200 while I swimm but it won't take effect till I first run on land the first time.

Edit: Ok I found out why this happens, the game recognizes the change only if you open up a menu or sheat/unsheat your weapon, start sneaking....

Edit2: HAHA, found something through Google which was quite helpfull: If you refresh the CarryWeight the game will recognize the speed change. Added the final solution into a spoiler for those programming nerds who want to see some "magic"^^.

Spoiler:
Scriptname SotTE_RemoveSwim extends activemagiceffect

Actor Target

int turn = 1

Event OnEffectStart(Actor akTarget, Actor akCaster)
Target = akTarget
Target.AddSpell(SotTE_PerkSwimming,false)
RegisterForUpdate(1.0)
endEvent

Event OnUpdate() ; This event occurs every second
Target.ModActorValue("CarryWeight", turn)
Target.ModActorValue("CarryWeight", -turn)
EndEvent

SPELL Property SotTE_PerkSwimming Auto

_________________
Kinsman, House Hlaalu

RFC 5513


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Sponsored Links

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group