question

Blitz3D Forums/Blitz3D Programming/question

Caton(Posted 2015) [#1]
how do I read file name like
z=a a=b b=c c=d
I trying to load the wonderland adventures assets.
I'm making a wonderland game project so how do I do this?


Caton(Posted 2015) [#2]
like encrypt file name like in wonderland adventures.
how would I do this in blitz3d. I'm making a wonderland adventures game for midnight synergy's forum.


_PJ_(Posted 2015) [#3]
I'm not familiar with the Wonderland adventure games at all, but typical susbstitution such as you described is achievable through manipulation of the ASCII values for the characters.

For example:
Function Substitute$(A_String$)
	Local Length=Len(A_String)
	If Not(Length) Then Return A_String
	Local Char$
	Local NewChar$
	Local Count
	Local Ascii
	Local NewAscii
	Local OutPut$=""
	
	For Count=1 To Length
		Char$=Mid(A_String,Count,1)
		Ascii=Asc(Char)
		NewAscii=SubstituteAscii(Ascii)
		NewChar$=Chr(NewAscii)
		OutPut=OutPut+NewChar$
	Next
	Return OutPut
End Function

Function SubstituteAscii(ascii)
	Local Swap
	If ((ascii>96) And (ascii<123)) 
		;Lowercase letter
		Swap=96
	End If
	
	If ((ascii>64) And (ascii<91))
		;Uppercase letter 
		Swap=64
	End If
	
	If (Swap)
		;Reverse alphabet, a=z by c=x etc.
		ascii=27-(ascii-Swap)
	End If
	
	Return ascii+swap
End Function