upd: I’m sorry, didn’t see the “Bug fixes” inside the “Tutorials”. Please move my topic there 🙂

Good day to all.

This topic isn’t for question (the question was answered by myself), but for the some kind of bugreport.

Let’s look at this simple event:

[attachment=1305:choice_bug.PNG]

It works improperly in EO 3.0. “Text after choice 1” is skipped entirely, and “Text after choice 2” is repeating over and over.

The fix for this is like following.

  1. To prevent skipping the first command, open the modHandleData.bas at server and find the following in the sub HandleChatReply:

Select Case reply
    Case 1
        TempPlayer(index).EventProcessing(i).ListLeftOff(TempPlayer(index).EventProcessing(i).CurList) = TempPlayer(index).EventProcessing(i).CurSlot
        TempPlayer(index).EventProcessing(i).CurList = Map(GetPlayerMap(index)).Events(eventID).Pages(pageID).CommandList(TempPlayer(index).EventProcessing(i).CurList).Commands(TempPlayer(index).EventProcessing(i).CurSlot - 1).Data1
        TempPlayer(index).EventProcessing(i).CurSlot = 1
    Case 2
        TempPlayer(index).EventProcessing(i).ListLeftOff(TempPlayer(index).EventProcessing(i).CurList) = TempPlayer(index).EventProcessing(i).CurSlot
        TempPlayer(index).EventProcessing(i).CurList = Map(GetPlayerMap(index)).Events(eventID).Pages(pageID).CommandList(TempPlayer(index).EventProcessing(i).CurList).Commands(TempPlayer(index).EventProcessing(i).CurSlot - 1).Data2
        TempPlayer(index).EventProcessing(i).CurSlot = 1
   Case 3
        TempPlayer(index).EventProcessing(i).ListLeftOff(TempPlayer(index).EventProcessing(i).CurList) = TempPlayer(index).EventProcessing(i).CurSlot
        TempPlayer(index).EventProcessing(i).CurList = Map(GetPlayerMap(index)).Events(eventID).Pages(pageID).CommandList(TempPlayer(index).EventProcessing(i).CurList).Commands(TempPlayer(index).EventProcessing(i).CurSlot - 1).Data3
        TempPlayer(index).EventProcessing(i).CurSlot = 1
   Case 4
        TempPlayer(index).EventProcessing(i).ListLeftOff(TempPlayer(index).EventProcessing(i).CurList) = TempPlayer(index).EventProcessing(i).CurSlot
        TempPlayer(index).EventProcessing(i).CurList = Map(GetPlayerMap(index)).Events(eventID).Pages(pageID).CommandList(TempPlayer(index).EventProcessing(i).CurList).Commands(TempPlayer(index).EventProcessing(i).CurSlot - 1).Data4
        TempPlayer(index).EventProcessing(i).CurSlot = 1
End Select

In all four blocks the first line must have “-1” at the end, i.e. be changed to the following:


TempPlayer(index).EventProcessing(i).ListLeftOff(TempPlayer(index).EventProcessing(i).CurList) = TempPlayer(index).EventProcessing(i).CurSlot - 1

The reason for this is that at the moment of getting the reply the event command list is shifted, and the “current” command is in fact the one following the choice.

  1. To prevend infinite loop, we should make the ListLeftOff equal 0 in every command which doesn’t involve the movement to the other list (that is, every command except Jump to Label, Conditional and Show Choice). This is achieved by adding the string

.ListLeftOff(.CurList) = 0

in the sub ProcessEventCommands (file modEventLogic.bas at the server). Find this (sorry, a part of a comment is a victim of censorship):


'If we are still here, then we are good to process * :D
Select Case Map(GetPlayerMap(i)).Events(.eventID).Pages(.pageID).CommandList(.CurList).Commands(.CurSlot).index

The string must be placed in all the following cases, except EventType.evShowChoices, EventType.evCondition and EventType.evGotoLabel, just before the next Case to appear (at the end of the processed code).