Hello,
I have a little problem with a script and don't know why it doesn't work.
The first script works perfect:
Scriptname mde_002 extends ObjectReference ObjectReference Property mde_002_Static1 AutoObjectReference Property mde_002_Static2 AutoObjectReference Property mde_002_Static3 AutoMiscObject Property mde_002_Inv1 AutoBook Property mde_002_Inv2 AutoWeapon Property mde_002_Inv3 AutoInt mde_002_CountInt Function mdeDisplayItem(ObjectReference mdeDisplayStatic, Form mdeDisplayInventar, Bool mdeDisplayFade) ;Do something Return 1EndFunctionEvent OnActivate (ObjectReference akAktionRef) mde_002_Count = 0 mde_002_Count = mde_002_Count + mdeDisplayItem(mde_002_Static1, mde_002_Inv1, False) mde_002_Count = mde_002_Count + mdeDisplayItem(mde_002_Static2, mde_002_Inv2, False) mde_002_Count = mde_002_Count + mdeDisplayItem(mde_002_Static3, mde_002_Inv3, False)EndEvent
I create a script library and import it in my second script and use a function from this library than the script don't work:
Scriptname mdeScriptBibliothek HiddenInt Function mdeDisplayItem(ObjectReference mdeDisplayStatic, Form mdeDisplayInventar, Bool mdeDisplayFade) ;Do something Return 1EndFunctionScriptname mde_002 extends ObjectReference Import mdeScriptBibliothekObjectReference Property mde_002_Static1 AutoObjectReference Property mde_002_Static2 AutoObjectReference Property mde_002_Static3 AutoMiscObject Property mde_002_Inv1 AutoBook Property mde_002_Inv2 AutoWeapon Property mde_002_Inv3 AutoInt mde_002_CountEvent OnActivate (ObjectReference akAktionRef) mde_002_Count = 0 mde_002_Count = mde_002_Count + mdeDisplayItem(mde_002_Static1, mde_002_Inv1, False) mde_002_Count = mde_002_Count + mdeDisplayItem(mde_002_Static2, mde_002_Inv2, False) mde_002_Count = mde_002_Count + mdeDisplayItem(mde_002_Static3, mde_002_Inv3, False)EndEvent
The compiler says:
mde_002.psc(17,34): cannot call the member function mdeDisplayItem alone or on a type, must call it on a variable
mde_002.psc(18,34): cannot call the member function mdeDisplayItem alone or on a type, must call it on a variable
mde_002.psc(19,34): cannot call the member function mdeDisplayItem alone or on a type, must call it on a variable
Can someone tell me where's the problem? Thanks in advance.
Greetings, Mario.
EDIT:
If I change the script in the library to:
Scriptname mdeScriptBibliothek HiddenInt Function mdeDisplayItem(ObjectReference mdeDisplayStatic, Form mdeDisplayInventar, Bool mdeDisplayFade) Global ;Do something Debug.Messagebox("Test") Return 1EndFunction
than the script is compiled with success but when I call the function the messagebox don't appear.