Skip to content

Subroutine scripts always evaluate every frame even when explicitly set differently #1468

@WWB2-account

Description

@WWB2-account

Prerequisites

  • I have searched for similar issues and confirmed this is not a duplicate

Game Version

  • Command & Conquer Generals
  • Command & Conquer Generals: Zero Hour
  • Other (please specify below)

Bug Description

Scripts can be set to evaluate at every given frame, or at a certain interval. See image:Image

This works perfectly if the box Script is Subroutine is unchecked. If it is checked, the script always evaluates every frame, even when explicitly set otherwise.

Image

There isn't a real consensus on whether this behavior is a bug or not. It would be good to investigate first if this is intended behaviour.

Reproduction Steps

This test map will show the issue in action. In the map, the GLA AI opponent will build technicals and rebels. A counter will increment 1 every frame if it has at least one rebel. A different counter should increment 1 every second if it has at least one technical, but also increments every frame.

Open the map with ScriptDebugger to see what is going on.

Additional Context

This phenomenon is well known in the mapmaking/scripting corner of the community, and is generally avoided because of this inconsistent behavior. Adjusting this would make behaviors for the AI trivial that were previously tedious or downright impossible.

That being said, I wouldn't change this until after retail compatibility has been broken. This is a controversial change; not because of balance but because of potentially extreme implications this will have on any maps in the future (or existing maps). Before changing this, a discussion with the mapmaking/scripting community is needed.

I would flag this issue with the Controversial, Investigate, and DoLater labels in addition to the standard ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working right, typically is user facingControversialIs controversialDo LaterWork on this laterGenRelates to GeneralsInvestigateMinorSeverity: Minor < Major < Critical < BlockerScriptIs related to Script Engine, SCBWorldBuilderRelates to World BuilderZHRelates to Zero Hour

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions