Quick CK questions Thread #2

Post » Tue Jun 19, 2012 7:01 pm

Are there no roots or exponents in Papyrus expressions?
I tried to make calculate a variable using "^" to denote an exponent, but the compiler does not recognize it and the wiki only lists multiply, divide and modulus.
User avatar
Eibe Novy
 
Posts: 3510
Joined: Fri Apr 27, 2007 1:32 am

Post » Tue Jun 19, 2012 12:39 pm

Yes, there's sqrt() & pow()
To use them in your scripts then at the top type...
Import http://www.creationkit.com/Math_Script
User avatar
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Tue Jun 19, 2012 1:12 pm

Yes, there's sqrt() & pow()
To use them in your scripts then at the top type...
Import http://www.creationkit.com/Math_Script

Or you can just call Math.sqrt(), Math.pow(), etc.
User avatar
Steph
 
Posts: 3469
Joined: Sun Nov 19, 2006 7:44 am

Post » Tue Jun 19, 2012 7:31 pm

Yes, there's sqrt() & pow()
To use them in your scripts then at the top type...
Import http://www.creationkit.com/Math_Script

Thanks a lot. Hadn't thought to check for math functions...

Now does anyone know how you give the player abilities on games startup/Savegame load? I can set them as player starting spells, but that won't help with games already running.
User avatar
Felix Walde
 
Posts: 3333
Joined: Sat Jun 02, 2007 4:50 pm

Post » Tue Jun 19, 2012 7:11 am

Set up a reference alias with the spells. Fill the alias with the player.

Alternatively, you can just have your quest script add the spells to the player OnInit.
User avatar
stacy hamilton
 
Posts: 3354
Joined: Fri Aug 25, 2006 10:03 am

Post » Tue Jun 19, 2012 8:33 pm

Set up a reference alias with the spells. Fill the alias with the player.

Alternatively, you can just have your quest script add the spells to the player OnInit.

Thanks. OnInit works great, I don't even need the ability now. Now I am trying to let quests handle the upgrades via "Skill increase" quests with "event onStoryIncreaseSkill" events that update the modifiers. However, the scripts wont fire.

How do I have to setup the quest to run the associated scripts everytime the player gets a skill increase?


Edit: Ok, got it to work, now I only need to figure out how to repeat this quest indefinetly..
Edit2: And done. Resetting the quest at the end of the script works.
User avatar
neil slattery
 
Posts: 3358
Joined: Wed May 16, 2007 4:57 am

Post » Tue Jun 19, 2012 5:12 pm

Not really a CK question, but it's a quick one:

About how long should the voice extraction (when using the BSA Browser) take? It's been loading for 18 minutes and it seems like the extraction is completed, but it shows it's still loading (and thus blocking any further use of the BSA browser). The textures extraction didn't take more than a few minutes and the voice-pack is actually smaller than the textures.

So should I be worried or is this normal? :smile:

Edit: Ok so it took 23 minutes totally before it finished, that information might be useful to someone :) (the textures extraction only took 4 minutes)
User avatar
Kate Murrell
 
Posts: 3537
Joined: Mon Oct 16, 2006 4:02 am

Post » Tue Jun 19, 2012 9:17 pm

Hi there,

how or where can i add or rename menu options to the crafting menus?
If i edit a Keyword in the Editor ID section it doesn't come up ingame this way.
User avatar
QuinDINGDONGcey
 
Posts: 3369
Joined: Mon Jul 23, 2007 4:11 pm

Post » Tue Jun 19, 2012 5:30 pm

I have a question about enabling a trigger primitive. Basically, I worked for 2 or 3 hours trying to get a trigger to start disabled, enable at a certain quest stage and trigger a scene between my 2 characters. The first method I tried was creating the prim, giving it an alias and enabling it in the stage prior to my scene playing. I know the code was correct because it was the exact same format as a dozen others I had already made for other objects that enable at certain stages.

Alias_MyTriggerName.GetReference().Enable()

Even though I created the Quest Alias it failed to enable my trigger. So then, I thought I’d just give the trigger an editor ID and set a quest property for it and enable it that way. Didn’t work either, lol. Finally, the way I had to set it up was placing an Xmarker in the cell, set it to initially disabled, and then set the trigger’s enable parent linked to the Xmarker. I then had to define an Object Reference property on the Xmarker, and enable it through my quest stage. That eventually worked, but I don’t understand why the alias reference didn’t work. Is there something special about triggers that they cannot be set up via an alias?

