Jump to content

Some questions about scripting and commands.


egon123

Recommended Posts

Hello everyone! :)

I started to build a mod for my own use. It aims to give me some more dialogue options and/or lead to a scene.

Since I'm not that experienced with scripts, I choose to start this topic. Maybe someone can me give some hints and tips for problems I've encountered.

 

First: Re-Equip!

Basically, I need a system to let an npc reequip his armor.

Without mods, straight in the game, the options are to give the npc something in the inventory, or simply disable/enable.

For now I have a work-around dialogue option that disables/enables the npc. But this is not very... smooth..

I tried to create a script that gives and removes the npc a torch. So the inventory gets an update. This should be a two liner, but I couldn't find the right commands.

 

Second: Idle length in ck!

You can give npcs a idle to play, when they say a dialogue. I experimented a bit with that an created some own idles. Like bend over animations from SL animations. It worked good. But there is a downside: The idle has basically no end, or length. The Npc, for example, would forever bend over unless I reset the idle via a dialogue. 

Is there a way to give custom idles in ck a max run time? The option where you create this idles have no effect. Or is this set in the animation itself?

 

Third: Actor detection!

Lets say you have a dialogue with an npc and a female follower with you. The npc should address said follower. The best way should be a alias for the follower so I could use this as a condition in the dialogue. But how do I get the follower in there in the first place? Manually with a "Your my follower" dialogue and a script that sets him as a quest alias would work, but it's.. not very smooth..

I looked in the eager npc script, since it should have a similar function for the three-way, but since there are so many different functions in one script, it's hard to find the right lines.

 

Fourth: More Actor detection with dialogue opening!

This is more of an extension of the previous case. Lets say we play as a fem char. And she is nude. The script should look for a dog, in best case aroused, and let him sniff at her. Possibly opens a dialogue where you can choose how to react.

Basically, an npc should be aware that the pc is nude and do something (with a % chance).

There are mods like aroused animals that have something similar, but it ends in sex. Here I want to create a scenario.

 

Fifth: Horses don't talk!

Is there a way to open a dialogue with a horse? With E you ride it. I tested with a spell from FLP that opens a dialogue when hit, but this doesn't work on horses somehow.

 

Thats it for now :) I know it's many stuff, but I found it easier to just ask here if maybe someone give me some tipps :)

Link to comment

Let's see...

 

1) I think the functions you're looking for are ObjectReference.addItem() and ObjectReference.removeItem(). I'm not sure they actually force an equipment reset, but you could just try :)

 

2) No idea, never messed with animations.

 

3) and 4): One way to do this is to have a alias holder quest that has aliases, which are set to be filled with the closest matching actor, with conditions that filter for the kind of actor you want to find. Then have a second quest that restarts the holder quest periodically, so that the aliases get refilled.

 

5) No idea, never messed with horses.

Link to comment

Let's see...

 

1) I think the functions you're looking for are ObjectReference.addItem() and ObjectReference.removeItem(). I'm not sure they actually force an equipment reset, but you could just try :)

 

2) No idea, never messed with animations.

 

3) and 4): One way to do this is to have a alias holder quest that has aliases, which are set to be filled with the closest matching actor, with conditions that filter for the kind of actor you want to find. Then have a second quest that restarts the holder quest periodically, so that the aliases get refilled.

 

5) No idea, never messed with horses.

 

Thanks for the hints :)

 

1) It should theoretically work. I did it before manual ingame with followers. It seems like that when somehing in the inventory changes, or at least an item that can be equipt, the npc checks for the new best equip and take this on. I wanted to use torches but I can't find them in the properties. It should be a misc item. Every other misc item is listed there, just not the stupid torch.

 

3-4) A holder Quest is interesting. I took a look at aroused creatures, because it uses basically the same function. Scan surrounding, put matches into alias, do something with it. And yes, it uses a alias holder quest, too. Wasn't aware of that.

Now I need a way to put them into alias in the first place. I studied the aroused creatures and eager npcs scripts. But when you have no real knowledge about scripts it gets very fast complicated.

Link to comment

 

Let's see...

 

1) I think the functions you're looking for are ObjectReference.addItem() and ObjectReference.removeItem(). I'm not sure they actually force an equipment reset, but you could just try :)

 

2) No idea, never messed with animations.

 

3) and 4): One way to do this is to have a alias holder quest that has aliases, which are set to be filled with the closest matching actor, with conditions that filter for the kind of actor you want to find. Then have a second quest that restarts the holder quest periodically, so that the aliases get refilled.

 

