Jump to content

Changing an Integer from another script


HunterSweet

Recommended Posts

I have two scripts. One keeps a count (and adds to it), the other subtracts from the count.

They are essentially:

 

 

 

 

 

Scriptname CountTestScript Extends ObjectReference

Actor Property PlayerRef Auto

Int Property Count Auto

MiscObject Property Spoon Auto

MiscObject Property Knife Auto

MiscObject Property Fork Auto

ObjectReference Property Plate Auto

ObjectReference Property Fork Auto

ObjectReference Property Knife Auto

ObjectReference Property Spoon Auto

 

EVENT OnActivate(ObjectReference TriggerRef)

 

If PlayerRef.GetItemCount (Spoon) >= 1

PlayerRef.RemoveItem (Spoon)

Spoon.Enable()

Count = Count+1

EndIf

 

If PlayerRef.GetItemCount (Knife) >= 1

PlayerRef.RemoveItem (Knife)

Knife.Enable()

Count = Count+1

EndIf

 

If PlayerRef.GetItemCount (Fork) >= 1

PlayerRef.RemoveItem (Fork)

Fork.Enable()

Count = Count+1

EndIf

 

If Count >=3

Plate.Enable()

EndIf

 

EndEVENT

 

 

 

 

 

 

Scriptname SpoonScript Extends ObjectReference

ObjectReference Property Spoon Auto

CountTestScript Property OtherScript Auto

MiscObject Property Spoon Auto

Actor Property PlayerRef Auto

 

EVENT OnActivate(ObjectReference TriggerRef)

Spoon.Disable()

PlayerRef.AddItem(Spoon)

OtherScript.Count = OtherScript.Count-1

EndEVENT

 

 

 

 

 

 

 

 

 

Second Script doesn't compile right: "No viable alternative at input 'Count'"

Is it possible to change an integer's value from another script?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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