Like I say, unless I had a complete brain fart, I had it set up correctly the first time. I already have at least a dozen other alias’ that I’m enabling and disabling other stuff so I believe it should have worked.

enabling/disabling triggers sounds goofy anyways. I'm not sure why.

I would just have the trigger not trigger until the correct quest stage. That sounds like the effect you're going for anyways. You can even use the DefaultSetStageOnEnter script for that. iirc it has a prereq stage in it, and a stage to set it to when it's triggered. You can also set exactly what actors will trigger it(possibly including player). If nothing else, you can open up that script and copy the relevant components to your own. If it doesn't have exactly what you're looking for look for any other trigger with 'default' and 'stage' in the name, and look through it's script. A good practice to see what's available anyways.
User avatar
Sanctum
 
Posts: 3524
Joined: Sun Aug 20, 2006 8:29 am

Post » Tue Jun 19, 2012 4:58 pm

What are the reasons a magic effect with the parameters:
value modifier; constant effect; self; School: None; Value: Destruction

Would not affect the Destruction score shown in the skill menu?
I can see the magic effect in the "active effects" tab, it has a magnitude (5), so the effect is clearly there, but for some reason my Destruction score does not increase.

Edit: Exact same Problem with "DestructionMod" and "DestructionPowerMod". Even though the Ability gets added on startup and the effect shows up, it is neither shown in the skill menu, nor does it influence any "getAV("Destruction") returns or perks scaling with destruction level.

Any thoughts?
User avatar
Margarita Diaz
 
Posts: 3511
Joined: Sun Aug 12, 2007 2:01 pm

Post » Tue Jun 19, 2012 10:27 am

Ive made a few worldspaces before with no problems, but the CK has decided to be different this time.
When i make the new worldspace, it will only give me 5x5 cells square. Normally if i kept moving from cell to cell it would just keep going and going.

Not quite sure whats wrong this time. Ive tried with small world on/off, Usable dimensions etc, but still no change. Plus ive never had to do that before. :shrug:

Any ideas?

edit- even tried a completly new plugin, Same problem.
User avatar
Charlotte Buckley
 
Posts: 3532
Joined: Fri Oct 27, 2006 11:29 am

Post » Tue Jun 19, 2012 11:02 am

What script dictates the werewolf ability to increase the timer per kill? I'm trying to add buffs for defeating enemies in combat and I'm at a loss of what to do. I figured looking at that script would help
User avatar
brenden casey
 
Posts: 3400
Joined: Mon Sep 17, 2007 9:58 pm

Post » Tue Jun 19, 2012 4:56 pm

What script dictates the werewolf ability to increase the timer per kill? I'm trying to add buffs for defeating enemies in combat and I'm at a loss of what to do. I figured looking at that script would help
PlayerWerewolfChangeScript for the PlayerWerewolfQuest.

Does anyone know how to set the conditions for a magic effect so that it only affects the caster or caster's allies? I took a quick look at some of the magic effects and I could only find:

GetShouldAttack : PlayerRef : == : 0

I can't figure out how to use this so that it takes the caster as a parameter. I don't want to just point to the reference for an NPC, because I want many NPCs to have this spell.
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am

Post » Tue Jun 19, 2012 11:22 am


Does anyone know how to set the conditions for a magic effect so that it only affects the caster or caster's allies? I took a quick look at some of the magic effects and I could only find:


Well, magic effects have "isHostiletoactor" and "isInFriendStateWithPlayer" as possible conditions, both seem to apply to what you are trying to do.
User avatar
Helen Quill
 
Posts: 3334
Joined: Fri Oct 13, 2006 1:12 pm

Post » Tue Jun 19, 2012 2:53 pm

Yeah, but my point is that I don't want to specify an actor. I want friends and enemies of the player to be able to use the spell effectively.
User avatar
Dean
 
Posts: 3438
Joined: Fri Jul 27, 2007 4:58 pm

Post » Tue Jun 19, 2012 8:45 am

Yeah, but my point is that I don't want to specify an actor. I want friends and enemies of the player to be able to use the spell effectively.

I don't get it. Magic effect conditions check the subject of the magic effect. if it is a friend of the caster (option 1) or non hostile to the caster (option 2) the effect is applied. No need to specify anything,
User avatar
Spooky Angel
 
Posts: 3500
Joined: Thu Aug 10, 2006 5:41 pm