5) No idea, never messed with horses.

 

Thanks for the hints :)

 

1) It should theoretically work. I did it before manual ingame with followers. It seems like that when somehing in the inventory changes, or at least an item that can be equipt, the npc checks for the new best equip and take this on. I wanted to use torches but I can't find them in the properties. It should be a misc item. Every other misc item is listed there, just not the stupid torch.

 

3-4) A holder Quest is interesting. I took a look at aroused creatures, because it uses basically the same function. Scan surrounding, put matches into alias, do something with it. And yes, it uses a alias holder quest, too. Wasn't aware of that.

Now I need a way to put them into alias in the first place. I studied the aroused creatures and eager npcs scripts. But when you have no real knowledge about scripts it gets very fast complicated.

 

 

1) The way torches are implemented seems to be some kind of black magic - and I don't mean the kind that uses magicka. They're actually a LIGH object with the 'can be carried' flag set. Their id is Torch01 / 0001D4EC

 

3/4) Aliases - if set up correctly - are filled automatically when a quest is started. So all you need to do in the script is call holderquest.stop() and holderquest.start() every now and then.

Just make sure your Reference Alias is set up as follows: In the top right corner, tick "Optional", "Allow reserved", but nothing else. In the "Fill Type" form, select "Find matching reference" and tick "In loaded area" and "Closest", then add your conditions into the list below that.

 

 

Link to comment

 

 

Let's see...

 

1) I think the functions you're looking for are ObjectReference.addItem() and ObjectReference.removeItem(). I'm not sure they actually force an equipment reset, but you could just try :)

 

2) No idea, never messed with animations.

 

3) and 4): One way to do this is to have a alias holder quest that has aliases, which are set to be filled with the closest matching actor, with conditions that filter for the kind of actor you want to find. Then have a second quest that restarts the holder quest periodically, so that the aliases get refilled.

 

5) No idea, never messed with horses.

 

Thanks for the hints :)

 

1) It should theoretically work. I did it before manual ingame with followers. It seems like that when somehing in the inventory changes, or at least an item that can be equipt, the npc checks for the new best equip and take this on. I wanted to use torches but I can't find them in the properties. It should be a misc item. Every other misc item is listed there, just not the stupid torch.

 

3-4) A holder Quest is interesting. I took a look at aroused creatures, because it uses basically the same function. Scan surrounding, put matches into alias, do something with it. And yes, it uses a alias holder quest, too. Wasn't aware of that.

Now I need a way to put them into alias in the first place. I studied the aroused creatures and eager npcs scripts. But when you have no real knowledge about scripts it gets very fast complicated.

 

 

1) The way torches are implemented seems to be some kind of black magic - and I don't mean the kind that uses magicka. They're actually a LIGH object with the 'can be carried' flag set. Their id is Torch01 / 0001D4EC

 

3/4) Aliases - if set up correctly - are filled automatically when a quest is started. So all you need to do in the script is call holderquest.stop() and holderquest.start() every now and then.

Just make sure your Reference Alias is set up as follows: In the top right corner, tick "Optional", "Allow reserved", but nothing else. In the "Fill Type" form, select "Find matching reference" and tick "In loaded area" and "Closest", then add your conditions into the list below that.

 

 

 

 

1) I will take a look at this. Thank you!

 

3/4) Ah! I was expecting something in a script like "find actor with condition X and set him as actor Y". But this would make things much more easier! :)

Stop before start? I was expecting the other way around.

Link to comment

 

3/4) Ah! I was expecting something in a script like "find actor with condition X and set him as actor Y". But this would make things much more easier! :)

Stop before start? I was expecting the other way around.

 

 

Well, the alias only 'exists' while the quest is running, so you usually just want to restart the quest at certain intervals, and have it running otherwise. And for the conditions, those can be set in the alias window in the CK.

 

Link to comment

2. When you need to interrupt "continious" animation, just use

debug.SendAnimationEvent(akActor, "IdleForceDefaultState")

where akActor is yours animating Actor.

4. HorseRace has no 'Allow PC Dialogue' flag set in CK. As a solution without breaking 'vanilla' Skyrim: create a Perk with Perk Entry (conditions for Target GetIsRace(HorseRace) == 1) where Entry Point is set to Activate->Add Activate Choice, Button Label, let's say, "Talk" and via script initiate dialogue.

 

Kind Regars

