Coder Social home page Coder Social logo

crushakrool / ut2k4_mut_onslaught-score-normalizer Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 10 KB

Mutator for Unreal Tournament 2004 that changes scoring rules in Onslaught so that a victory in regular time and overtime are worth the same amount of points.

License: Other

UnrealScript 100.00%
ut2004 unreal unreal-engine unreal-engine-2 mutator mod

ut2k4_mut_onslaught-score-normalizer's Introduction

This Mutator changes scoring rules in Onslaught so that a victory in regular time and overtime are both worth 1 point, rather than giving 2 for a victory in regular time and 1 for overtime.

Usage

You can simply activate it like any other Mutator through the game UI.

If you are a server administrator and don't want your server to become non-standard from using a Mutator that is not on the whitelist, you may also simply add this as a ServerActor:

[Engine.GameEngine]
...
ServerActors=OnslaughtScoreNormalizer.OnslaughtScoreNormalizerRules

OnslaughtScoreNormalizer is the name of this code's package/compiled .u file.

Implementation note

The game does not really offer a hook to change the actual scoring rules without creating a new gametype, so this implementation uses a little hack instead:

It uses the GameRules.CheckScore() hook that is checked every time an objective is scored, which is meant to let mods prevent the game from ending at that point. Inside this hook will it reduce the scoring team's score by 1 if its not overtime (yes, we deliberately create side effects in a function that is only meant to be called for its return value). This winning scenario would have given the team 2 points in a normal match.

Since we don't know if the hook got called from destroying the final core or just a regular node and we only want to subtract the score once at the very end of a match, we check the remaining HP on the cores at that point and deduce from that whether the match ended.

This should not be any issue in any normal match scenario. But since it's a slight hack, I can't make any guarantees about how it might work in conjunction with other mods that do something in this area.

ut2k4_mut_onslaught-score-normalizer's People

Contributors

crushakrool avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.