Jump to content

Scripters: Object Instantiation - How?


grey79

Recommended Posts

How can I make this work:

 

Main script

Scriptname IFT extends Quest

ObjectReference[] property MapMarkersCategory1 auto
ObjectReference[] property MapMarkersCategory2 auto

Function Init()
IFT_CORE category1
IFT_CORE category2
category1.Register(MapMarkersCategory1, 3)
category2.Register(MapMarkersCategory2, 1)
Debug.MessageBox("Installed")
EndFunction

 

Core script:

Scriptname IFT_CORE extends Form hidden

ObjectReference[] mapMarkers

Function Register(ObjectReference[] mm, int time)
Debug.MessageBox("Core init")
mapMarkers = mm
RegisterForUpdateGameTime(time)
EndFunction

Event OnUpdateGameTime()
Debug.MessageBox("The event was received")
EndEvent

 

So basically the main script tries to call the core script.

Everything compiles just fine.

 

However, only this message gets triggered: Debug.MessageBox("Installed")

The messages in the core file never does.

 

I wish I could do something like "IFT_CORE category2 = new IFT_CORE()" like a real object oriented language.

 

Anyone know a solution to getting an instance of IFT_CORE?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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