Jump to content

SendStoryEvent()


noctara

Recommended Posts

Helly everyone,

 

i got a small problem here. As much as I try for some reason I can't fill a certain alias from a SendStory Event.

 

I ll explain:

 

I created a mykeywordSendStoryEvent(Actor1, Actor2 as Actor) attached to an activator (extends ObjectReference)

 

i only defined Actor1 in the script (as i don't know how i could define actor2 any further... i cant use get linked ref because he will be placed through the quest)

 

Actor Actor1

Actor1Actor = (game.getplayer() as ObjectReference) as Actor

 

I also added a questnode and a quest (started on script event).

In the QuestAliasesTab i set AliasActor1 and AliasActor2 to be created via script event Ref1 & Ref2.

So now, while the Alias of Ref1 is filled i have problems with the Alias of Ref2 (Actor2).

 

Does anyone see where i am missing something or how to solve my little problem?

Any help would be greatly appreciated :thumbsup:

Link to comment
Share on other sites

What exactly are you trying to do? That would help a lot towards finding the best solution.

 

Are you sure it's even getting to the quest? Here is an example of a WEtrigger call to sendstory event.

 

WERoadStart.SendStoryEvent(myHoldLocation, Self, myHoldFactionControllerMarker, aiValue1 = EventNum)

 

This is from creationkit.com:

 

SendStoryEvent(Location akLoc = None, ObjectReference akRef1 = None, ObjectReference akRef2 = None, \

int aiValue1 = 0, int aiValue2 = 0)

 

Are you calling it via something like Mykeyword.SendStoryEvent(akRef1 = Actor1, akRef2 = Actor2)

 

You would need to define actor2 for that.... depending on the situation, there is probably a way to figure out what actor you want. Alternatively, if the actor is nearby when the quest fires up, don't bother with the event data, just find him like you would any other npc with the quest alias on startup. Set it to fill with nearest object ref matching conditions, then set the alias conditions to find who you want.

 

I'll also add, since it's a common hangup, are you sure your story manager event is above any other branches that would keep your quest from firing? Personally I'm usually pretty grabby in there and put my entries at the top of the stack.

Link to comment
Share on other sites

Hi Sinderions :biggrin: ,

 

i am still trying to get the camera mod working :whistling:

Actor2 and AliasActor2 is actually my cameraMan.

 

First: The Problem really lies in filling the aliases. The SM-logg tells me that the storymanager got the keyword and that the conditions are met. It even tells me, that the aliases coudn't be filled :tongue:

 

However, this question/ problem is more of general nature, as I have problems to understand the nature of aliases in cases of beeing filled by events.

I also still have trouble with understanding "references" in some cases.

 

So the questions are:

1. How would I define the parameter ref2 = actor2 when there is no objectreference in the world yet (cant use get linked ref)

2. Did i choose the wrong kind of "extends ... reference" (used ObjectReference) on the script?

3. Why doesn't "Actor2 as actor" define the parameter, while the function for actor1 does?

 

The thing is, I really want actor2 to fill through the storyEvent keyword.

I do know how to set it up if I wanted to fill the alias in another way...

 

And btw I really appreciate your kind help and advice... thanks for taking the time :thumbsup:

 

PS: I had a closer look at the companions mod... and i think i grabbed the general concept of how the author did the camera thing.

Not sure whether i am allowed to tell :biggrin: ... but i think he used a variable called "meAsActor" and switched it between the cartdriver and the horse.

 

Edit: the more I think about it, the more i get convinced, that there MUST be a objectreference in the world to get the alias filled.

Edited by noctara
Link to comment
Share on other sites

oh duh, what a lame reason to be stuck on a camera mod lol.

 

Have you set alias 2 to optional?

 

If any scripts run while alias2 isn't filled though, they'd have to first ForceRefIfEmpty() or some such operation to have anything to work with.

 

 

I'm still unclear as to why you really want an empty object reference passed via the story manager event. The point of the event is to give starting data to the quest. If there is a piece of data you don't have yet (actor2, created during the quest from what I am hearing). There's no point in it being passed to the story manager since it doesn't exist yet.

 

1. How would I define the parameter ref2 = actor2 when there is no objectreference in the world yet (cant use get linked ref)

 

If there's nothing to pass, there's no reason to pass it via the storymanager.

 

You could mess with PlaceAtMe() one of the cool things about this function, is that when you run it, it will return the reference to the thing it placed. For example:

 


Actor property myActorType auto
{ Set in CK to the type of actor to place}

Actor property myNewActor auto

myActorType = PlaceAtMe(akFormToPlace = myActor, abInitiallyDisabled = true)    ;Creates an actor, of type myActorType, initially disabled so you can use MoveTo() or whatever you need to get it set right.

 

Remember if you are using this in a quest, the property part would be in the quest script, and the function would be called from a fragment somewhere. The myActorType property would then be a good object reference, you could ForceRefIfEmpty() (to an 'optional' alias that wasn't filled) with that then.

Link to comment
Share on other sites

Yeah i am actually realising, that there is no need to fill the alias of actor2 through the storymanager.

 

I wanted to pass the keyword onto him. But i could as well just attach it to the actor and create the actor2 with alias when the sendstoryevent starts the quest (and enable him later via script if i wanted to hide him).

 

This whole thing doesnt have to do much with the camera mod in itself... but

a) I never used sendStoryEvent() so i wanted to try it :tongue:

b) I wanted to somehow reconstruct the appoach, which the person at the end of this thread was describing

http://forums.bethsoft.com/topic/1348962-setplayercontrols-and-papyrus/

 

Sometimes I really struggle with the whole programming stuff... also could't find many tutorials passed the beginner stuff (which I thought i understood)

 

Edit: I am actually using the placeatme() function in the questscript... but as u were guessing i didn't set the alias of actor2 as optional... duh

Edited by noctara
Link to comment
Share on other sites

Oh i see where you are coming from completely then, after reading that post. Yeah, you just need to get a target to send controls to, however you do it. The way in that post was just one way. So long as you end up with your two objects in the end you're good. Even if you made one of them :D

 

Papyrus can be a bit tough if you have no background whatsoever in anything like object oriented programming. The limited number of things you need to work with makes it way easier though. Since it's all in a nice neat little package of possibilities more or less, creating and trying more stuff is the real way to learn it anyways :D

Link to comment
Share on other sites

yeah, i realised that i should be fine with getting the camera man through "create alias in/at" the trick is to get the player into the alias which should be working already.

From there on, i can try out a couple of things, like passing a variable from one alias(actor) to the other (like i think it was done in the companions mod) or maybe even the setplayercontrols() function is going to work... i will see tonight :thumbsup:

 

would be nice to make some progress on that topic :biggrin:

Link to comment
Share on other sites

BOOM !! :teehee:

 

I ve done it!

Just tested ingame and the camera was snapping over the head of my CameraMan.

Now (tomorrow actually) I just need to clean up all the mess i created during the try and error process :biggrin:

When done, I will try to

1) add a short package to both the player and the cameraMan

2) set it up as generic as pssible (so u can call the quest/script anytime u want to create a own scene involving the player as actor)

 

After that i will write a description of how i did.

 

cheers and thx for ur help sinderions :thumbsup:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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