cacadosman Posted April 29, 2013 Author Share Posted April 29, 2013 I have one questionwhy the variable is always reset to 0i'm using EA, how to fix it ?do you have a solution ?thanks ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Link to comment Share on other sites More sharing options...
Matt Posted April 29, 2013 Share Posted April 29, 2013 Which variable is being reset to 0? Link to comment Share on other sites More sharing options...
cacadosman Posted April 29, 2013 Author Share Posted April 29, 2013 ![](http://i.imgur.com/F7rnwef.png?1?3091)i set the variable to 5but, the var is always reset to 0sorry for bad english ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/sad.png) Link to comment Share on other sites More sharing options...
hisherwin Posted April 29, 2013 Share Posted April 29, 2013 Check it's load sub Link to comment Share on other sites More sharing options...
Matt Posted April 30, 2013 Share Posted April 30, 2013 > i set the variable to 5> > but, the var is always reset to 0> > sorry for bad english ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/sad.png)Check to see if its being saved properly, and if its loading properly. Go into VB6, and click twice on the object where you save the variable's value. Paste the sub of code here. Then, there should be a sub called something along the lines of "EventEditorInit". Post that entire sub here. Link to comment Share on other sites More sharing options...
cacadosman Posted May 4, 2013 Author Share Posted May 4, 2013 okay, here the code ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) (frmEditor_Events)```Option ExplicitPrivate ListIndex As LongPrivate Sub cmbBranchClass_Click() If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = cmbBranchClass.ListIndex + 1End SubPrivate Sub cmbBranchItem_Click() If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = cmbBranchItem.ListIndex + 1End SubPrivate Sub cmbBranchSkill_Click() If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = cmbBranchSkill.ListIndex + 1End SubPrivate Sub cmbBranchSwitch_Click() If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(5) = cmbBranchSwitch.ListIndexEnd SubPrivate Sub cmbBranchSwitchReq_Click() If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = cmbBranchSwitchReq.ListIndexEnd SubPrivate Sub cmbBranchVar_Click() If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(6) = cmbBranchVar.ListIndexEnd SubPrivate Sub cmbEffectType_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub fraSetFog.visible = False fraSetWeather.visible = False fraMapOverlay.visible = False Select Case cmbEffectType.ListIndex Case 3: fraSetFog.visible = True Case 4: fraSetWeather.visible = True Case 5: fraMapOverlay.visible = True End Select Events(EditorIndex).SubEvents(ListIndex).data(1) = cmbEffectType.ListIndexEnd SubPrivate Sub cmbHasItem_Click()If EditorIndex = 0 Then Exit Sub Events(EditorIndex).HasItemIndex = cmbHasItem.ListIndex + 1End SubPrivate Sub cmbChangeClass_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(1) = cmbChangeClass.ListIndex + 1End SubPrivate Sub cmbChangeSkills_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(1) = cmbChangeSkills.ListIndex + 1End SubPrivate Sub cmbChatBubbleTarget_click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = cmbChatBubbleTarget.ListIndex + 1End SubPrivate Sub cmbLabel_Ok_Click() fraLabeling.visible = False SendSwitchesAndVariablesEnd SubPrivate Sub cmbLevelReqOperator_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(5) = cmbLevelReqOperator.ListIndexEnd SubPrivate Sub cmbPlayBGM_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).Text(1) = Trim$(musicCache(cmbPlayBGM.ListIndex + 1))End SubPrivate Sub cmbPlayerSwitch_Click()If EditorIndex = 0 Then Exit Sub Events(EditorIndex).SwitchIndex = cmbPlayerSwitch.ListIndexEnd SubPrivate Sub cmbPlayerSwitchCompare_Click()If EditorIndex = 0 Then Exit Sub Events(EditorIndex).SwitchCompare = cmbPlayerSwitchCompare.ListIndexEnd SubPrivate Sub cmbPlayerSwitchSet_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = cmbPlayerSwitchSet.ListIndexEnd SubPrivate Sub cmbPlayerVar_Click()If EditorIndex = 0 Then Exit Sub Events(EditorIndex).VariableIndex = cmbPlayerVar.ListIndexEnd SubPrivate Sub cmbPlayerVarCompare_Click()If EditorIndex = 0 Then Exit Sub Events(EditorIndex).VariableCompare = cmbPlayerVarCompare.ListIndexEnd SubPrivate Sub cmbPlaySound_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).Text(1) = Trim$(soundCache(cmbPlaySound.ListIndex + 1))End SubPrivate Sub cmbSetAccess_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(1) = cmbSetAccess.ListIndexEnd SubPrivate Sub cmbSpawnNPC_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(1) = cmbSpawnNPC.ListIndex + 1End SubPrivate Sub cmbSwitch_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(1) = cmbSwitch.ListIndexEnd SubPrivate Sub cmbTrigger_Click()If EditorIndex = 0 Then Exit Sub Events(EditorIndex).Trigger = cmbTrigger.ListIndexEnd SubPrivate Sub cmbVariable_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(1) = cmbVariable.ListIndexEnd SubPrivate Sub cmbVarReqOperator_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(5) = cmbVarReqOperator.ListIndexEnd SubPrivate Sub CmbWeather_click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = CmbWeather.ListIndexEnd SubPrivate Sub cmdAddMenuOption_Click()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Dim optIdx As Long With Events(EditorIndex).SubEvents(ListIndex) ReDim Preserve .data(1 To UBound(.data) + 1) ReDim Preserve .Text(1 To UBound(.data) + 1) .data(UBound(.data)) = 1 End With lstMenuOptions.AddItem ": " & 1End SubPrivate Sub cmdAddOk_Click() fraCommands.visible = FalseEnd SubPrivate Sub cmdCommand_Click(Index As Integer) Dim count As Long If Not (Events(EditorIndex).HasSubEvents) Then ReDim Events(EditorIndex).SubEvents(1 To 1) Events(EditorIndex).HasSubEvents = True Else count = UBound(Events(EditorIndex).SubEvents) + 1 ReDim Preserve Events(EditorIndex).SubEvents(1 To count) End If Call Events_SetSubEventType(EditorIndex, UBound(Events(EditorIndex).SubEvents), Index) Call PopulateSubEventList fraCommands.visible = FalseEnd SubPrivate Sub cmdDelete_Click()Dim tmpIndex As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex <= 0 Or EditorIndex > MAX_EVENTS Then Exit Sub ListIndex = 0 ClearEvent EditorIndex tmpIndex = lstIndex.ListIndex lstIndex.RemoveItem EditorIndex - 1 lstIndex.AddItem EditorIndex & ": " & Trim$(Events(EditorIndex).name), EditorIndex - 1 lstIndex.ListIndex = tmpIndex Event_Changed(EditorIndex) = True EventEditorInit ' Error handler Exit Suberrorhandler: HandleError "cmdDelete_Click", "frmEditor_Events", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub cmdEditOk_Click() Call PopulateSubEventList fraEditCommand.visible = FalseEnd SubPrivate Sub cmdLabel_Cancel_Click() fraLabeling.visible = False RequestSwitchesAndVariablesEnd SubPrivate Sub cmdModifyMenuOption_Click() Dim tempIndex As Long, optIdx As Long tempIndex = lstSubEvents.ListIndex + 1 optIdx = lstMenuOptions.ListIndex + 1 If optIdx < 1 Or optIdx > UBound(Events(EditorIndex).SubEvents(ListIndex).data) Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).Text(optIdx + 1) = Trim$(txtMenuOptText.Text) Events(EditorIndex).SubEvents(ListIndex).data(optIdx) = scrlMenuOptDest.value lstMenuOptions.List(optIdx - 1) = Trim$(txtMenuOptText.Text) & ": " & scrlMenuOptDest.valueEnd SubPrivate Sub cmdRemoveMenuOption_Click() Dim Index As Long, i As Long Index = lstMenuOptions.ListIndex + 1 If Index > 0 And Index < lstMenuOptions.ListCount And lstMenuOptions.ListCount > 0 Then For i = Index + 1 To lstMenuOptions.ListCount Events(EditorIndex).SubEvents(ListIndex).data(i - 1) = Events(EditorIndex).SubEvents(ListIndex).data(i) Events(EditorIndex).SubEvents(ListIndex).Text(i) = Events(EditorIndex).SubEvents(ListIndex).Text(i + 1) Next i ReDim Preserve Events(EditorIndex).SubEvents(ListIndex).data(1 To UBound(Events(EditorIndex).SubEvents(ListIndex).data) - 1) ReDim Preserve Events(EditorIndex).SubEvents(ListIndex).Text(1 To UBound(Events(EditorIndex).SubEvents(ListIndex).Text) - 1) Call PopulateSubEventConfig End IfEnd SubPrivate Sub cmdRename_Cancel_Click() Dim i As Long fraRenaming.visible = False RenameType = 0 RenameIndex = 0 lstSwitches.Clear For i = 1 To MAX_SWITCHES lstSwitches.AddItem CStr(i) & ". " & Trim$(Switches(i)) Next lstSwitches.ListIndex = 0 lstVariables.Clear For i = 1 To MAX_VARIABLES lstVariables.AddItem CStr(i) & ". " & Trim$(Variables(i)) Next lstVariables.ListIndex = 0End SubPrivate Sub cmdRename_Ok_Click() Dim i As Long Select Case RenameType Case 1 'Variable If RenameIndex > 0 And RenameIndex <= MAX_VARIABLES + 1 Then Variables(RenameIndex) = txtRename.Text fraRenaming.visible = False RenameType = 0 RenameIndex = 0 End If Case 2 'Switch If RenameIndex > 0 And RenameIndex <= MAX_SWITCHES + 1 Then Switches(RenameIndex) = txtRename.Text fraRenaming.visible = False RenameType = 0 RenameIndex = 0 End If End Select lstSwitches.Clear For i = 1 To MAX_SWITCHES lstSwitches.AddItem CStr(i) & ". " & Trim$(Switches(i)) Next lstSwitches.ListIndex = 0 lstVariables.Clear For i = 1 To MAX_VARIABLES lstVariables.AddItem CStr(i) & ". " & Trim$(Variables(i)) Next lstVariables.ListIndex = 0End SubPrivate Sub cmdRenameSwitch_Click() If lstSwitches.ListIndex > -1 And lstSwitches.ListIndex < MAX_SWITCHES Then fraRenaming.visible = True lblEditing.Caption = "Editing Switch #" & CStr(lstSwitches.ListIndex + 1) txtRename.Text = Switches(lstSwitches.ListIndex + 1) RenameType = 2 RenameIndex = lstSwitches.ListIndex + 1 End IfEnd SubPrivate Sub cmdRenameVariable_Click() If lstVariables.ListIndex > -1 And lstVariables.ListIndex < MAX_VARIABLES Then fraRenaming.visible = True lblEditing.Caption = "Editing Variable #" & CStr(lstVariables.ListIndex + 1) txtRename.Text = Variables(lstVariables.ListIndex + 1) RenameType = 1 RenameIndex = lstVariables.ListIndex + 1 End IfEnd SubPrivate Sub cmdSave_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Call EventEditorOk ListIndex = 0 ' Error handler Exit Suberrorhandler: HandleError "cmdSave_Click", "frmEditor_Events", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub cmdCancel_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Call EventEditorCancel ListIndex = 0 ' Error handler Exit Suberrorhandler: HandleError "cmdCancel_Click", "frmEditor_Events", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub cmdSubEventAdd_Click() fraCommands.visible = TrueEnd SubPrivate Sub cmdSubEventDown_Click() Dim Index As Long Index = lstSubEvents.ListIndex + 1 If Index > 0 And Index < lstSubEvents.ListCount Then Dim temp As SubEventRec temp = Events(EditorIndex).SubEvents(Index) Events(EditorIndex).SubEvents(Index) = Events(EditorIndex).SubEvents(Index + 1) Events(EditorIndex).SubEvents(Index + 1) = temp Call PopulateSubEventList End IfEnd SubPrivate Sub cmdSubEventEdit_Click() If ListIndex > 0 And ListIndex <= lstSubEvents.ListCount Then fraEditCommand.visible = True PopulateSubEventConfig End IfEnd SubPrivate Sub cmdSubEventRemove_Click() Dim Index As Long, i As Long If ListIndex > 0 And ListIndex <= lstSubEvents.ListCount Then For i = ListIndex + 1 To lstSubEvents.ListCount Events(EditorIndex).SubEvents(i - 1) = Events(EditorIndex).SubEvents(i) Next i If lstSubEvents.ListCount = 1 Then Events(EditorIndex).HasSubEvents = False Erase Events(EditorIndex).SubEvents Else ReDim Preserve Events(EditorIndex).SubEvents(1 To lstSubEvents.ListCount - 1) End If Call PopulateSubEventList End IfEnd SubPrivate Sub cmdSubEventUp_Click() Dim Index As Long Index = lstSubEvents.ListIndex + 1 If Index > 1 And Index <= lstSubEvents.ListCount Then Dim temp As SubEventRec temp = Events(EditorIndex).SubEvents(Index) Events(EditorIndex).SubEvents(Index) = Events(EditorIndex).SubEvents(Index - 1) Events(EditorIndex).SubEvents(Index - 1) = temp Call PopulateSubEventList End IfEnd SubPrivate Sub cmdSwitchesVariables_Click()Dim i As Long fraLabeling.visible = True lstSwitches.Clear For i = 1 To MAX_SWITCHES lstSwitches.AddItem CStr(i) & ". " & Trim$(Switches(i)) Next lstSwitches.ListIndex = 0 lstVariables.Clear For i = 1 To MAX_VARIABLES lstVariables.AddItem CStr(i) & ". " & Trim$(Variables(i)) Next lstVariables.ListIndex = 0End SubPrivate Sub Form_Load() Dim i As Long, cap As Long 'Move windows to right places frmEditor_Events.Width = 9600 frmEditor_Events.Height = 8835 fraEditCommand.Left = 232 fraEditCommand.Top = 152 fraCommands.Left = 232 fraCommands.Top = 152 fraLabeling.Width = 609 fraLabeling.Height = 513 ListIndex = 0 scrlOpenShop.max = MAX_SHOPS scrlGiveItemID.max = MAX_ITEMS scrlPlayAnimationAnim.max = MAX_ANIMATIONS scrlWarpMap.max = MAX_MAPS scrlMessageSprite.max = NumCharacters ScrlFogData(0).max = NumFogs cmbLevelReqOperator.Clear cmbPlayerVarCompare.Clear cmbVarReqOperator.Clear For i = 0 To ComparisonOperator_Count - 1 cmbLevelReqOperator.AddItem GetComparisonOperatorName(i) cmbPlayerVarCompare.AddItem GetComparisonOperatorName(i) cmbVarReqOperator.AddItem GetComparisonOperatorName(i) Next cmbHasItem.Clear cmbBranchItem.Clear For i = 1 To MAX_ITEMS cmbHasItem.AddItem Trim$(Item(i).name) cmbBranchItem.AddItem Trim$(Item(i).name) Next cmbSwitch.Clear cmbPlayerSwitch.Clear cmbBranchSwitch.Clear For i = 1 To MAX_SWITCHES cmbSwitch.AddItem i & ". " & Switches(i) cmbPlayerSwitch.AddItem i & ". " & Switches(i) cmbBranchSwitch.AddItem i & ". " & Switches(i) Next cmbVariable.Clear cmbPlayerVar.Clear cmbBranchVar.Clear For i = 1 To MAX_VARIABLES cmbVariable.AddItem i & ". " & Variables(i) cmbPlayerVar.AddItem i & ". " & Variables(i) cmbBranchVar.AddItem i & ". " & Variables(i) Next cmbBranchClass.Clear cmbChangeClass.Clear For i = 1 To Max_Classes cmbBranchClass.AddItem Trim$(Class(i).name) cmbChangeClass.AddItem Trim$(Class(i).name) Next cmbBranchSkill.Clear cmbChangeSkills.Clear For i = 1 To MAX_SPELLS cmbBranchClass.AddItem Trim$(Spell(i).name) cmbChangeSkills.AddItem Trim$(Spell(i).name) Next cmbChatBubbleTarget.Clear cmbSpawnNPC.Clear For i = 1 To MAX_MAP_NPCS If Map.Npc(i) <= 0 Then cmbChatBubbleTarget.AddItem CStr(i) & ". " cmbSpawnNPC.AddItem CStr(i) & ". " Else cmbChatBubbleTarget.AddItem CStr(i) & ". " & Trim$(Npc(Map.Npc(i)).name) cmbSpawnNPC.AddItem CStr(i) & ". " & Trim$(Npc(Map.Npc(i)).name) End If Next cmbPlaySound.Clear For i = 1 To UBound(soundCache) cmbPlaySound.AddItem (soundCache(i)) cmbPlayBGM.AddItem (soundCache(i)) Next cmbPlayBGM.Clear For i = 1 To UBound(musicCache) cmbPlayBGM.AddItem (musicCache(i)) NextEnd SubPrivate Sub chkHasItem_Click() If chkHasItem.value = 0 Then cmbHasItem.Enabled = False Else cmbHasItem.Enabled = True Events(EditorIndex).chkHasItem = chkHasItem.valueEnd SubPrivate Sub chkPlayerSwitch_Click() If chkPlayerSwitch.value = 0 Then cmbPlayerSwitch.Enabled = False cmbPlayerSwitchCompare.Enabled = False Else cmbPlayerSwitch.Enabled = True cmbPlayerSwitchCompare.Enabled = True End If Events(EditorIndex).chkSwitch = chkPlayerSwitch.valueEnd SubPrivate Sub chkPlayerVar_Click() If chkPlayerVar.value = 0 Then cmbPlayerVar.Enabled = False txtPlayerVariable.Enabled = False cmbPlayerVarCompare.Enabled = False Else cmbPlayerVar.Enabled = True txtPlayerVariable.Enabled = True cmbPlayerVarCompare.Enabled = True End If Events(EditorIndex).chkVariable = chkPlayerVar.valueEnd SubPrivate Sub chkWalkthrought_Click()If EditorIndex = 0 Then Exit Sub Events(EditorIndex).WalkThrought = chkWalkthrought.valueEnd SubPrivate Sub fraChangeVariable_DragDrop(Source As Control, X As Single, Y As Single)End SubPrivate Sub fraEditCommand_DragDrop(Source As Control, X As Single, Y As Single)End SubPrivate Sub lstIndex_Click() EventEditorInitEnd SubPrivate Sub lstMenuOptions_Click() Dim tempIndex As Long, optIdx As Long tempIndex = lstSubEvents.ListIndex + 1 optIdx = lstMenuOptions.ListIndex + 1 If optIdx < 1 Or optIdx > UBound(Events(EditorIndex).SubEvents(ListIndex).data) Then Exit Sub txtMenuOptText.Text = Trim$(Events(EditorIndex).SubEvents(ListIndex).Text(optIdx + 1)) If Events(EditorIndex).SubEvents(ListIndex).data(optIdx) <= 0 Then Events(EditorIndex).SubEvents(ListIndex).data(optIdx) = 1 scrlMenuOptDest.value = Events(EditorIndex).SubEvents(ListIndex).data(optIdx)End SubPrivate Sub lstSubEvents_Click() ListIndex = lstSubEvents.ListIndex + 1 If ListIndex > 0 And ListIndex < lstSubEvents.ListCount Then cmdSubEventDown.Enabled = True Else cmdSubEventDown.Enabled = False End If If ListIndex > 1 And ListIndex <= lstSubEvents.ListCount Then cmdSubEventUp.Enabled = True Else cmdSubEventUp.Enabled = False End IfEnd SubPrivate Sub lstSubEvents_DblClick() If ListIndex > 0 And ListIndex <= lstSubEvents.ListCount Then fraEditCommand.visible = True PopulateSubEventConfig End IfEnd SubPrivate Sub optCondition_Index_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub cmbBranchVar.Enabled = False cmbVarReqOperator.Enabled = False txtBranchVarReq.Enabled = False cmbBranchSwitch.Enabled = False cmbBranchSwitchReq.Enabled = False cmbBranchItem.Enabled = False txtBranchItemAmount.Enabled = False cmbBranchClass.Enabled = False cmbBranchSkill.Enabled = False cmbLevelReqOperator.Enabled = False txtBranchLevelReq.Enabled = False Select Case Index Case 0 cmbBranchVar.Enabled = True cmbVarReqOperator.Enabled = True txtBranchVarReq.Enabled = True Case 1 cmbBranchSwitch.Enabled = True cmbBranchSwitchReq.Enabled = True Case 2 cmbBranchItem.Enabled = True txtBranchItemAmount.Enabled = True Case 3 cmbBranchClass.Enabled = True Case 4 cmbBranchSkill.Enabled = True Case 5 cmbLevelReqOperator.Enabled = True txtBranchLevelReq.Enabled = True End Select Events(EditorIndex).SubEvents(ListIndex).data(1) = IndexEnd SubPrivate Sub optExpAction_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = IndexEnd SubPrivate Sub optChangePK_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(1) = IndexEnd SubPrivate Sub optChangeSex_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(1) = IndexEnd SubPrivate Sub optChangeSkills_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = IndexEnd SubPrivate Sub optChannel_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = IndexEnd SubPrivate Sub optChatBubbleTarget_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub If Index = 0 Then cmbChatBubbleTarget.visible = False ElseIf Index = 1 Then cmbChatBubbleTarget.visible = True End If Events(EditorIndex).SubEvents(ListIndex).data(1) = IndexEnd SubPrivate Sub optItemOperation_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(3) = IndexEnd SubPrivate Sub optLevelAction_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = IndexEnd SubPrivate Sub optOpenEventType_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(3) = IndexEnd SubPrivate Sub optVariableAction_Click(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = Index Select Case Index Case 0, 1, 2 txtVariableData(0).Enabled = True txtVariableData(1).Enabled = False txtVariableData(2).Enabled = False Case 3 txtVariableData(0).Enabled = False txtVariableData(1).Enabled = True txtVariableData(2).Enabled = True End SelectEnd SubPrivate Sub scrlAddText_Colour_Change() frmEditor_Events.lblAddText_Colour.Caption = "Color: " & GetColorString(frmEditor_Events.scrlAddText_Colour.value) Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlAddText_Colour.valueEnd SubPrivate Sub scrlCustomScript_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblCustomScript.Caption = "Case: " & scrlCustomScript.value Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlCustomScript.valueEnd SubPrivate Sub ScrlFogData_Change(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Select Case Index Case 0 lblFogData(Index).Caption = "Fog: " & ScrlFogData(Index).value Events(EditorIndex).SubEvents(ListIndex).data(2) = ScrlFogData(Index).value Case 1 lblFogData(Index).Caption = "Fog Speed: " & ScrlFogData(Index).value Events(EditorIndex).SubEvents(ListIndex).data(3) = ScrlFogData(Index).value Case 2 lblFogData(Index).Caption = "Fog Opacity: " & ScrlFogData(Index).value Events(EditorIndex).SubEvents(ListIndex).data(4) = ScrlFogData(Index).value End SelectEnd SubPrivate Sub scrlChangeExp_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblChangeExp.Caption = "Exp: " & scrlChangeExp.value Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlChangeExp.valueEnd SubPrivate Sub scrlGiveItemAmount_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblGiveItemAmount.Caption = "Amount: " & scrlGiveItemAmount.value Events(EditorIndex).SubEvents(ListIndex).data(2) = scrlGiveItemAmount.valueEnd SubPrivate Sub scrlGiveItemID_Change() Dim tempIndex As Long tempIndex = lstSubEvents.ListIndex + 1 lblGiveItemID.Caption = "Item: " & scrlGiveItemID.value & "-" & Item(scrlGiveItemID.value).name Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlGiveItemID.valueEnd SubPrivate Sub scrlGOTO_Change() lblGOTO.Caption = "Goto: " & scrlGOTO.value Dim tempIndex As Long tempIndex = lstSubEvents.ListIndex + 1 Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlGOTO.valueEnd SubPrivate Sub scrlChangeLevel_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblChangeLevel.Caption = "Level: " & scrlChangeLevel.value Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlChangeLevel.valueEnd SubPrivate Sub scrlChangeSprite_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblChangeSprite.Caption = "Sprite: " & scrlChangeSprite.value Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlChangeSprite.valueEnd SubPrivate Sub scrlMapTintData_Change(Index As Integer)If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Select Case Index Case 0 lblMapTintData(Index).Caption = "Red: " & scrlMapTintData(Index).value Events(EditorIndex).SubEvents(ListIndex).data(2) = scrlMapTintData(Index).value Case 1 lblMapTintData(Index).Caption = "Green: " & scrlMapTintData(Index).value Events(EditorIndex).SubEvents(ListIndex).data(3) = scrlMapTintData(Index).value Case 2 lblMapTintData(Index).Caption = "Blue: " & scrlMapTintData(Index).value Events(EditorIndex).SubEvents(ListIndex).data(4) = scrlMapTintData(Index).value Case 3 lblMapTintData(Index).Caption = "Opacity: " & scrlMapTintData(Index).value Events(EditorIndex).SubEvents(ListIndex).data(5) = scrlMapTintData(Index).value End SelectEnd SubPrivate Sub scrlMenuOptDest_Change() lblMenuOptDest.Caption = "Destination: " & scrlMenuOptDest.valueEnd SubPrivate Sub scrlMessageSprite_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub If scrlMessageSprite.value = 0 Then lblMessageSprite.Caption = "Sprite: Player" Else lblMessageSprite.Caption = "Sprite: " & scrlMessageSprite.value End If Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlMessageSprite.valueEnd SubPrivate Sub scrlOpenEventX_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblOpenEventX.Caption = "X: " & scrlOpenEventX.value Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlOpenEventX.valueEnd SubPrivate Sub scrlOpenEventY_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblOpenEventY.Caption = "Y: " & scrlOpenEventY.value Events(EditorIndex).SubEvents(ListIndex).data(2) = scrlOpenEventY.valueEnd SubPrivate Sub scrlOpenShop_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblOpenShop.Caption = "Open Shop: " & scrlOpenShop.value & "-" & Shop(scrlOpenShop.value).name Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlOpenShop.valueEnd SubPrivate Sub scrlPlayAnimationAnim_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblPlayAnimationAnim.Caption = "Animation: " & scrlPlayAnimationAnim.value & "-" & Animation(scrlPlayAnimationAnim.value).name Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlPlayAnimationAnim.valueEnd SubPrivate Sub scrlPlayAnimationX_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub If scrlPlayAnimationX.value >= 0 Then lblPlayAnimationX.Caption = "X: " & scrlPlayAnimationX.value Else lblPlayAnimationX.Caption = "X: Player's X Position" End If Events(EditorIndex).SubEvents(ListIndex).data(2) = scrlPlayAnimationX.valueEnd SubPrivate Sub scrlPlayAnimationY_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub If scrlPlayAnimationY.value >= 0 Then lblPlayAnimationY.Caption = "Y: " & scrlPlayAnimationY.value Else lblPlayAnimationY.Caption = "Y: Player's Y Position" End If Events(EditorIndex).SubEvents(ListIndex).data(3) = scrlPlayAnimationY.valueEnd SubPrivate Sub scrlPositive_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblPositive.Caption = "Positive: " & scrlPositive.value Events(EditorIndex).SubEvents(ListIndex).data(3) = scrlPositive.valueEnd SubPrivate Sub scrlNegative_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblNegative.Caption = "Negative: " & scrlNegative.value Events(EditorIndex).SubEvents(ListIndex).data(4) = scrlNegative.valueEnd SubPrivate Sub scrlWarpMap_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblWarpMap.Caption = "Map: " & scrlWarpMap.value Events(EditorIndex).SubEvents(ListIndex).data(1) = scrlWarpMap.valueEnd SubPrivate Sub scrlWarpX_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblWarpX.Caption = "X: " & scrlWarpX.value Events(EditorIndex).SubEvents(ListIndex).data(2) = scrlWarpX.valueEnd SubPrivate Sub scrlWarpY_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblWarpY.Caption = "Y: " & scrlWarpY.value Events(EditorIndex).SubEvents(ListIndex).data(3) = scrlWarpY.valueEnd SubPrivate Sub scrlWeatherIntensity_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub lblWeatherIntensity.Caption = "Intensity: " & scrlWeatherIntensity.value Events(EditorIndex).SubEvents(ListIndex).data(3) = scrlWeatherIntensity.valueEnd SubPrivate Sub txtAddText_Text_Change() Events(EditorIndex).SubEvents(ListIndex).Text(1) = Trim$(txtAddText_Text.Text)End SubPrivate Sub txtBranchItemAmount_Change() If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(5) = Val(txtBranchItemAmount.Text)End SubPrivate Sub txtBranchLevelReq_Change() If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = Val(txtBranchLevelReq.Text)End SubPrivate Sub txtBranchVarReq_Change() If EditorIndex = 0 Or ListIndex = 0 Then Exit Sub Events(EditorIndex).SubEvents(ListIndex).data(2) = Val(txtBranchVarReq.Text)End SubPrivate Sub txtChatbubbleText_Change() Events(EditorIndex).SubEvents(ListIndex).Text(1) = txtChatbubbleText.TextEnd SubPrivate Sub txtMenuQuery_Change() Events(EditorIndex).SubEvents(ListIndex).Text(1) = txtMenuQuery.TextEnd SubPrivate Sub txtName_Change() If EditorIndex <= 0 Or EditorIndex > MAX_EVENTS Then Exit Sub Events(EditorIndex).name = txtName.TextEnd SubPublic Sub PopulateSubEventList() Dim tempIndex As Long, i As Long tempIndex = lstSubEvents.ListIndex lstSubEvents.Clear If Events(EditorIndex).HasSubEvents Then For i = 1 To UBound(Events(EditorIndex).SubEvents) lstSubEvents.AddItem i & ": " & GetEventTypeName(EditorIndex, i) Next i End If cmdSubEventRemove.Enabled = Events(EditorIndex).HasSubEvents If tempIndex >= 0 And tempIndex < lstSubEvents.ListCount - 1 Then lstSubEvents.ListIndex = tempIndex Call PopulateSubEventConfigEnd SubPublic Sub PopulateSubEventConfig() Dim i As Long, cap As Long If Not (fraEditCommand.visible) Then Exit Sub If ListIndex = 0 Then Exit Sub HideMenus 'Ensure Capacity Call Events_SetSubEventType(EditorIndex, ListIndex, Events(EditorIndex).SubEvents(ListIndex).Type) With Events(EditorIndex).SubEvents(ListIndex) Select Case .Type Case Evt_Message txtPlayerText.Text = Trim$(.Text(1)) scrlMessageSprite.value = .data(1) fraPlayerText.visible = True Case Evt_Menu txtMenuQuery.Text = Trim$(.Text(1)) lstMenuOptions.Clear For i = 2 To UBound(.Text) lstMenuOptions.AddItem Trim$(.Text(i)) & ": " & .data(i - 1) Next i scrlMenuOptDest.max = UBound(Events(EditorIndex).SubEvents) fraMenu.visible = True Case Evt_OpenShop If .data(1) < 1 Or .data(1) > MAX_SHOPS Then .data(1) = 1 scrlOpenShop.value = .data(1) Call scrlOpenShop_Change fraOpenShop.visible = True Case Evt_GiveItem If .data(1) < 1 Or .data(1) > MAX_ITEMS Then .data(1) = 1 If .data(2) < 1 Then .data(2) = 1 optItemOperation(.data(3)).value = True scrlGiveItemID.value = .data(1) scrlGiveItemAmount.value = .data(2) Call scrlGiveItemID_Change Call scrlGiveItemAmount_Change fraGiveItem.visible = True Case Evt_PlayAnimation If .data(1) < 1 Or .data(1) > MAX_ANIMATIONS Then .data(1) = 1 scrlPlayAnimationAnim.value = .data(1) scrlPlayAnimationX.value = .data(2) scrlPlayAnimationY.value = .data(3) Call scrlPlayAnimationAnim_Change Call scrlPlayAnimationX_Change Call scrlPlayAnimationY_Change fraAnimation.visible = True Case Evt_Warp If .data(1) < 1 Or .data(1) > MAX_MAPS Then .data(1) = 1 scrlWarpMap.value = .data(1) scrlWarpX.value = .data(2) scrlWarpY.value = .data(3) Call scrlWarpMap_Change Call scrlWarpX_Change Call scrlWarpY_Change fraMapWarp.visible = True Case Evt_GOTO If .data(1) < 1 Or .data(1) > UBound(Events(EditorIndex).SubEvents) Then .data(1) = 1 scrlGOTO.max = UBound(Events(EditorIndex).SubEvents) scrlGOTO.value = .data(1) Call scrlGOTO_Change fraGoTo.visible = True Case Evt_Switch cmbSwitch.ListIndex = .data(1) cmbPlayerSwitchSet.ListIndex = .data(2) fraChangeSwitch.visible = True Case Evt_Variable optVariableAction(.data(1)).value = True If .data(1) = 3 Then txtVariableData(1) = .data(2) txtVariableData(2) = .data(3) Else txtVariableData(0) = .data(2) End If fraChangeVariable.visible = True Case Evt_AddText txtAddText_Text.Text = Trim$(.Text(1)) scrlAddText_Colour.value = .data(1) optChannel(.data(2)).value = True fraAddText.visible = True Case Evt_Chatbubble txtChatbubbleText.Text = Trim$(.Text(1)) optChatBubbleTarget(.data(1)).value = True cmbChatBubbleTarget.ListIndex = .data(2) - 1 fraChatbubble.visible = True Case Evt_Branch scrlPositive.max = UBound(Events(EditorIndex).SubEvents) scrlNegative.max = UBound(Events(EditorIndex).SubEvents) scrlPositive.value = .data(3) scrlNegative.value = .data(4) optCondition_Index(.data(1)) = True Select Case .data(1) Case 0 cmbBranchVar.ListIndex = .data(6) txtBranchVarReq.Text = .data(2) cmbVarReqOperator.ListIndex = .data(5) Case 1 cmbBranchSwitch.ListIndex = .data(5) cmbBranchSwitchReq.ListIndex = .data(2) Case 2 cmbBranchItem.ListIndex = .data(2) - 1 txtBranchItemAmount.Text = .data(5) Case 3 cmbBranchClass.ListIndex = .data(2) - 1 Case 4 cmbBranchSkill.ListIndex = .data(2) - 1 Case 5 cmbLevelReqOperator.ListIndex = .data(5) txtBranchLevelReq.Text = .data(2) End Select fraBranch.visible = True Case Evt_ChangeSkill cmbChangeSkills.ListIndex = .data(1) - 1 optChangeSkills(.data(2)).value = True fraChangeSkill.visible = True Case Evt_ChangeLevel scrlChangeLevel.value = .data(1) optLevelAction(.data(2)).value = True fraChangeLevel.visible = True Case Evt_ChangeSprite scrlChangeSprite.value = .data(1) fraChangeSprite.visible = True Case Evt_ChangePK optChangePK(.data(1)).value = True fraChangePK.visible = True Case Evt_SpawnNPC cmbSpawnNPC.ListIndex = .data(1) - 1 fraSpawnNPC.visible = True Case Evt_ChangeClass cmbChangeClass.ListIndex = .data(1) - 1 fraChangeClass.visible = True Case Evt_ChangeSex optChangeSex(.data(1)).value = True fraChangeSex.visible = True Case Evt_ChangeExp scrlChangeExp.value = .data(1) optExpAction(.data(2)).value = True fraChangeExp.visible = True Case Evt_SpecialEffect cmbEffectType.ListIndex = .data(1) Select Case .data(1) Case 3 ScrlFogData(0).value = .data(2) ScrlFogData(1).value = .data(3) ScrlFogData(2).value = .data(4) Case 4 CmbWeather.ListIndex = .data(2) scrlWeatherIntensity.value = .data(3) Case 5 scrlMapTintData(0).value = .data(2) scrlMapTintData(1).value = .data(3) scrlMapTintData(2).value = .data(4) scrlMapTintData(3).value = .data(5) End Select fraSpecialEffect.visible = True Case Evt_PlaySound For i = 1 To UBound(soundCache()) If soundCache(i) = Trim$(.Text(1)) Then cmbPlaySound.ListIndex = i - 1 End If Next fraPlaySound.visible = True Case Evt_PlayBGM For i = 1 To UBound(musicCache()) If musicCache(i) = Trim$(.Text(1)) Then cmbPlayBGM.ListIndex = i - 1 End If Next fraPlayBGM.visible = True Case Evt_SetAccess cmbSetAccess.ListIndex = .data(1) fraSetAccess.visible = True Case Evt_CustomScript scrlCustomScript.value = .data(1) fraCustomScript.visible = True Case Evt_OpenEvent scrlOpenEventX.value = .data(1) scrlOpenEventY.value = .data(2) optOpenEventType(.data(3)).value = True cmbOpenEventType.ListIndex = .data(4) fraOpenEvent.visible = True End Select End WithEnd SubPrivate Sub HideMenus() fraPlayerText.visible = False fraMenu.visible = False fraOpenShop.visible = False fraGiveItem.visible = False fraAnimation.visible = False fraMapWarp.visible = False fraGoTo.visible = False fraChangeSwitch.visible = False fraChangeVariable.visible = False fraAddText.visible = False fraChatbubble.visible = False fraBranch.visible = False fraChangeLevel.visible = False fraChangeSkill.visible = False fraChangeSprite.visible = False fraChangePK.visible = False fraSpawnNPC.visible = False fraChangeClass.visible = False fraChangeSex.visible = False fraSpecialEffect.visible = False fraPlaySound.visible = False fraPlayBGM.visible = False fraSetAccess.visible = False fraCustomScript.visible = False fraOpenEvent.visible = False fraChangeExp.visible = FalseEnd SubPrivate Sub txtPlayerText_Change() Dim tempIndex As Long tempIndex = lstSubEvents.ListIndex + 1 Events(EditorIndex).SubEvents(ListIndex).Text(1) = txtPlayerText.TextEnd SubPrivate Sub txtPlayerVariable_Change() Events(EditorIndex).VariableCondition = Val(txtPlayerVariable.Text)End SubPrivate Sub txtVariableData_Change(Index As Integer) Select Case Index Case 0: Events(EditorIndex).SubEvents(ListIndex).data(3) = Val(txtVariableData(0)) Case 1: Events(EditorIndex).SubEvents(ListIndex).data(3) = Val(txtVariableData(1)) Case 2: Events(EditorIndex).SubEvents(ListIndex).data(4) = Val(txtVariableData(2)) End SelectEnd Sub```Can you solve this problem ?i will put your name on my credits ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)Thanks ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)Sorry for bad english ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) Link to comment Share on other sites More sharing options...
abhi2011 Posted May 4, 2013 Share Posted May 4, 2013 Wrong sub.Find the scrollbar that resets to zero in the IDE.Double click on it.Paste the contents of that sub here.Find the sub EventEditorInit (If any) in modGameEditors.Paste the sub here. Link to comment Share on other sites More sharing options...
cacadosman Posted May 5, 2013 Author Share Posted May 5, 2013 > Wrong sub.> > Find the scrollbar that resets to zero in the IDE.> > Double click on it.> > Paste the contents of that sub here.> > Find the sub EventEditorInit (If any) in modGameEditors.> > Paste the sub here.hehehe, sorry ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)```Public Sub EventEditorInit()Dim I As LongWith frmEditor_EventsIf .visible = False Then Exit SubEditorIndex = .lstIndex.ListIndex + 1.txtName = Trim$(Events(EditorIndex).name).chkPlayerSwitch.value = Events(EditorIndex).chkSwitch.chkPlayerVar.value = Events(EditorIndex).chkVariable.chkHasItem.value = Events(EditorIndex).chkHasItem.cmbPlayerSwitch.ListIndex = Events(EditorIndex).SwitchIndex.cmbPlayerSwitchCompare.ListIndex = Events(EditorIndex).SwitchCompare.cmbPlayerVar.ListIndex = Events(EditorIndex).VariableIndex.cmbPlayerVarCompare.ListIndex = Events(EditorIndex).VariableCompare.txtPlayerVariable.Text = Events(EditorIndex).VariableCondition.cmbHasItem.ListIndex = Events(EditorIndex).HasItemIndex - 1.cmbTrigger.ListIndex = Events(EditorIndex).Trigger.chkWalkthrought.value = Events(EditorIndex).WalkThroughtCall .PopulateSubEventListEnd WithEvent_Changed(EditorIndex) = TrueEnd Sub``` Link to comment Share on other sites More sharing options...
abhi2011 Posted May 5, 2013 Share Posted May 5, 2013 I suppose you missed this part> Find the control that resets to zero in the IDE.> > Double click on it.> > Paste the contents of that sub here. Link to comment Share on other sites More sharing options...
cacadosman Posted May 5, 2013 Author Share Posted May 5, 2013 ok, i will check it 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