Link to comment

 

 

3/4) Ah! I was expecting something in a script like "find actor with condition X and set him as actor Y". But this would make things much more easier! :)

Stop before start? I was expecting the other way around.

 

 

Well, the alias only 'exists' while the quest is running, so you usually just want to restart the quest at certain intervals, and have it running otherwise. And for the conditions, those can be set in the alias window in the CK.

 

 

 

Update:

I've set it up so far. Got a bit complicated. I've made a holding quest and made some alias in the "main" quest that gets filled with the ones in the holding. Problem here: From my understanding, Alias get filled once a quest starts. So I had to make a debug reset for the main Q for testing. But when the ones in the holding Quest changes, does the alias change, too or do I need to reset the "main" quest in order to refresh them? If yes, do I need a holding quest at all then? And is there a way to let the alias update periodical?

 

I was hoping that with the holding quest I could just link the alias in the "main"-Q, so when I call a alias as condition, it would get the info from the holding Quest.

Or more simple: How do I fill the alias in the "Main"-Q?

 

 

 

2. When you need to interrupt "continious" animation, just use

 

debug.SendAnimationEvent(akActor, "IdleForceDefaultState")

 

where akActor is yours animating Actor.

 

4. HorseRace has no 'Allow PC Dialogue' flag set in CK. As a solution without breaking 'vanilla' Skyrim: create a Perk with Perk Entry (conditions for Target GetIsRace(HorseRace) == 1) where Entry Point is set to Activate->Add Activate Choice, Button Label, let's say, "Talk" and via script initiate dialogue.

 

 

 

Kind Regars

 

2.  I tried to give the idle itself a "run time". Like a drinking idle. They run once and are done. The self made from the SL Animations loop forever. For now I "endet" them with the sexlab idle reset idle :)

Maybe I can call the idle via script and then let it stop after some time. But with how many I use this new idles, It would get a real script spam :D

 

4. Thats interesting. I've had the case that, when I wanted to ride, the a dialogue popped up. So I had to TAB out. At some point it was gone. Looks like a Mod overwrote the race. Thanks for the hint!

Link to comment

 

2.  I tried to give the idle itself a "run time". Like a drinking idle. They run once and are done. The self made from the SL Animations loop forever. For now I "endet" them with the sexlab idle reset idle :)

Maybe I can call the idle via script and then let it stop after some time. But with how many I use this new idles, It would get a real script spam :D

In common, maybe I'm wrong about Idles, because always trying to manipulate animations in my mods 'direct', not via CK's Idle. Difference between 'single' and 'continious' that obviously 'continious' really has 2 animations: 'enter' and 'loop' (sometimes and 'exit'). If from Idles you use "enter" animation, but it will call endless "loop" by itself. If it's called on PC, "jump" is enough to exit. For correct manage even in SexLab (it's uses SAME ANIMATIONS like others, some 'single', some 'endless') sometimes is used SetStageTimer() that setups real timelength of animation and itself SexLab calls "IdleForceDefaultState" if this is LAST stage or start next stage (again, via debug.SendAnimationEvent()).

 

Just remember,

debug.SendAnimationEvent(ObjectReference arRef, string asEventName)

uses as asEventName an just "identifier" from FNIS_modname_List.txt

 

for example, calling via papyrus:

debug.SendAnimationEvent(game.getplayer(), "AggrBehind_A1_S1")

just calls SexLab's "Rough Behind" stage 1 for first actor SL animation on PC even without partner

 

"IdleForceDefaultState" just enters an actor to "default" state

Kind Refards.

Link to comment

 

 

2.  I tried to give the idle itself a "run time". Like a drinking idle. They run once and are done. The self made from the SL Animations loop forever. For now I "endet" them with the sexlab idle reset idle :)

Maybe I can call the idle via script and then let it stop after some time. But with how many I use this new idles, It would get a real script spam :D

In common, maybe I'm wrong about Idles, because always trying to manipulate animations in my mods 'direct', not via CK's Idle. Difference between 'single' and 'continious' that obviously 'continious' really has 2 animations: 'enter' and 'loop' (sometimes and 'exit'). If from Idles you use "enter" animation, but it will call endless "loop" by itself. If it's called on PC, "jump" is enough to exit. For correct manage even in SexLab (it's uses SAME ANIMATIONS like others, some 'single', some 'endless') sometimes is used SetStageTimer() that setups real timelength of animation and itself SexLab calls "IdleForceDefaultState" if this is LAST stage or start next stage (again, via debug.SendAnimationEvent()).

 

