SpiceyWolf Posted August 3, 2011 Author Share Posted August 3, 2011 EDIT: Sorry this was not 100% bug free… the ini write and read would work... but u couldnt use that attribute more then once cuz it just wouldnt warp players even if u put another attribute down... so if u added this change the read and write ini code from the bottom in the server source handle data...(changing in the actual tut also) to this```If ReadINI(GetPlayerName(Index), "HasWarped" & GetPlayerMap(Index) & "," & GetPlayerX(Index) & "," & (GetPlayerY(Index)), App.Path & "\data\WarpEIT.Dat", "0") = "0" Then Call WriteINI(GetPlayerName(Index), "HasWarped" & GetPlayerMap(Index) & "," & GetPlayerX(Index) & "," & (GetPlayerY(Index)), "1", App.Path & "\data\WarpEvent.Dat")```Hey everybody, I promised when I finally made something 100% bug free I'd post it…So without further A-do... Here is my first tutorial OUTSIDE OF ModText! (yaaaaay)Ok I was inspired by events i saw in pokemon and cutscenes i wanted to have for myzelda fan game...and im too lazy to put flash vids for all meh cutscenes, and whowants ur players seeing these EVERY timeyou re-enter a place?(id say if it crossed some peoples minds they just didnt addanything like such because it would be a hassle... and i personally think mmo'sin stuff like this would be better with 'em!)Ok so what this mod does... is similar to the Chest Attribute tutorial, except It's for warping...(warp one time to a map with a flash or picture on it or something for ur own custom cutscenes!)So we'll start off FIRST with the Client-Side.First we wanna make the attribute which is pretty much a same tutorial for every attribute tutorial...Looking for something and adding an attribute effect with the adding to attribute crap...So Search these...1.``` ' slide If frmEditor_Map.optSlide.Value Then .Type = TILE_TYPE_SLIDE .Data1 = MapEditorSlideDir .Data2 = 0 .Data3 = 0 End If```2.``` Case TILE_TYPE_SLIDE DrawText TexthDC, tX, tY, "S", QBColor(BrightCyan)```3.```Public Const TILE_TYPE_SLIDE As Byte = 14```Now we wanna put the Number post under the corresponding search up top…(ex 1 goes to 1 2 goes to 2 ect...)1.```'~SpiceyWolf~ 'WarpEvent for Cutscenes :P If frmEditor_Map.optWarpEvent.Value Then .Type = TILE_TYPE_WARPEVENT .Data1 = EditorWarpMap .Data2 = EditorWarpX .Data3 = EditorWarpY End If'/~Spiceywolf~```2.```'~SpiceyWolf~ Case TILE_TYPE_WARPEVENT DrawText TexthDC, tX, tY, "S", QBColor(BrightGreen)'/~SpiceyWolf~```3.```Public Const TILE_TYPE_WARPEVENT As Byte = 15```Now go to your Map editor Form… Make a New OPTION Bubble thingy... its the circle one..Place it wherever you like... and call it "optWarpEvent" without the quotes, and make thecaption whatever you want.Double click the option box you just made and paist this in...``` ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler ClearAttributeDialogue picAttributes.Visible = True fraMapWarp.Visible = True scrlMapWarp.Max = MAX_MAPS scrlMapWarp.Value = 1 scrlMapWarpX.Max = MAX_BYTE scrlMapWarpY.Max = MAX_BYTE scrlMapWarpX.Value = 0 scrlMapWarpY.Value = 0 ' Error handler Exit Suberrorhandler: HandleError "optWarp_Click", "frmEditor_Map", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub```Now search SMSG and above the comment in the S list putSWarpEventand in the C list do the same(can search CMSG)CWarpEventIn ModClientTCP at the bottom add```Sub WarpEvent(ByVal Index As Long)Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong CWarpEvent SendData Buffer.ToArray() Set Buffer = NothingEnd Sub```Search```HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals)```and put under```HandleDataSub(SWarpEvent) = GetAddress(AddressOf HandleWarpEvent)```Now at the bottom of modHandleData add:```Private Sub HandleWarpEvent(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim Buffer As clsBufferDim X As LongDim Y As Long Set Buffer = New clsBuffer Buffer.WriteBytes Data() X = Buffer.ReadLong Y = Buffer.ReadLong If Map.Tile(X, Y).Type = TILE_TYPE_WARPEVENT Then Call WarpEvent(Index) End IfEnd Sub```SERVER SIDE NOU!!! YAY!Search for```Public Const TILE_TYPE_SLIDE As Byte = 14```and under put```Public Const TILE_TYPE_WARPEVENT As Byte = 15```At the bottom of the CMSG and SMSG lists right above the coment part that sais those in it…add these```SWarpEventCWarpEvent```At the Bottom of ModServerTCP add```Sub SendWarpEvent(ByVal mapNum As Long, ByVal x As Long, ByVal y As Long)Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong SWarpEvent Buffer.WriteLong x Buffer.WriteLong y SendDataToMap mapNum, Buffer.ToArray() Set Buffer = NothingEnd Sub```Then look for Sub PlayerMove and at the bottom of the sub (just before End With) Add:``` If .Type = TILE_TYPE_WARPEVENT Then mapNum = .Data1 x = .Data2 y = .Data3 Call PlayerWarp(Index, mapNum, x, y) Moved = YES End If```Add this to the bottom of modHandleData```Sub HandleWarpEvent(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_WARPEVENT ThenIf ReadINI(GetPlayerName(Index), "HasWarped" & GetPlayerMap(Index) & "," & GetPlayerX(Index) & "," & (GetPlayerY(Index)), App.Path & "\data\WarpEIT.Dat", "0") = "0" Then Call WriteINI(GetPlayerName(Index), "HasWarped" & GetPlayerMap(Index) & "," & GetPlayerX(Index) & "," & (GetPlayerY(Index)), "1", App.Path & "\data\WarpEvent.Dat") Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data1, Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2, Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data3) End If End IfEnd Sub```Search for```HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave)```and under that put```HandleDataSub(CWarpEvent) = GetAddress(AddressOf HandleWarpEvent)```Some where near the top of modDatabase put```Public Sub WriteINI(INISection As String, INIKey As String, INIValue As String, INIFile As String) Call WritePrivateProfileString(INISection, INIKey, INIValue, INIFile)End SubPublic Function ReadINI(Section As String, KeyName As String, filename As String, Default As String) As String Dim sRet As String sRet = String$(255, Chr$(0)) ReadINI = Left$(sRet, GetPrivateProfileString(Section, ByVal KeyName, Default, sRet, Len(sRet), filename))End Function```THATS ALL! you are done and now u can use it :P if you have a problem lemme know i should know how to help ya fix it XD Link to comment Share on other sites More sharing options...
Sunku Posted August 3, 2011 Share Posted August 3, 2011 epic i'm going to use this if CS:DE will let me(which i believe it will.) Link to comment Share on other sites More sharing options...
RyokuHasu Posted August 3, 2011 Share Posted August 3, 2011 CS:DE is just a Fancy EO 2 if its not doing something with the graphics its going to workP.S. My next post will be #666 >:D my "Hell-Post" Link to comment Share on other sites More sharing options...
SpiceyWolf Posted August 3, 2011 Author Share Posted August 3, 2011 lmao whats the hell post supposed to be? just something really long and complicated no ones gunna wanna put? XD Link to comment Share on other sites More sharing options...
Sunku Posted August 3, 2011 Share Posted August 3, 2011 @SpiceyWolf:> lmao whats the hell post supposed to be? just something really long and complicated no ones gunna wanna put? XDno i believe it was a simple post he put on my recruitment topic. Link to comment Share on other sites More sharing options...
SpiceyWolf Posted August 3, 2011 Author Share Posted August 3, 2011 @ axisAhh… anyway... so this is the most complicated thing i have done bug free >.>so lemme know when u added and to make sure its working test it and tell me the results... cuz i have added and removed from the notepad i was makin the tutorial on many times i mighta messed something up.. at least in the tutorial standard Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now