trying to pass a string to and from a quest var

Post » Fri Nov 16, 2012 9:06 pm

This is what I am trying to do:

Scriptname aadpMainCombatQuest extends Quest String Property Feintmessage Auto



Scriptname aadpAllFeintsScript extends activemagiceffect  Quest Property aadpMainQuest  Auto  aadpMainCombatQuest Property Feintmessage autoEvent OnEffectStart(Actor akTarget, Actor akCaster)aadpMainQuest.Feintmessage = " Test worked"endevent


But I get this error on compile:


Feintmessage is not a property on script quest or one of its parents
type mismatch while assigning to a none (cast missing or types unrelated)


And when I tried this:


Scriptname aadpAllFeintsScript extends activemagiceffect  Quest Property aadpMainQuest  Auto  aadpMainCombatQuest Property Feintmessage autoEvent OnEffectStart(Actor akTarget, Actor akCaster)Feintmessage = " Test worked"endevent


I get this error:


type mismatch while assigning to a aadpmaincombatquest (cast missing or types unrelated)
User avatar
emily grieve
 
Posts: 3408
Joined: Thu Jun 22, 2006 11:55 pm

Post » Fri Nov 16, 2012 1:53 pm

you are example is assigning a string value to the entire script object itself

try this

Scriptname aadpAllFeintsScript extends activemagiceffect  Quest Property aadpMainQuest  Auto  aadpMainCombatQuest Property aadpMainCombatScript autoEvent OnEffectStart(Actor akTarget, Actor akCaster)aadpMainCombatScript.Feintmessage = " Test worked"endevent


if that doesnt work you can use brute force:

(aadpMainQuest as aadpMainCombatQuest).Feintmessage = " Test Worked"
User avatar
Tania Bunic
 
Posts: 3392
Joined: Sun Jun 18, 2006 9:26 am

Post » Fri Nov 16, 2012 6:02 pm

Did you compile the first script? If you try to compile the second without compiling the first its not going to exist.

Edit: Nevermind, you've got a syntax error. Like Amethyst said, you're trying to assign the string value to the script


Scriptname aadpMainCombatQuest extends Quest String Property Feintmessage Auto ; This is your property, a child of aadpMainCombatQuest



Scriptname aadpAllFeintsScript extends activemagiceffect  Quest Property aadpMainQuest  Auto  aadpMainCombatQuest Property Feintmessage autoEvent OnEffectStart(Actor akTarget, Actor akCaster)aadpMainQuest.Feintmessage = " Test worked" ; Your Feintmessage isn't a child of aadpMainQuest, its part of aadpMainCombatQuestendevent

What you have now would have to look like
Feintmessage.Feintmessage = "Test worked"
because you've defined Feintmessage as your Script object.
User avatar
Cagla Cali
 
Posts: 3431
Joined: Tue Apr 10, 2007 8:36 am

Post » Fri Nov 16, 2012 5:40 pm

so I only need to change this:

aadpMainCombatQuest Property Feintmessage auto

to this:

aadpMainCombatQuest Property aadpMainCombatScript auto


that is all?
User avatar
Naomi Ward
 
Posts: 3450
Joined: Fri Jul 14, 2006 8:37 pm

Post » Fri Nov 16, 2012 7:50 am

so I only need to change this:

aadpMainCombatQuest Property Feintmessage auto

to this:

aadpMainCombatQuest Property aadpMainCombatScript auto


that is all?


Feintmessage in your Mgef script is a Script Property.

Feintmessage in your quest script is a String property.

the format is:
Script.Property

yours would actually be
Feintmessage.Feintmessage (thats hella confusing and im not sure if it will even compile)
so its better to declare your script property as something other than Feintmessage
User avatar
Nicole Kraus
 
Posts: 3432
Joined: Sat Apr 14, 2007 11:34 pm

Post » Fri Nov 16, 2012 5:32 pm

so I only need to change this:
aadpMainCombatQuest Property Feintmessage auto
to this:
aadpMainCombatQuest Property aadpMainCombatScript auto
that is all?

Yes, I edited my post explaining what you were doing.
User avatar
C.L.U.T.C.H
 
Posts: 3385
Joined: Tue Aug 14, 2007 6:23 pm

Post » Fri Nov 16, 2012 2:57 pm

now I get this error:


Feintmessage is not a property on script quest or one of its parents
type mismatch while assigning to a none (cast missing or types unrelated)
User avatar
Heather M
 
Posts: 3487
Joined: Mon Aug 27, 2007 5:40 am

Post » Fri Nov 16, 2012 6:49 pm

did you fill the script property with the actual script?


IMO the brute force method is better than a script property to avoid these headaches in the future, plus it is easier to retrofit scripts using the brute force method as it doesnt need to change properties in the esp or save game)
User avatar
Anna Beattie
 