Just remember,

debug.SendAnimationEvent(ObjectReference arRef, string asEventName)

uses as asEventName an just "identifier" from FNIS_modname_List.txt

 

for example, calling via papyrus:

debug.SendAnimationEvent(game.getplayer(), "AggrBehind_A1_S1")

just calls SexLab's "Rough Behind" stage 1 for first actor SL animation on PC even without partner

 

"IdleForceDefaultState" just enters an actor to "default" state

Kind Refards.

 

Forget all the parameters that CK provides. They are all ignored. For simple idles it is useless to define them in CK, it just makes scripts more complicated.

 

Everything what vpoteryaev says is correct. However I find it too abrupt when "IdleForceDefaultState" is used to end an animation.

 

What I prefer is to define a "sequenced animation" in FNIS.

 

sa -a <enter_event> <enter_animation>.hkx

+ <loop_event> <loop_animation>.hkx

+ -a <exit_event> <exit_animation>.hkx

 
Then you can simply end the loop with debug.SendAnimationEvent(player, "<exit_event>"). And you will get a much smoother transition than with IdleForce. You can even modify the transition duration (0.6 sec by default) with the "-B" parameter. Like in
+ -a,B1.0 <exit_event> <exit_animation>.hkx
 
The best results you get when you have seperate enter and exit animations. But if you don't, then you can simply use mt_idle.hkx. Even Skyrim does this every now and then.

 

Link to comment

Thanks for that, you two! I think I can limit the length with that! :)

 

About the whole alias thing:

I still struggle to get the Alias from the Main-Q filled with the one from the holding quest.

I thought it would be clever to add a script to the (holding) Alias that forces the Ref to be filled in the Main one:

 

 

Scriptname tif__Move_Alias1 extends ReferenceAlias


Function MoveAlias1(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor

alias1.ForceRefTo(akSpeaker)

EndFunction


ReferenceAlias property Alias1 auto

 

But so far it don't work. I was thinking that, when an alias gets filled, the script runs on him and so the other alias would be filled.

So Point is, I have no Idea if the script itself is wrong or the script don't get called because it needs another condition to be fired beside the alias beeing filled..

Link to comment

 

 

Forget all the parameters that CK provides. They are all ignored. For simple idles it is useless to define them in CK, it just makes scripts more complicated.

 

Everything what vpoteryaev says is correct. However I find it too abrupt when "IdleForceDefaultState" is used to end an animation.

 

What I prefer is to define a "sequenced animation" in FNIS.

 

sa -a <enter_event> <enter_animation>.hkx

+ <loop_event> <loop_animation>.hkx

+ -a <exit_event> <exit_animation>.hkx

 
Then you can simply end the loop with debug.SendAnimationEvent(player, "<exit_event>"). And you will get a much smoother transition than with IdleForce. You can even modify the transition duration (0.6 sec by default) with the "-B" parameter. Like in
+ -a,B1.0 <exit_event> <exit_animation>.hkx
 
The best results you get when you have seperate enter and exit animations. But if you don't, then you can simply use mt_idle.hkx. Even Skyrim does this every now and then.

 

I will be happiest person if EVERY animator would provide exit 'stages' - all smooth and no stupid 'jerkings' ;)

Kind Regards

Link to comment

Thanks for that, you two! I think I can limit the length with that! :)

 

About the whole alias thing:

I still struggle to get the Alias from the Main-Q filled with the one from the holding quest.

I thought it would be clever to add a script to the (holding) Alias that forces the Ref to be filled in the Main one:

 

 

Scriptname tif__Move_Alias1 extends ReferenceAlias

 

 

Function MoveAlias1(ObjectReference akSpeakerRef)

Actor akSpeaker = akSpeakerRef as Actor

 

alias1.ForceRefTo(akSpeaker)

 

EndFunction

 

 

ReferenceAlias property Alias1 auto

 

But so far it don't work. I was thinking that, when an alias gets filled, the script runs on him and so the other alias would be filled.

So Point is, I have no Idea if the script itself is wrong or the script don't get called because it needs another condition to be fired beside the alias beeing filled..

Quest's scripts (and functions) that ARE "children' of Form as 'base' parent are avilable for execute/running at ANYTIME, even quest is NOT running.

BUT

For manipulating aliases (aliases stripts) - quest must be started BEFORE or they will be 'refilled' with used by you conditions when quest starts.

Obviously adding an Actor or something to quest's aliases happens not in aliase's script. For example, in topic's script. But Alias script allow you to change Reference on fly as you tried, but quest MUST be in running state.

1 Scriptname tif__Move_Alias1 extends ReferenceAlias
2 Function MoveAlias1(ObjectReference akSpeakerRef)
3     Actor akSpeaker = akSpeakerRef as Actor
4     alias1.ForceRefTo(akSpeaker)
5 EndFunction
6 ReferenceAlias property Alias1 auto

In yours 'Alias' script line 6 unnecessary, enough to use 'self', meaning by default.

Scriptname Move_Alias1 extends ReferenceAlias

Function MoveAlias1(ObjectReference akSpeaker)
    ForceRefTo(akSpeaker)
EndFunction

'Course if this script is attached to alias, not to Topic. But Quest MUST be running.

 

Kind Regards.

 

ADDED/CHANGED: My English sometimes too bad... alias-aliace, frgive me

Link to comment

Quest's scripts (and functions) that ARE "children' of Form as 'base' parent are avilable for execute/running at ANYTIME, even quest is NOT running.

BUT

Quest's scripts (and functions) that ARE "children' of Form as 'base' parent are avilable for execute/running at ANYTIME, even quest is NOT running.

For manipulating aliaces (aliaces stripts) - quest must be started BEFORE or they will be 'refilled' with used by you conditions when quest starts.

Obviously adding an Actor or something to quest's aliaces happens not in aliace's script. For example, in topic's script. But Aliace script allow you to change Reference on fly as you tried, but quest MUST be in running state.











1 Scriptname tif__Move_Alias1 extends ReferenceAlias
2 Function MoveAlias1(ObjectReference akSpeakerRef)
3     Actor akSpeaker = akSpeakerRef as Actor
4     alias1.ForceRefTo(akSpeaker)
5 EndFunction
6 ReferenceAlias property Alias1 auto

In yours 'Aliace' script line 6 unnecessary, enough to use 'self', meaning by default.











Scriptname Move_Alias1 extends ReferenceAlias

Function MoveAlias1(ObjectReference akSpeaker)
    ForceRefTo(akSpeaker)
EndFunction

'Course if this script is attached to aliace, not to Topic. But Quest MUST be running.

 

Kind Regards.

 

Ah! Is this script for the receiving or sending alias? Because I attached mine to the sending. Thats why I refenrenceAlias the Alias1 so the script knows what this is.

But when I would attach this to the receiving, Wouldn't I need a RefenreceAlias for the Sending-Alias?

 

somehing like:

 


Scriptname Move_Alias1 extends ReferenceAlias

 

Function MoveAlias1(ObjectReference sending1) 

ForceRefTo(sending1) 

 

EndFunction

ReferenceAlias property Sending1 auto

 

Or probably, because I think the ForceRefto needs an actor:

 

 

Scriptname Move_Alias1 extends ReferenceAlias

 

Function MoveAlias1(ObjectReference sending1) 

Actor Test = sending1.GetActorRef() as Actor

ForceRefTo(Test) 

 

EndFunction

ReferenceAlias property Sending1 auto

 

 

Link to comment

I'm entering in some kind of misuderstanding ;)

My example script is attached to Alias. Or you tried to attach 'extends ReferenceAlias' to Topic's script?

For sending from Topic you must have something like:

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname NNNNNNN Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
Alias1.ForceRefTo(akSpeaker)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

ReferenceAlias property Alias1 auto

But...

Link to comment

I'm entering in some kind of misuderstanding ;)

My example script is attached to Alias. Or you tried to attach 'extends ReferenceAlias' to Topic's script?

For sending from Topic you must have something like:





;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname NNNNNNN Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
Alias1.ForceRefTo(akSpeaker)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

ReferenceAlias property Alias1 auto

But...

 

Nono, you was right. It is attached to an alias :) There are two aliases. One in a "scanning" quest where I attached the script on him. And a second in a "Main"-Quest where I want to use him. So in order to not need to restart the Main-Quest all over again, I do this with the scan-quest and let the scanned alias forced into the main one. 

I was confused, because I didn't see the Alias1 before your "ForceRefTo" and I was thinking, that the script don't know where to put it. When I put it on the receiving (in the main quest) it would count as self. But then I would need to tell him which alias he should take the information from. That's why I asked :)

 

Seems like there is another problem. The alias script don't fire. I wrote some 

