Skip to content
This repository has been archived by the owner on Dec 21, 2020. It is now read-only.

AbilityType.CancelTrain isnt parsed correctly. Returns Unknown #33

Open
mikechambers opened this issue Nov 12, 2012 · 0 comments
Open

Comments

@mikechambers
Copy link

Linked below is a simple example that contains a replay with just a few events. Event 5 is a TrainSCV event, and Event 6 should be a CancelTrain or Cancel event (the SCV was cancelled in the replay. However, the EventType is Unknown.

string filename = @"test.SC2Replay";

Replay replay = Replay.Parse(filename);

List<IGameEvent> events = replay.PlayerEvents;

foreach (var e in events)
{
    if (e.Player.Name == "mesh") {
        if (e.EventType == GameEventType.Macro) {

            if (((AbilityEvent)e).AbilityType == AbilityType.Unknown)
            {
                System.Diagnostics.Debug.WriteLine(@"unknown");
            }

            if (((AbilityEvent)e).AbilityType == AbilityType.TrainSCV)
            {
                System.Diagnostics.Debug.WriteLine(@"trainscv");
            }
        }
    }
}

You can download the replay from:
http://dl.dropbox.com/u/361009/test.zip

Debugging into AbilityData.cs, the Unknown is coming from the final return, and not the check for index being greater than Data.Length.

Just adding some more info. GameEventType is also Unknown

Here is the Locals panel output for the Event should should be TrainCancel or Cancel.

-       [Starcraft2.ReplayParser.AbilityEvent]  {Starcraft2.ReplayParser.AbilityEvent}  Starcraft2.ReplayParser.AbilityEvent
-       base    {Starcraft2.ReplayParser.AbilityEvent}  Starcraft2.ReplayParser.GameEventBase {Starcraft2.ReplayParser.AbilityEvent}
        EventType   Unknown Starcraft2.ReplayParser.GameEventType
+       Player  {mesh}  Starcraft2.ReplayParser.Player
+       Time    {Starcraft2.ReplayParser.Timestamp} Starcraft2.ReplayParser.Timestamp
        AbilityFailed   false   bool
        AbilityType Unknown Starcraft2.ReplayParser.AbilityType
        AbilityUsed true    bool
+       Actors  Count = 1   System.Collections.Generic.List<Starcraft2.ReplayParser.Unit>
        DefaultAbility  false   bool
        DefaultActor    true    bool
        DefaultTarget   false   bool
        EnableAutoCast  false   bool
        MinimapClick    false   bool
        Queued  false   bool
        RightClick  false   bool
        TargetFlags 0   int
        TargetId    0   uint
        TargetLocation  null    Starcraft2.ReplayParser.Location
        TargetPlayer    0   int
        TargetTeam  0   int
        TargetUnit  null    Starcraft2.ReplayParser.Unit
        ToggleAbility   false   bool
        WireframeCancel false   bool
        WireframeClick  false   bool
        WireframeIndex  0   int
        WireframeUnload false   bool
        EventType   Unknown Starcraft2.ReplayParser.GameEventType
+       Player  {mesh}  Starcraft2.ReplayParser.Player
+       Time    {Starcraft2.ReplayParser.Timestamp} Starcraft2.ReplayParser.Timestamp
robert-nix added a commit to robert-nix/sc2replay-csharp that referenced this issue Nov 14, 2012
ascendedguard added a commit that referenced this issue Nov 15, 2012
Added ability map for que5CancelToSelection (Issue #33)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant