Jump to content

Script error - Forget a Cast !?


daisy8

Recommended Posts

Hi

I get 2 warnings when I try to compile this script.

 

The script is placed in the end box of a piece of dialog.

 

There are 3 properties - Object(veraliusmonk), alias(journalBaylann) and alias(robes)

if (GetOwningQuest().GetStageDone(30))

GetOwningQuest().SetObjectiveCompleted(36)

else

GetOwningQuest().SetObjectiveCompleted(30)

GetOwningQuest().SetObjectiveDisplayed(42)

GetOwningQuest().SetStage(42)

endif

veraliusmonk.AddItem(journalBaylann,1,false)

Game.GetPlayer().AddItem(robes)

 

(I am sorry for not being able to post the script properly - please tell me how to do that)

 

Warnings are

TIF__02018119.psc(21,13): type mismatch on parameter 1 (did you forget a cast?)

TIF__02018119.psc(22,17): type mismatch on parameter 1 (did you forget a cast?)

Both the robes and the journal are working aliases. I think that being aliases the additem isn't working but I don't know how to set them another way. Both objects are not in the world, just generated in inventories when required for the quest, so I cant work out how to set them as an object property.

 

Any help ?

Cheers

daisy

 

 

Link to comment
Share on other sites

Hi, thanks for the response. Yes, both are reference aliases

 

Not working either. Errors -

 

TIF__02018119.psc(21,36): GetRef is not a function or does not exist

TIF__02018119.psc(22,31): GetRef is not a function or does not exist

 

 

Any other ideas ?

Link to comment
Share on other sites

I have used Alias instead of ReferenceAlias.

 

Now I cant delete the properties I set before - I will need the name they have to match my aliases. Do you know how to delete a property from a script fragment that is in the dialog window. They don't appear under the scripts tab.

Link to comment
Share on other sites

  On 10/31/2013 at 4:38 AM, daisy8 said:

I have used Alias instead of ReferenceAlias.

 

Now I cant delete the properties I set before - I will need the name they have to match my aliases. Do you know how to delete a property from a script fragment that is in the dialog window. They don't appear under the scripts tab.

 

Just wading in here,

 

You can delete Properties of a Fragment by clicking edit source (In the Right Click menu in the Script list) and removing the Property entry from the source yourself. Removing and Adding Properties are the only edits you should ever do to fragments directly (The rest should be done via the inbuilt UI otherwise it will begin to fail to load.)

 

However if they are the auto generated ReferenceAlias/LocationAlias Properties... I wouldn't change them.

 

EDIT: Misread what fragment what you were working with don't worry about the last statement.

Edited by CraftySentinel
Link to comment
Share on other sites

Hi there

 

Yeah, in the end I have had dramas with my quest not beginning because all of this had screwed up my aliases somehow. Have since managed to delete the script on the end of a piece of dialog and fixed my aliases (by deleting them and setting them up again - the journal and the robe).

 

What I will now try is to do all this through a trigger box.

 

I am trying to give the player choice. In my quest you have the option of handing a journal, found at an early stage of the quest, to the monk or to continue exploring. The drama is that using stages to run the handoff of the journal will only work at one point in the list of stages so I need to make it so the journal can be handed off at any time. At that time I need the current objectives (Which include returning the journal and others depending on the point in the quest) to remain, the return journal objective to be completed, and then the quest to continue with the current objectives. If the stages advance the quest wont.

 

Will give it try now.

 

Cheers

 

PS I still do not understand the use of ReferenceAlias Properties. I have been using the following in quest stage fragments successfully but still don't get the use of these in dialog.

 

Alias_veraliusmonk.GetReference().AddItem(Alias_Baylanjournal1.GetReference())

Link to comment
Share on other sites

  On 10/31/2013 at 5:27 AM, daisy8 said:

PS I still do not understand the use of ReferenceAlias Properties. I have been using the following in quest stage fragments successfully but still don't get the use of these in dialog.

 

Alias_veraliusmonk.GetReference().AddItem(Alias_Baylanjournal1.GetReference())

 

Alias_AliasName is an automatically generated property for the Quest's Papyrus Fragment which points to the ReferenceAlias or LocationAlias of the same name. While it is prefixed with Alias it is not a Alias Type but a Derived Type of Alias, ReferenceAlias or LocationAlias.

 

You will almost never use Alias Types Directly.

 

Dialogues do not use the quest's papyrus fragment so you won't get access to the auto-generated Properties of the Quest's Fragment.

Link to comment
Share on other sites

OK Cool. So how then can I reference an object, in the boxes at the bottom of a dialog window (happens at the start or end of the speech), that is a quest alias but is not in the physical world (it generated into a NPC alias on quest begin) ?

 

How can I make this - Alias_veraliusmonk.GetReference().AddItem(Alias_Baylanjournal1.GetReference()) - work in the dialog window ?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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