Game.GetPlayer().AddItem(Gold001, 1000)

into it. So when everything would work as it should and the script is called, I would get some gold! But I didn't :( Seems like the script don't fire (I used my old script before, not yours. Just to test if it gets called or not)

Link to comment

Script that attached to Alias means 'self' exactly THIS alias

Topic's:

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname NNNNNNN Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
(Alias1 as Move_Alias1).MoveAlias1(akSpeaker)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

ReferenceAlias property Alias1 auto

Alias has attached:

Scriptname Move_Alias1 extends ReferenceAlias

Function MoveAlias1(ObjectReference akSpeaker)
    ForceRefTo(akSpeaker)
EndFunction
Link to comment

 

Script that attached to Alias means 'self' exactly THIS alias

Topic's:





;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname NNNNNNN Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
(Alias1 as Move_Alias1).MoveAlias1(akSpeaker)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

ReferenceAlias property Alias1 auto

Alias has attached:





Scriptname Move_Alias1 extends ReferenceAlias

Function MoveAlias1(ObjectReference akSpeaker)
    ForceRefTo(akSpeaker)
EndFunction

 

Okay, I thing I'm getting behind the problem.

I've attached a script to the alias that do nothing else, just to give the player gold. I've got no gold so I think the script don't fire from alone.

In your example here (thank you for that :) ), you used a topic script to call the alias script which adds the Speaker to the alias. Is this right?

In my case, I don't want the speaker in this alias. I want the actor from another alias written there. What would be the best way to do it? Or lets say, call the script in the first place?

 

 

 

Results of 'Scanning' quest just put in 'own' properties of Main-Quest. And use properties, not data from 'Scanning'

 

And check for Papyrus log, maybe you with adding 'open' (not hidden or autoreadonly) properties forget to initiate.

 

Yeah, thats basically what I try to achieve. And fail with :D

Log didn't report anything from the scripts.

Link to comment

 

 

 

Script that attached to Alias means 'self' exactly THIS alias
Topic's:

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname NNNNNNN Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
(Alias1 as Move_Alias1).MoveAlias1(akSpeaker)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

ReferenceAlias property Alias1 auto
Alias has attached:
Scriptname Move_Alias1 extends ReferenceAlias

Function MoveAlias1(ObjectReference akSpeaker)
    ForceRefTo(akSpeaker)
EndFunction
 
Okay, I thing I'm getting behind the problem.
I've attached a script to the alias that do nothing else, just to give the player gold. I've got no gold so I think the script don't fire from alone.
In your example here (thank you for that :) ), you used a topic script to call the alias script which adds the Speaker to the alias. Is this right?
In my case, I don't want the speaker in this alias. I want the actor from another alias written there. What would be the best way to do it? Or lets say, call the script in the first place?

 

 

 

For Papyrus/Skyrim there is no matter where from MoveAlias1() is called. Just quest must be running.

Scriptname Move_Alias1 extends ReferenceAlias

Function MoveAlias1(ObjectReference akActor)
    ForceRefTo(akActor)
EndFunction

only add a check for correct reference inside, that accept your rules, smth like

Function MoveAlias1(ObjectReference akActor)
    if(akActor && akActor.HasKeyword(smth...............))
        ForceRefTo(akActor)
    endif
EndFunction
Link to comment

 

For Papyrus/Skyrim there is no matter where from MoveAlias1() is called. Just quest must be running.





Scriptname Move_Alias1 extends ReferenceAlias

Function MoveAlias1(ObjectReference akActor)
    ForceRefTo(akActor)
EndFunction

only add a check for correct reference inside, that accept your rules, smth like





Function MoveAlias1(ObjectReference akActor)
    if(akActor && akActor.HasKeyword(smth...............))
        ForceRefTo(akActor)
    endif
EndFunction

 

I see. So all I need is to define what akActor is. Tell me when I'm wrong, but I could take instead of akactor something like "Holder1" and define that property that it is the alias I want to move.

Then add this script to the alias that should receive and call the script somehow. (via topic script or whatever)

 

Edith:

I think I've got it working!

Just needed something that called the script that was on the alias. I used a gate-Dialogue. Maybe I can optimize it a bit more, but for now the alias in the main-q received the other one.

Now I need to find a good way to let the quest scan here and there. Best thing would be some automatic, so I could call events on some hits. But until then two lines in the gate-topic has to do it.

 

However, since the foundation works so far, I thank you all very much for your help! :)

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use