Posts: 3512
Joined: Sat Nov 11, 2006 4:59 am

Post » Fri Nov 16, 2012 11:09 am

wait wait...I need to catch up as a bunch of posts and edits came in as I posted my last post...
User avatar
Alexis Acevedo
 
Posts: 3330
Joined: Sat Oct 27, 2007 8:58 pm

Post » Fri Nov 16, 2012 6:27 am

Scriptname aadpMainCombatQuest extends QuestString Property Feintmessage Auto

Scriptname aadpAllFeintsScript extends activemagiceffect  Quest Property aadpMainQuest  Auto  aadpMainCombatQuest Property combatQuest autoEvent OnEffectStart(Actor akTarget, Actor akCaster)combatQuest.Feintmessage = " Test worked" ; Your Feintmessage isn't a child of aadpMainQuest, its part of aadpMainCombatQuestendevent

It wasn't the only thing you needed to change, you needed to change the script object you were accessing from since it is not a property to aadpMainQuest, it's a property to aadpMainCombatQuest.

...Ninja Edit
User avatar
Alexander Horton
 
Posts: 3318
Joined: Thu Oct 11, 2007 9:19 pm

Post » Fri Nov 16, 2012 3:35 pm

IMO there is nothing you gain from using script properties other than less typing. if anything it limits you because now your esp and save game depend on that property to exist

i suggest using this instead:


Scriptname aadpAllFeintsScript extends activemagiceffectQuest Property aadpMainQuest  AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)(aadpMainQuest  as aadpMainCombatQuest).Feintmessage = " Test worked"endevent
User avatar
Milagros Osorio
 
Posts: 3426
Joined: Fri Aug 25, 2006 4:33 pm

Post » Fri Nov 16, 2012 1:39 pm

ok... it works now...WOW...I mean wow... I am going to get some dinner and a glass of wine...

what a head ache for such a simple thing...

thank you, all of you...I NEVER would have got that on my own... wow....
User avatar
C.L.U.T.C.H
 
Posts: 3385
Joined: Tue Aug 14, 2007 6:23 pm

Post » Fri Nov 16, 2012 3:41 pm

IMO there is nothing you gain from using script properties other than less typing. if anything it limits you because now your esp and save game depend on that property to exist

i suggest using this instead:


Scriptname aadpAllFeintsScript extends activemagiceffectQuest Property aadpMainQuest  AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)(aadpMainQuest  as aadpMainCombatQuest).Feintmessage = " Test worked"endevent

I believe that only works if the scripts are extended from the same parent form (In this case they probably are). I often use multiple quests to separate Alias data.
User avatar
celebrity
 
Posts: 3522
Joined: Mon Jul 02, 2007 12:53 pm

Post » Fri Nov 16, 2012 3:56 pm

if your script is bound to an object, it will extend that parent form by default. changing the parent extension will actually cause a binding error and should be avoided anyway.

declaring the script as a property essentially does the exact same thing (since you can only select the script from its bound object), except that it is now embedded in the VMAD record, making it much more of a hassle to make changes in the future.
User avatar
Brentleah Jeffs
 
Posts: 3341
Joined: Tue Feb 13, 2007 12:21 am

Post » Fri Nov 16, 2012 7:01 pm

By parent Form I meant if aadpMainQuest and aadpMainCombatQuest were not from the same quest.

aadpMainQuest 00000D63
aadpMainCombatQuest 00000D64

It would be like trying to cast to a completely different quest...
(C00 as C04) I don't think you would suddenly have access to C04 variables in this case. (Pretty sure those are not the script names for those quests but you get the idea)
You'd get an incompatible types error.

This only works if the scripts are part of the same Form
00000D63 Scripts Tab:
---- aadpMainQuest extends Quest
---- aadpMainCombatQuest extends Quest

Or if the script explicitly extends it
00000D64 (Not sure if the ancestor can be already defined as a quest, mine are all floating base scripts so that they can have a common ancestor)
---- aadpMainCombatQuest extends aadpMainQuest
User avatar
Darlene Delk
 
Posts: 3413
Joined: Mon Aug 27, 2007 3:48 am

Post » Fri Nov 16, 2012 7:33 pm

that was what i meant as well

aadpMainCombatQuest is the name of his pex file, not a quest editor ID

you cant cast an already declared quest property as another declared quest property

you can however cast a quest as its bound script (which by default already extends quest) without declaring that script pex as a property (which is the whole reason why i think this is more flexible in the long run)
User avatar
Anthony Diaz
 
Posts: 3474
Joined: Thu Aug 09, 2007 11:24 pm


Return to V - Skyrim