Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basic Morrowind Scripting parsing #53

Merged
merged 1 commit into from
Oct 8, 2017
Merged

Added basic Morrowind Scripting parsing #53

merged 1 commit into from
Oct 8, 2017

Conversation

alecnunn
Copy link
Contributor

@alecnunn alecnunn commented Oct 8, 2017

After testing on various scripts from Morrowind, I have not noticed anything broken, though I most certainly intend to rework and clean up the regex when possible. Example script below:


;opens first gate as Ghostgate (say that 5 times)
;put on button

float timer
short state

if ( MenuMode == 1 )
	return
endif

if ( OnActivate == 1 )
	
	if ( GG_Gate1_State == 0 ) 
		PlaySound "Open Lock"
		"ex_gg_portcullis_01"->Playsound3DVP "Dwemer Door Open" 1.0 1.0
		set GG_Gate1_State to 10
		set state to 10
	endif
endif

if ( State >= 10 )
	
	set timer to ( timer + GetSecondsPassed )

	;move gate up (210 units)
	if ( timer < 3 )
		"ex_gg_portcullis_01"->MoveWorld z 70

	;set back to start
	elseif ( timer > 21 )
			"ex_gg_portcullis_01"->SetAtStart
			set State to 0
			;can now press button again
			set GG_Gate1_State to 0
			set timer to 0

	;move gate down (210 units)
	elseif ( timer > 18 )
			;use state so sound only plays once			
			if ( State == 10 )
				"ex_gg_portcullis_01"->Playsound3DVP "Dwemer Door Open" 1.0 1.0
				Set State to 20
			endif
			"ex_gg_portcullis_01"->MoveWorld z -70
	endif
endif

end GG_OpenGate1```

@alecthomas alecthomas merged commit 7f66cd3 into alecthomas:master Oct 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants