Skip to content

feat(script): Extend the functionality of team generic scripts#2510

Draft
Mauller wants to merge 4 commits intoTheSuperHackers:mainfrom
Mauller:Mauller/feat-extend-genericscript-functionality
Draft

feat(script): Extend the functionality of team generic scripts#2510
Mauller wants to merge 4 commits intoTheSuperHackers:mainfrom
Mauller:Mauller/feat-extend-genericscript-functionality

Conversation

@Mauller
Copy link
Copy Markdown

@Mauller Mauller commented Mar 30, 2026

Closes: #1468

This PR fixes and extends the functionality of Team generic scripts.

Team generic scripts are evaluated within their own update function on the team instead of within the script engine. This allows the handling of the "This Team" behaviour to be evalutated properly.

Originally Team generic scripts would ignore many script properties and had limited functionality compared to normal scripts that execute within the script engine. They were also shared between all instances of a team as the scripts existed on the team prototype.

This PR enables the following functionality for Team generic scripts;

  • Adhere to difficulty settings
  • Seconds based timings now work
  • Can be enabled and disabled through scripting
  • One-Shot scripts can be enabled again for another run
  • Individual Team instances have their own copies of scripts

The extended functionality is currently hidden behind a conditional to make sure the retail behaviour is currently maintained.
This was done to prevent mismatching when TSH clients play with retail clients, so a mismatch is prevented when a map has properties enabled that would have been ignored by retail.


  • Let some mappers in the community try out the non retail changes
  • Replicate in generals

@Mauller Mauller self-assigned this Mar 30, 2026
@Mauller Mauller added Enhancement Is new feature or request Gen Relates to Generals ZH Relates to Zero Hour Script Is related to Script Engine, SCB labels Mar 30, 2026
@Mauller Mauller changed the title Mauller/feat extend genericscript functionality feat(script): Extend the functionality of team generic scripts Mar 30, 2026
@Mauller
Copy link
Copy Markdown
Author

Mauller commented Mar 30, 2026

seems to be some mismatching that i was not expecting

@Mauller Mauller force-pushed the Mauller/feat-extend-genericscript-functionality branch from 256ce49 to d23f060 Compare March 31, 2026 19:11
@Mauller Mauller force-pushed the Mauller/feat-extend-genericscript-functionality branch from d23f060 to 8917f80 Compare April 1, 2026 22:58
@Mauller
Copy link
Copy Markdown
Author

Mauller commented Apr 1, 2026

All good, i gated the changes behind a new compilation conditional and refactored the orignal coded a little to make it easier to read when compared to the new code.

@Mauller Mauller force-pushed the Mauller/feat-extend-genericscript-functionality branch from 8917f80 to ee8ee5d Compare April 2, 2026 21:18
@Mauller
Copy link
Copy Markdown
Author

Mauller commented Apr 2, 2026

Just a small tweak so the non retail code could be built in VC6 too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals Script Is related to Script Engine, SCB ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subroutine scripts always evaluate every frame even when explicitly set differently

1 participant