Jump to content

OnEquipped+OnActivate for two diff items in 1 script?


z4x

Recommended Posts

So I reduced my script to just core STATE switch, including OnEquipped switching to one state, then OnActivate switching to another (both preventing each other to activate their own state, when other is going)

 

But looks like script containing OnEquipped and OnActivate linked to ARMOR object and some WORLD object, do conflict?

 

Could someone confirm please? Wasted two days on it :(

Link to comment
Share on other sites

ScriptName StatesExample extends ObjectReference

Auto State Inactive
	Function Toggle()
		GoToState("Active")
	EndFunction
EndState

State Active
	Function Toggle()
		GoToState("Inactive")
	EndFunction
EndState

Function Toggle()
	; Empty function definition to allow Toggle to be defined inside states. More on this soon...
EndFunction

Event OnActivate(ObjectReference akActionRef)
	Toggle()
EndEvent

 

Its something like that, but with 3rd state: Active2

 

OnEquipped activates (or at least should be) Active1 state

OnUnEquipped disactivates Active1 state

 

OnActivate activates Active2 state on first activate (first click on lets say Barrel, in game), then disactivate Active2 state (on second click) and goes back to Inactive state.

 

It just doesnt compile, i get some major compiler error, about accessing script, that doesnt show which lines are wrong.

Edited by z4xx
Link to comment
Share on other sites

  • Recently Browsing   0 members

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