Post » Tue Jun 19, 2012 1:46 pm

You are quite right, I was being an idiot.

I was copying the conditions from the CallToArms spell, which used GetShouldAttack with PlayerRef. For some reason, I got to thinking that I absolutely needed a reference in order to use the condition. I forgot that there was a default parameter of '[ TARGET ]'. So actually I didn't have to do anything at all, because the default value was already what I wanted.

But now I can't remember... For a spell or magic effect, what's the target and what's the subject?
User avatar
adame
 
Posts: 3454
Joined: Wed Aug 29, 2007 2:57 am

Post » Tue Jun 19, 2012 9:43 am

But now I can't remember... For a spell or magic effect, what's the target and what's the subject?

The target is the caster, the subject is the target (or, less confusingly, the subject is the subject of the magic effect).
User avatar
BrEezy Baby
 
Posts: 3478
Joined: Sun Mar 11, 2007 4:22 am

Post » Tue Jun 19, 2012 1:03 pm

I'm having an issue where the player keeps getting stuck on steps when controlled by an AI package so I am trying to write some script that determines if the player has moved. Having the 'x-50' anywhere in the code causes the error 'no viable alternative at input 'x''. If I change the 'x-50' to 'x+50' it compiles without error, but would then obviously not work. Why is using a simple - sign causing it not to compile?

  	Event OnUpdate()  		if ((Game.GetPlayer().GetPositionX()<(x+50)) && ((Game.GetPlayer().GetPositionX())>x-50))			x=Game.GetPlayer().GetPositionX()			y=Game.GetPlayer().GetPositionY()			z=Game.GetPlayer().GetPositionZ()			Game.GetPlayer().SetPosition(x, y, z+50)		endif		x=Game.GetPlayer().GetPositionX()	EndEventfloat xfloat yfloat z
User avatar
X(S.a.R.a.H)X
 
Posts: 3413
Joined: Tue Feb 20, 2007 2:38 pm

Post » Tue Jun 19, 2012 12:32 pm

Thanks alot Randomnoob.

Alrighty peeps another inquery, I have one spell with two different effects, I want it to function in that if your Magicka is greater than your heath, it will use one effect over the other. thing is other than scripting it, I don't see another method in the conditions list. any tips or is direct scripting the only method I have?
User avatar
kirsty joanne hines
 
Posts: 3361
Joined: Fri Aug 18, 2006 10:06 am

Post » Tue Jun 19, 2012 5:49 pm

@Emhyr, The -50 is being parsed as a value of -50. A space after the minus will parse as you intended.
User avatar
Jason White
 
Posts: 3531
Joined: Fri Jul 27, 2007 12:54 pm

Post » Tue Jun 19, 2012 3:10 pm

How do I get the actor dying in an OnDying event?
I have an activemagiceffect that listens to OnDying, but when I do self.Gettargetactor() in the event, I get NONE.
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Tue Jun 19, 2012 12:38 pm

What happens if you leave out the 'self'?
User avatar
Jack
 
Posts: 3483
Joined: Sat Oct 20, 2007 8:08 am

Post » Tue Jun 19, 2012 5:31 pm

What happens if you leave out the 'self'?

Nothing, since you need to call gettargetActor() on something :wink:
I managed to do it by listening to "OnEffectEnd", watiing 2 seconds and checking whether the target is now dead.

On to the next Problem: Reanimate is an aimed FF Magic Effect. Yet when cast, OnEffectStart returns the Player as the caster AND the target of the spell, treating it as if it was cast on self. How do I add effects to reanimates other than via perk?

Edit: Ok this is strange: Reanimate Secondary Effects works and gives the right target. I guess that explains why that effect is even there...
User avatar
Ana Torrecilla Cabeza
 
Posts: 3427
Joined: Wed Jun 28, 2006 6:15 pm

Post » Tue Jun 19, 2012 1:35 pm

I thought I asked this question last night, but now I can't find it. I must have closed with actually submitting...oops.

This is probably a stupid question, but I can't find the answer and I'd rather make sure rather than just assuming. If two mods add quests to the same event node, will it cause a conflict? For instance, if they both add quests to the node. I suppose they would conflict if they both modded the attributes or priority of a node...

Thank you in advance!
User avatar
sara OMAR
 
Posts: 3451
Joined: Wed Jul 05, 2006 11:18 pm

PreviousNext

Return to V - Skyrim